22 #ifndef SCI_GRAPHICS_PLANE32_H 23 #define SCI_GRAPHICS_PLANE32_H 25 #include "common/array.h" 26 #include "common/rect.h" 27 #include "sci/engine/features.h" 28 #include "sci/engine/vm_types.h" 29 #include "sci/graphics/helpers.h" 30 #include "sci/graphics/lists32.h" 31 #include "sci/graphics/screen_item32.h" 35 kPlaneTypeColored = 0,
36 kPlaneTypePicture = 1,
37 kPlaneTypeTransparent = 2,
39 kPlaneTypeTransparentPicture = 4
42 enum PlanePictureCodes {
45 kPlanePicTransparentPicture = 65532,
46 kPlanePicOpaque = 65533,
47 kPlanePicTransparent = 65534,
48 kPlanePicColored = 65535
54 typedef StablePointerArray<Common::Rect, 200> RectListBase;
76 inline bool operator<(
const DrawItem &other)
const {
109 static uint16 _nextObjectId;
115 static uint32 _nextCreationId;
128 GuiResourceId _pictureId;
141 bool _pictureChanged;
148 void convertGameRectToPlaneRect();
247 Plane(
const Common::Rect &gameRect, PlanePictureCodes pictureId = kPlanePicColored);
253 void operator=(
const Plane &other);
255 inline bool operator<(
const Plane &other)
const {
263 return _creationId < other._creationId;
278 _screenRect.
clip(screenRect);
280 _screenRect.
left = 0;
282 _screenRect.
right = 0;
283 _screenRect.bottom = 0;
287 void printDebugInfo(
Console *con)
const;
304 void update(
const reg_t object);
310 void scrollScreenItems(
const int16 deltaX,
const int16 deltaY,
const bool scrollPics);
316 return _object.isNumber() && _object.getOffset() == (uint32)
g_sci->_features->detectPlaneIdBase();
320 #pragma mark Plane - Pic 328 inline void addPicInternal(
const GuiResourceId pictureId,
const Common::Point *position,
const bool mirrorX);
334 void deletePic(
const GuiResourceId pictureId);
340 void deleteAllPics();
348 GuiResourceId addPic(
const GuiResourceId pictureId,
const Common::Point &position,
const bool mirrorX,
const bool deleteDuplicate =
true);
361 void deletePic(
const GuiResourceId oldPictureId,
const GuiResourceId newPictureId);
364 #pragma mark Plane - Rendering 370 void breakDrawListByPlanes(
DrawList &drawList,
const PlaneList &planeList)
const;
376 void breakEraseListByPlanes(
RectList &eraseList,
const PlaneList &planeList)
const;
384 void mergeToDrawList(
const DrawList::size_type index,
const Common::Rect &rect,
DrawList &drawList)
const;
408 void decrementScreenItemArrayCounts(
Plane *visiblePlane,
const bool forceUpdate);
444 void filterUpEraseRects(
DrawList &drawList,
const RectList &lowerEraseList)
const;
460 void filterUpDrawRects(
DrawList &drawList,
const DrawList &lowerDrawList)
const;
472 void remapMarkRedraw();
476 #pragma mark PlaneList 481 inline static bool sortHelper(
const Plane *a,
const Plane *b) {
491 int findIndexByObject(
const reg_t object)
const;
492 Plane *findByObject(
const reg_t object)
const;
497 int16 getTopPlanePriority()
const;
503 int16 getTopSciPlanePriority()
const;
505 void add(
Plane *plane);
517 #endif // SCI_GRAPHICS_PLANE32_H size_type pack()
Definition: lists32.h:176
void clipScreenRect(const Common::Rect &screenRect)
Definition: plane32.h:272
Definition: screen_item32.h:359
int16 right
Definition: rect.h:146
Definition: plane32.h:103
T * iterator
Definition: array.h:54
byte _back
Definition: plane32.h:165
Common::Rect _screenRect
Definition: plane32.h:230
void add(T *item)
Definition: lists32.h:111
ScreenItem * screenItem
Definition: plane32.h:69
int _redrawAllCount
Definition: plane32.h:194
void push_back(const T &element)
Definition: array.h:180
int16 _priority
Definition: plane32.h:185
int _priorityChanged
Definition: plane32.h:172
Common::Rect rect
Definition: plane32.h:74
Common::Rect _gameRect
Definition: plane32.h:224
Definition: lists32.h:215
int16 left
Definition: rect.h:145
Common::Point _vanishingPoint
Definition: plane32.h:212
bool intersects(const Rect &r) const
Definition: rect.h:255
bool isValidRect() const
Definition: rect.h:337
ScreenItemList _screenItemList
Definition: plane32.h:235
uint size_type
Definition: array.h:59
Definition: plane32.h:479
void clip(const Rect &r)
Definition: rect.h:300
Definition: screen_item32.h:53
void sort(T first, T last, StrictWeakOrdering comp)
Definition: algorithm.h:349
Definition: vm_types.h:39
void erase(T *item)
Definition: lists32.h:144
bool isDefaultPlane()
Definition: plane32.h:315
PlaneType _type
Definition: plane32.h:159
Common::Rect _planeRect
Definition: plane32.h:219
reg_t _object
Definition: plane32.h:179
int _created
Definition: plane32.h:205