ScummVM API documentation
cliprect.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 * Clipping rectangle defines
21 */
22
23#ifndef TINSEL_CLIPRECT_H // prevent multiple includes
24#define TINSEL_CLIPRECT_H
25
26#include "common/list.h"
27#include "common/rect.h"
28
29namespace Tinsel {
30
31struct OBJECT;
32
33typedef Common::List<Common::Rect> RectList;
34
35/*----------------------------------------------------------------------*\
36|* Clip Rect Function Prototypes *|
37\*----------------------------------------------------------------------*/
38
39void ResetClipRect(); // Resets the clipping rectangle allocator
40
41void AddClipRect( // Allocate a clipping rectangle from the free list
42 const Common::Rect &pClip); // clip rectangle dimensions to allocate
43
44const RectList &GetClipRects();
45
46bool IntersectRectangle( // Creates the intersection of two rectangles
47 Common::Rect &pDest, // pointer to destination rectangle that is to receive the intersection
48 const Common::Rect &pSrc1, // pointer to a source rectangle
49 const Common::Rect &pSrc2); // pointer to a source rectangle
50
51bool UnionRectangle( // Creates the union of two rectangles
52 Common::Rect &pDest, // destination rectangle that is to receive the new union
53 const Common::Rect &pSrc1, // a source rectangle
54 const Common::Rect &pSrc2); // a source rectangle
55
56void FindMovingObjects( // Creates clipping rectangles for all the objects that have moved on the specified object list
57 OBJECT **pObjList, // playfield display list to draw
58 Common::Point *pWin, // playfield window top left position
59 Common::Rect *pClip, // playfield clipping rectangle
60 bool bVelocity, // when set, objects pos is updated with velocity
61 bool bScrolled); // when set, playfield has scrolled
62
63void MergeClipRect(); // Merges any clipping rectangles that overlap
64
65void UpdateClipRectSingle( // Redraws single object within this clipping rectangle
66 OBJECT *pObj, // object to draw
67 Common::Point *pWin, // window top left position
68 Common::Rect *pClip); // pointer to clip rectangle
69
70void UpdateClipRect( // Redraws all objects within this clipping rectangle
71 OBJECT **pObjList, // object list to draw
72 Common::Point *pWin, // window top left position
73 Common::Rect *pClip); // pointer to clip rectangle
74
75} // End of namespace Tinsel
76
77#endif // TINSEL_CLIPRECT_H
Definition: actors.h:36
Definition: rect.h:144
Definition: rect.h:536