ScummVM API documentation
sprites.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 KYRA_SPRITES_H
23 #define KYRA_SPRITES_H
24 
25 #include "kyra/engine/kyra_lok.h"
26 #include "common/random.h"
27 
28 namespace Kyra {
29 
30 #define MAX_NUM_ANIMS 11
31 
32 struct Sprite {
33  uint16 x;
34  uint16 y;
35  uint16 width;
36  uint16 height;
37 };
38 
39 struct Anim {
40  uint8 *script;
41  uint8 *curPos;
42  uint16 length;
43  int16 x;
44  int16 y;
45  bool flipX;
46  int8 sprite;
47  uint8 *loopStart;
48  uint16 loopsLeft;
49  uint32 nextRun;
50  uint32 lastRefresh;
51  bool play;
52  uint16 width;
53  uint16 height;
54  uint16 width2;
55  uint16 height2;
56  uint16 unk1;
57  uint16 drawY;
58  uint16 unk2;
59  uint8 *background;
60  bool disable;
61 };
62 
63 class KyraEngine_LoK;
64 
65 class Sprites {
66 public:
67  Sprites(KyraEngine_LoK *vm, OSystem *system);
68  ~Sprites();
69 
70  void updateSceneAnims();
71  void setupSceneAnims();
72  void loadDat(const char *filename, SceneExits &exits);
73  void loadSceneShapes();
74 
75  Anim _anims[MAX_NUM_ANIMS];
76  uint8 *_sceneShapes[50];
77 
78  void refreshSceneAnimObject(uint8 animNum, uint8 shapeNum, uint16 x, uint16 y, bool flipX, bool unkFlag);
79 
80  int getDrawLayer(int y);
81 
82  int _sceneAnimatorBeaconFlag;
83 protected:
84  void freeSceneShapes();
85 
86  KyraEngine_LoK *_vm;
87  Resource *_res;
88  OSystem *_system;
89  Screen *_screen;
90  uint8 *_dat;
92  uint8 *_spriteDefStart;
93  uint8 _drawLayerTable[8];
94 };
95 
96 } // End of namespace Kyra
97 
98 #endif
Definition: kyra_lok.h:73
Definition: resource.h:48
Definition: random.h:44
Definition: screen.h:565
Definition: sprites.h:65
Definition: sprites.h:32
Definition: kyra_lok.h:97
Definition: detection.h:27
Definition: sprites.h:39
Definition: system.h:175