aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/sprite.h
diff options
context:
space:
mode:
authorMartin Kiewitz2016-01-29 13:13:40 +0100
committerMartin Kiewitz2016-01-29 13:22:22 +0100
commit8a595e7771aa89d06876e13d7ab6751e26da8982 (patch)
treedfc61e112c9f7e5b1d9e295fbb60edf4ae1b65f3 /engines/agi/sprite.h
parent1e73796bd0b17740ca4c35b9a7bd1882f9de6a37 (diff)
downloadscummvm-rg350-8a595e7771aa89d06876e13d7ab6751e26da8982.tar.gz
scummvm-rg350-8a595e7771aa89d06876e13d7ab6751e26da8982.tar.bz2
scummvm-rg350-8a595e7771aa89d06876e13d7ab6751e26da8982.zip
AGI: graphics rewrite + cleanup
- graphics code fully rewritten - Apple IIgs font support - Amiga Topaz support - Word parser rewritten - menu code rewritten - removed forced 2 second delay on all room changes replaced with heuristic to detect situations, where it's required - lots of naming cleanup - new console commands show_map, screenobj, vmvars and vmflags - all sorts of hacks/workarounds removed - added SCI wait mouse cursor - added Apple IIgs mouse cursor - added Atari ST mouse cursor - added Amiga/Apple IIgs transition - added Atari ST transition - user can select another render mode and use Apple IIgs palette + transition for PC versions - inventory screen rewritten - SetSimple command now properly implemented - PreAGI Mickey: Sierra logo now shown - saved games: now saving controller key mapping also saving automatic save data (SetSimple command) - fixed invalid memory access when saving games (31 bytes were saved using Common::String c_ptr() Special Thanks to: - fuzzie for helping out with the Apple IIgs font + valgrind - eriktorbjorn for helping out with valgrind - LordHoto for figuring out the code, that caused invalid memory access in the original code, when saving a game - sev for help out with reversing the Amiga transition currently missing: - mouse support for menu - mouse support for system dialogs - predictive dialog support
Diffstat (limited to 'engines/agi/sprite.h')
-rw-r--r--engines/agi/sprite.h91
1 files changed, 52 insertions, 39 deletions
diff --git a/engines/agi/sprite.h b/engines/agi/sprite.h
index 549eb59832..0bb0547650 100644
--- a/engines/agi/sprite.h
+++ b/engines/agi/sprite.h
@@ -25,9 +25,25 @@
namespace Agi {
+/**
+ * Sprite structure.
+ * This structure holds information on visible and priority data of
+ * a rectangular area of the AGI screen. Sprites are chained in two
+ * circular lists, one for updating and other for non-updating sprites.
+ */
+struct Sprite {
+ uint16 givenOrderNr;
+ uint16 sortOrder;
+ ScreenObjEntry *screenObjPtr; /**< pointer to view table entry */
+ int16 xPos; /**< x coordinate of the sprite */
+ int16 yPos; /**< y coordinate of the sprite */
+ int16 xSize; /**< width of the sprite */
+ int16 ySize; /**< height of the sprite */
+ byte *backgroundBuffer; /**< buffer to store background data */
+};
-struct Sprite;
-typedef Common::List<Sprite *> SpriteList;
+typedef Common::List<Sprite> SpriteList;
+typedef Common::List<Sprite *> SpritePtrList;
class AgiEngine;
class GfxMgr;
@@ -38,35 +54,42 @@ private:
GfxMgr *_gfx;
AgiEngine *_vm;
- uint8 *_spritePool;
- uint8 *_poolTop;
-
//
// Sprite management functions
//
- SpriteList _sprUpd;
- SpriteList _sprNonupd;
-
- void *poolAlloc(int size);
- void poolRelease(void *s);
- void blitPixel(uint8 *p, uint8 *end, uint8 col, int spr, int width, int *hidden);
- int blitCel(int x, int y, int spr, ViewCel *c, bool agi256_2);
- void objsSaveArea(Sprite *s);
- void objsRestoreArea(Sprite *s);
-
- int prioToY(int p);
- Sprite *newSprite(VtEntry *v);
- void sprAddlist(SpriteList &l, VtEntry *v);
- void buildList(SpriteList &l, bool (*test)(VtEntry *, AgiEngine *));
- void buildUpdBlitlist();
- void buildNonupdBlitlist();
- void freeList(SpriteList &l);
- void commitSprites(SpriteList &l, bool immediate = false);
- void eraseSprites(SpriteList &l);
- void blitSprites(SpriteList &l);
- static bool testUpdating(VtEntry *v, AgiEngine *);
- static bool testNotUpdating(VtEntry *v, AgiEngine *);
+ SpriteList _spriteRegularList;
+ SpriteList _spriteStaticList;
+
+public:
+ void buildRegularSpriteList();
+ void buildStaticSpriteList();
+ void buildAllSpriteLists();
+ void buildSpriteListAdd(uint16 givenOrderNr, ScreenObjEntry *screenObj, SpriteList &spriteList);
+ void freeList(SpriteList &spriteList);
+ void freeRegularSprites();
+ void freeStaticSprites();
+ void freeAllSprites();
+
+ void eraseSprites(SpriteList &spriteList);
+ void eraseRegularSprites();
+ void eraseStaticSprites();
+ void eraseSprites();
+
+ void drawSprites(SpriteList &spriteList);
+ void drawRegularSpriteList();
+ void drawStaticSpriteList();
+ void drawAllSpriteLists();
+
+ void drawCel(ScreenObjEntry *screenObj);
+
+ void showSprite(ScreenObjEntry *screenObj);
+ void showSprites(SpriteList &spriteList);
+ void showRegularSpriteList();
+ void showStaticSpriteList();
+ void showAllSpriteLists();
+
+ void showObject(int16 viewNr);
public:
SpritesMgr(AgiEngine *agi, GfxMgr *gfx);
@@ -74,18 +97,8 @@ public:
int initSprites();
void deinitSprites();
- void eraseUpdSprites();
- void eraseNonupdSprites();
- void eraseBoth();
- void blitUpdSprites();
- void blitNonupdSprites();
- void blitBoth();
- void commitUpdSprites();
- void commitNonupdSprites();
- void commitBoth();
- void addToPic(int, int, int, int, int, int, int);
- void showObj(int);
- void commitBlock(int x1, int y1, int x2, int y2, bool immediate = false);
+ void addToPic(int16 viewNr, int16 loopNr, int16 celNr, int16 xPos, int16 yPos, int16 priority, int16 border);
+ void addToPicDrawPriorityBox(ScreenObjEntry *screenObj, int16 border);
};
} // End of namespace Agi