ScummVM API documentation
dirtyrects.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GRAPHICS_DIRTYRECTS_H
23 #define GRAPHICS_DIRTYRECTS_H
24 
25 #include "common/list.h"
26 #include "common/rect.h"
27 
28 namespace Graphics {
29 
44 public:
47 protected:
52 
53 protected:
57  bool unionRectangle(Common::Rect &destRect, const Common::Rect &src1, const Common::Rect &src2);
58 
59 public:
63  void merge();
64 
68  bool empty() const { return _dirtyRects.empty(); }
69 
73  void clear() { _dirtyRects.clear(); }
74 
79  template<class... TArgs>
80  void emplace_back(TArgs &&...args) { _dirtyRects.emplace_back(Common::forward<TArgs>(args)...); }
81 
86  void push_back(const Common::Rect &r) { _dirtyRects.push_back(r); }
87 
92  void push_back(Common::Rect &&r) { _dirtyRects.push_back(Common::move(r)); }
93 
98  const_iterator begin() const {
99  return _dirtyRects.begin();
100  }
101 
103  const_iterator end() const {
104  return _dirtyRects.end();
105  }
106 };
108 } // End of namespace Graphics
109 
110 #endif
Common::List< Common::Rect > _dirtyRects
Definition: dirtyrects.h:51
Definition: rect.h:524
bool unionRectangle(Common::Rect &destRect, const Common::Rect &src1, const Common::Rect &src2)
void push_back(Common::Rect &&r)
Definition: dirtyrects.h:92
const_iterator end() const
Definition: dirtyrects.h:103
iterator end()
Definition: list.h:279
iterator begin()
Definition: list.h:266
void push_back(const Common::Rect &r)
Definition: dirtyrects.h:86
Definition: formatinfo.h:28
void clear()
Definition: list.h:245
bool empty() const
Definition: dirtyrects.h:68
void emplace_back(TArgs &&...args)
Definition: list.h:169
Out move(In first, In last, Out dst)
Definition: algorithm.h:109
const_iterator begin() const
Definition: dirtyrects.h:98
void emplace_back(TArgs &&...args)
Definition: dirtyrects.h:80
Definition: dirtyrects.h:43
void clear()
Definition: dirtyrects.h:73
Definition: list_intern.h:51
void push_back(const t_T &element)
Definition: list.h:174
bool empty() const
Definition: list.h:258
Common::List< Common::Rect >::const_iterator const_iterator
Definition: dirtyrects.h:45