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
42enum PlanePictureCodes {
45 kPlanePicTransparentPicture = 65532,
46 kPlanePicOpaque = 65533,
47 kPlanePicTransparent = 65534,
48 kPlanePicColored = 65535
54typedef StablePointerArray<Common::Rect, 200> RectListBase;
76 inline bool operator<(
const DrawItem &other)
const {
81typedef StablePointerDynamicArray<DrawItem, 250> DrawListBase;
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;
287 void printDebugInfo(
Console *con)
const;
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;
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;
505 void add(
Plane *plane);
508 void erase(
Plane *plane);
iterator end()
Definition: array.h:380
uint size_type
Definition: array.h:62
T * iterator
Definition: array.h:54
void push_back(const T &element)
Definition: array.h:181
iterator begin()
Definition: array.h:375
Definition: plane32.h:103
Common::Point _vanishingPoint
Definition: plane32.h:212
ScreenItemList _screenItemList
Definition: plane32.h:235
void deletePic(const GuiResourceId oldPictureId, const GuiResourceId newPictureId)
byte _back
Definition: plane32.h:165
int _created
Definition: plane32.h:205
void calcLists(Plane &visiblePlane, const PlaneList &planeList, DrawList &drawList, RectList &eraseList)
void sync(const Plane *other, const Common::Rect &screenRect)
Common::Rect _screenRect
Definition: plane32.h:230
reg_t _object
Definition: plane32.h:179
Common::Rect _planeRect
Definition: plane32.h:219
int _priorityChanged
Definition: plane32.h:172
void scrollScreenItems(const int16 deltaX, const int16 deltaY, const bool scrollPics)
void filterDownEraseRects(DrawList &drawList, RectList &eraseList, RectList &higherEraseList) const
void filterUpEraseRects(DrawList &drawList, const RectList &lowerEraseList) const
int _redrawAllCount
Definition: plane32.h:194
void update(const reg_t object)
GuiResourceId addPic(const GuiResourceId pictureId, const Common::Point &position, const bool mirrorX, const bool deleteDuplicate=true)
void decrementScreenItemArrayCounts(Plane *visiblePlane, const bool forceUpdate)
PlaneType _type
Definition: plane32.h:159
void redrawAll(Plane *visiblePlane, const PlaneList &planeList, DrawList &drawList, RectList &eraseList)
void filterUpDrawRects(DrawList &drawList, const DrawList &lowerDrawList) const
int16 _priority
Definition: plane32.h:185
void clipScreenRect(const Common::Rect &screenRect)
Definition: plane32.h:272
Common::Rect _gameRect
Definition: plane32.h:224
bool isDefaultPlane()
Definition: plane32.h:315
Definition: plane32.h:479
int16 getTopPlanePriority() const
int16 getTopSciPlanePriority() const
Definition: screen_item32.h:53
Definition: screen_item32.h:359
void add(T *item)
Definition: lists32.h:111
Definition: lists32.h:215
size_type pack()
Definition: lists32.h:332
void sort(T first, T last, StrictWeakOrdering comp)
Definition: algorithm.h:349
T right
Definition: rect.h:171
bool intersects(const ConcreteRect &r) const
Definition: rect.h:291
bool isValidRect() const
Definition: rect.h:392
T left
Definition: rect.h:170
void clip(const ConcreteRect &r)
Definition: rect.h:348
Common::Rect rect
Definition: plane32.h:74
ScreenItem * screenItem
Definition: plane32.h:69
Definition: vm_types.h:39