22 #ifndef TWINE_SCENE_GRID_H 23 #define TWINE_SCENE_GRID_H 25 #define WATER_BRICK (0xF1) 27 #include "common/scummsys.h" 28 #include "twine/parser/blocklibrary.h" 29 #include "twine/parser/sprite.h" 30 #include "twine/shared.h" 45 uint8 brickBlockIdx = 0;
68 #define NUM_BRICKS 9000 71 #define SIZE_CUBE_X 64 73 #define SIZE_CUBE_Y 25 75 #define SIZE_CUBE_Z SIZE_CUBE_X 78 #define SIZE_BRICK_XZ 512 79 #define SIZE_BRICK_Y 256 80 #define DEMI_BRICK_XZ 256 81 #define DEMI_BRICK_Y 128 85 #define SCENE_SIZE_MAX (SIZE_BRICK_XZ * (SIZE_CUBE_X - 1)) 87 #define SCENE_SIZE_MIN (-SIZE_BRICK_XZ * SIZE_CUBE_X) 88 #define SCENE_SIZE_HALF (SIZE_BRICK_XZ * SIZE_CUBE_X / 2) 89 #define SCENE_SIZE_HALFF (SIZE_BRICK_XZ * SIZE_CUBE_X / 2.0f) 107 void drawColumnGrid(int32 blockIdx, int32 brickBlockIdx, int32 x, int32 y, int32 z);
114 void getBrickPos(int32 x, int32 y, int32 z, int32 &_brickPixelPosX, int32 &_brickPixelPosY)
const;
119 void createCellingGridMap(
const uint8 *gridPtr, int32 gridPtrSize);
125 void calcGraphMsk(
const uint8 *gridEntry, uint32 gridEntrySize, uint8 *dest, uint32 destSize);
131 void decompColumn(
const uint8 *gridEntry, uint32 gridEntrySize, uint8 *dest, uint32 destSize);
135 void loadGridBricks();
137 void createGridMask();
143 void processGridMask(
const uint8 *buffer, uint8 *ptr);
154 uint8 *_brickTable[NUM_BRICKS]{
nullptr};
156 uint8 *_brickMaskTable[NUM_BRICKS]{
nullptr};
158 uint32 _brickSizeTable[NUM_BRICKS]{0};
160 uint8 _brickUsageTable[NUM_BRICKS]{0};
163 int32 _currentGridSize = 0;
164 uint8 *_currentGrid =
nullptr;
171 int16 *_brickInfoBuffer =
nullptr;
172 int32 _brickInfoBufferSize = 0;
175 int32 _blockBufferSize = 0;
176 uint8 *_bufCube =
nullptr;
178 const BrickEntry* getBrickEntry(int32 j, int32 i)
const;
180 const IVec3 &updateCollisionCoordinates(int32 x, int32 y, int32 z);
182 BlockEntry getBlockEntry(int32 xmap, int32 ymap, int32 zmap)
const;
184 bool shouldCheckWaterCol(int32 actorIdx)
const;
189 void init(int32 w, int32 h);
194 const uint8 *getBlockBufferGround(
const IVec3 &pos, int32 &ground);
213 void drawOverBrick(int32 x, int32 y, int32 z);
221 void drawOverBrick3(int32 x, int32 y, int32 z);
230 void getSpriteSize(int32 offset, int32 *width, int32 *height,
const uint8 *spritePtr);
233 void centerScreenOnActor();
242 bool drawBrick(int32 index, int32 posX, int32 posY);
251 bool drawSprite(int32 index, int32 posX, int32 posY,
const uint8 *spritePtr);
252 bool drawSprite(int32 posX, int32 posY,
const SpriteData &ptr,
int spriteIndex = 0);
261 bool drawBrickSprite(int32 posX, int32 posY,
const uint8 *spritePtr,
bool isSprite);
268 const BlockData *getBlockLibrary(int32 blockIdx)
const;
269 const BlockDataEntry* getAdrBlock(int32 blockIdx, int32 tmpBrickIdx)
const;
272 void copyMapToCube();
278 bool initGrid(int32 index);
284 bool initCellingGrid(int32 index);
289 ShapeType worldColBrick(int32 x, int32 y, int32 z);
291 ShapeType worldColBrickFull(int32 x, int32 y, int32 z, int32 y2, int32 actorIdx);
293 uint8 worldCodeBrick(int32 x, int32 y, int32 z);
295 inline ShapeType worldColBrick(
const IVec3 &pos) {
296 return worldColBrick(pos.x, pos.y, pos.z);
299 inline ShapeType worldColBrickFull(
const IVec3 &pos, int32 y2, int32 actorIdx) {
300 return worldColBrickFull(pos.x, pos.y, pos.z, y2, actorIdx);
Definition: managed_surface.h:51
Definition: blocklibrary.h:42
Definition: blocklibrary.h:32
Definition: blocklibrary.h:46
Definition: formatinfo.h:28
Definition: achievements_tables.h:27
IVec3 _startCube
Definition: grid.h:197
IVec3 _worldCube
Definition: grid.h:200