diff options
Diffstat (limited to 'gob/scenery.h')
-rw-r--r-- | gob/scenery.h | 214 |
1 files changed, 113 insertions, 101 deletions
diff --git a/gob/scenery.h b/gob/scenery.h index 8b9b50d7ba..b80ed118cb 100644 --- a/gob/scenery.h +++ b/gob/scenery.h @@ -24,112 +24,124 @@ namespace Gob { +class Scenery { +public: #pragma START_PACK_STRUCTS -typedef struct Scen_PieceDesc { - int16 left; //NOTE: - int16 right; //These are stored in Little Endian format - int16 top; //And should be converted by client code when accessed - int16 bottom; //i.e. use FROM_LE_16() -} GCC_PACK Scen_PieceDesc; - -typedef struct Scen_StaticPlane { - int8 pictIndex; - int8 pieceIndex; - int8 drawOrder; - int16 destX; - int16 destY; - int8 transp; -} GCC_PACK Scen_StaticPlane; - -typedef struct Scen_StaticLayer { - int16 backResId; - int16 planeCount; - Scen_StaticPlane planes[1]; -} GCC_PACK Scen_StaticLayer; - -// Animations - -typedef struct Scen_AnimFramePiece { - byte pictIndex; - byte pieceIndex; - int8 destX; - int8 destY; - int8 notFinal; -} GCC_PACK Scen_AnimFramePiece; - -typedef struct Scen_AnimLayer { - int16 unknown0; - int16 posX; - int16 posY; - int16 animDeltaX; - int16 animDeltaY; - int8 transp; - int16 framesCount; - Scen_AnimFramePiece frames[1]; -} GCC_PACK Scen_AnimLayer; + typedef struct PieceDesc { + int16 left; //NOTE: + int16 right; //These are stored in Little Endian format + int16 top; //And should be converted by client code when accessed + int16 bottom; //i.e. use FROM_LE_16() + } GCC_PACK PieceDesc; + + typedef struct StaticPlane { + int8 pictIndex; + int8 pieceIndex; + int8 drawOrder; + int16 destX; + int16 destY; + int8 transp; + } GCC_PACK StaticPlane; + + typedef struct StaticLayer { + int16 backResId; + int16 planeCount; + StaticPlane planes[1]; + } GCC_PACK StaticLayer; + + // Animations + + typedef struct AnimFramePiece { + byte pictIndex; + byte pieceIndex; + int8 destX; + int8 destY; + int8 notFinal; + } GCC_PACK AnimFramePiece; + + typedef struct AnimLayer { + int16 unknown0; + int16 posX; + int16 posY; + int16 animDeltaX; + int16 animDeltaY; + int8 transp; + int16 framesCount; + AnimFramePiece frames[1]; + } GCC_PACK AnimLayer; #pragma END_PACK_STRUCTS -typedef struct Scen_Static { - int16 layersCount; - Scen_StaticLayer **layers; - Scen_PieceDesc **pieces; - int8 *piecesFromExt; - char *dataPtr; -} Scen_Static; - -struct Scen_Animation { - int16 layersCount; - Scen_AnimLayer **layers; - Scen_PieceDesc **pieces; - int8 *piecesFromExt; - char *dataPtr; + typedef struct Static { + int16 layersCount; + StaticLayer **layers; + PieceDesc **pieces; + int8 *piecesFromExt; + char *dataPtr; + Static() : layersCount(0), layers(0), pieces(0), + piecesFromExt(0), dataPtr(0) {} + } Static; + + struct Animation { + int16 layersCount; + AnimLayer **layers; + PieceDesc **pieces; + int8 *piecesFromExt; + char *dataPtr; + Animation() : layersCount(0), layers(0), pieces(0), + piecesFromExt(0), dataPtr(0) {} + }; + + // Global variables + + char spriteRefs[20]; + int16 spriteResId[20]; + + char staticPictToSprite[70]; + int16 staticPictCount[10]; + Static statics[10]; + char staticFromExt[10]; + int16 staticResId[10]; + + char animPictToSprite[70]; + int16 animPictCount[10]; + char animFromExt[10]; + Animation animations[10]; + int16 animResId[10]; + + int16 curStatic; + int16 curStaticLayer; + + int16 toRedrawLeft; + int16 toRedrawRight; + int16 toRedrawTop; + int16 toRedrawBottom; + + int16 animTop; + int16 animLeft; + + int16 *pCaptureCounter; + + // Functions + + int16 loadStatic(char search); + void freeStatic(int16 index); + void renderStatic(int16 scenery, int16 layer); + void interRenderStatic(void); + void interLoadCurLayer(void); + void updateStatic(int16 orderFrom); + int16 loadAnim(char search); + void updateAnim(int16 layer, int16 frame, int16 animation, int16 flags, + int16 drawDeltaX, int16 drawDeltaY, char doDraw); + void freeAnim(int16 animation); + void interUpdateAnim(void); + void interStoreParams(void); + + Scenery(GobEngine *vm); + +protected: + GobEngine *_vm; }; -// Global variables - -extern char scen_spriteRefs[20]; -extern int16 scen_spriteResId[20]; - -extern char scen_staticPictToSprite[70]; -extern int16 scen_staticPictCount[10]; -extern Scen_Static scen_statics[10]; -extern char scen_staticFromExt[10]; -extern int16 scen_staticResId[10]; - -extern char scen_animPictToSprite[70]; -extern int16 scen_animPictCount[10]; -extern char scen_animFromExt[10]; -extern Scen_Animation scen_animations[10]; -extern int16 scen_animResId[10]; - -extern int16 scen_curStatic; -extern int16 scen_curStaticLayer; - -extern int16 scen_toRedrawLeft; -extern int16 scen_toRedrawRight; -extern int16 scen_toRedrawTop; -extern int16 scen_toRedrawBottom; - -extern int16 scen_animTop; -extern int16 scen_animLeft; - -extern int16 *scen_pCaptureCounter; - -// Functions - -int16 scen_loadStatic(char search); -void scen_freeStatic(int16 index); -void scen_renderStatic(int16 scenery, int16 layer); -void scen_interRenderStatic(void); -void scen_interLoadCurLayer(void); -void scen_updateStatic(int16 orderFrom); -int16 scen_loadAnim(char search); -void scen_updateAnim(int16 layer, int16 frame, int16 animation, int16 flags, - int16 drawDeltaX, int16 drawDeltaY, char doDraw); -void scen_freeAnim(int16 animation); -void scen_interUpdateAnim(void); -void scen_interStoreParams(void); - } // End of namespace Gob #endif /* __SCENERY_H */ |