ScummVM API documentation
sprite.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef AGI_SPRITE_H
23 #define AGI_SPRITE_H
24 
25 namespace Agi {
26 
33 struct Sprite {
34  uint16 givenOrderNr;
35  uint16 sortOrder;
37  int16 xPos;
38  int16 yPos;
39  int16 xSize;
40  int16 ySize;
42 };
43 
46 
47 class AgiEngine;
48 class GfxMgr;
49 class Obejcts;
50 
51 class SpritesMgr {
52 private:
53  GfxMgr *_gfx;
54  AgiEngine *_vm;
55 
56  //
57  // Sprite management functions
58  //
59 
60  SpriteList _spriteRegularList;
61  SpriteList _spriteStaticList;
62 
63 public:
64  void buildRegularSpriteList();
65  void buildStaticSpriteList();
66  void buildAllSpriteLists();
67  void buildSpriteListAdd(uint16 givenOrderNr, ScreenObjEntry *screenObj, SpriteList &spriteList);
68  void freeList(SpriteList &spriteList);
69  void freeRegularSprites();
70  void freeStaticSprites();
71  void freeAllSprites();
72 
73  void eraseSprites(SpriteList &spriteList);
74  void eraseRegularSprites();
75  void eraseStaticSprites();
76  void eraseSprites();
77 
78  void drawSprites(SpriteList &spriteList);
79  void drawRegularSpriteList();
80  void drawStaticSpriteList();
81  void drawAllSpriteLists();
82 
83  void drawCel(ScreenObjEntry *screenObj);
84 
85  void showSprite(ScreenObjEntry *screenObj);
86  void showSprites(SpriteList &spriteList);
87  void showRegularSpriteList();
88  void showStaticSpriteList();
89  void showAllSpriteLists();
90 
91  void showObject(int16 viewNr);
92 
93 public:
94  SpritesMgr(AgiEngine *agi, GfxMgr *gfx);
95  ~SpritesMgr();
96 
97  void addToPic(int16 viewNr, int16 loopNr, int16 celNr, int16 xPos, int16 yPos, int16 priority, int16 border);
98  void addToPicDrawPriorityBox(ScreenObjEntry *screenObj, int16 border);
99 };
100 
101 } // End of namespace Agi
102 
103 #endif /* AGI_SPRITE_H */
ScreenObjEntry * screenObjPtr
Definition: sprite.h:36
Definition: view.h:98
Definition: graphics.h:58
Definition: agi.h:839
int16 ySize
Definition: sprite.h:40
byte * backgroundBuffer
Definition: sprite.h:41
int16 xPos
Definition: sprite.h:37
int16 yPos
Definition: sprite.h:38
Definition: sprite.h:51
Definition: sprite.h:33
int16 xSize
Definition: sprite.h:39
Definition: agi.h:63