diff options
author | Travis Howell | 2005-02-20 13:07:57 +0000 |
---|---|---|
committer | Travis Howell | 2005-02-20 13:07:57 +0000 |
commit | e4b51cbdf2c128562dcd487ef463a821442f87a7 (patch) | |
tree | f430b6df98dbae57743c0ed00c3849928cb4473b | |
parent | 6d4eec5ecdb1c4321f44714dfb01b3da05277289 (diff) | |
download | scummvm-rg350-e4b51cbdf2c128562dcd487ef463a821442f87a7.tar.gz scummvm-rg350-e4b51cbdf2c128562dcd487ef463a821442f87a7.tar.bz2 scummvm-rg350-e4b51cbdf2c128562dcd487ef463a821442f87a7.zip |
Add a few sprite functions.
svn-id: r16823
-rw-r--r-- | scumm/intern.h | 10 | ||||
-rw-r--r-- | scumm/scumm.h | 2 | ||||
-rw-r--r-- | scumm/sprite_he.cpp | 63 | ||||
-rw-r--r-- | scumm/sprite_he.h | 3 |
4 files changed, 77 insertions, 1 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 01033b76a9..b21e0f452a 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -858,6 +858,7 @@ public: virtual void scummInit(); protected: + virtual void allocateArrays(); virtual void setupOpcodes(); virtual void executeOpcode(byte i); virtual const char *getOpcodeDesc(byte i); @@ -870,6 +871,15 @@ protected: uint8 getWizPixelColor(int restype, int resnum, int state, int x, int y, int flags); int computeWizHistogram(int resnum, int state, int x, int y, int w, int h); + int spriteInfoGet_flags_1(int spriteNum); + int spriteInfoGet_flags_2(int spriteNum); + int spriteInfoGet_flags_3(int spriteNum); + int spriteInfoGet_flags_4(int spriteNum); + int spriteInfoGet_flags_5(int spriteNum); + int spriteInfoGet_flags_6(int spriteNum); + int spriteInfoGet_flags_7(int spriteNum); + int spriteInfoGet_flags_8(int spriteNum); + /* HE version 90 script opcodes */ void o90_dup(); void o90_min(); diff --git a/scumm/scumm.h b/scumm/scumm.h index 56146d41fa..856931c2f6 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -637,7 +637,7 @@ protected: const byte *_resourceLastSearchBuf; // FIXME: need to put it to savefile? uint32 _resourceLastSearchSize; // FIXME: need to put it to savefile? - void allocateArrays(); + virtual void allocateArrays(); void openRoom(int room); void closeRoom(); void deleteRoomOffsets(); diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index 30ca96beee..e23e8bec0c 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -30,4 +30,67 @@ namespace Scumm { +void ScummEngine_v90he::allocateArrays() { + _spriteGroups = (SpriteGroup *)calloc(_numSprites, sizeof(SpriteGroup)); + _spriteTable = (SpriteInfo *)calloc(_numSprites, sizeof(SpriteInfo)); + + ScummEngine::allocateArrays(); +} + +int ScummEngine_v90he::spriteInfoGet_flags_1(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "_spriteTableGet_flags_1: Invalid sprite %d"); + + int val = _spriteTable[spriteNum].flags >> 0xE; + return (val & 1); +} + +int ScummEngine_v90he::spriteInfoGet_flags_2(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "_spriteTableGet_flags_2: Invalid sprite %d"); + + int val = _spriteTable[spriteNum].flags >> 0xD; + return (val & 1); +} + +int ScummEngine_v90he::spriteInfoGet_flags_3(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "_spriteTableGet_flags_3: Invalid sprite %d"); + + int val = _spriteTable[spriteNum].flags >> 0xF; + return (val & 1); +} + +int ScummEngine_v90he::spriteInfoGet_flags_4(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "_spriteTableGet_flags_4: Invalid sprite %d"); + + int val = _spriteTable[spriteNum].flags >> 0xC; + return (val & 1); +} + +int ScummEngine_v90he::spriteInfoGet_flags_5(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "_spriteTableGet_flags_5: Invalid sprite %d"); + + int val = _spriteTable[spriteNum].flags >> 0x13; + return (val & 1); +} + +int ScummEngine_v90he::spriteInfoGet_flags_6(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "_spriteTableGet_flags_6: Invalid sprite %d"); + + int val = _spriteTable[spriteNum].flags; + return (val & 0x200000); +} + +int ScummEngine_v90he::spriteInfoGet_flags_7(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "_spriteTableGet_flags_7: Invalid sprite %d"); + + int val = _spriteTable[spriteNum].flags >> 0x16; + return (val & 1); +} + +int ScummEngine_v90he::spriteInfoGet_flags_8(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "_spriteTableGet_flags_8: Invalid sprite %d"); + + int val = _spriteTable[spriteNum].flags >> 0x1E; + return (val & 1); +} + } // End of namespace Scumm diff --git a/scumm/sprite_he.h b/scumm/sprite_he.h index 4f73540b6a..4684500ffa 100644 --- a/scumm/sprite_he.h +++ b/scumm/sprite_he.h @@ -81,6 +81,9 @@ struct SpriteGroup { int field_3C; }; + SpriteInfo *_spriteTable; + SpriteGroup *_spriteGroups; + } // End of namespace Scumm #endif |