22 #ifndef NEVERHOOD_SCENE_H 23 #define NEVERHOOD_SCENE_H 25 #include "common/array.h" 26 #include "neverhood/neverhood.h" 27 #include "neverhood/background.h" 28 #include "neverhood/entity.h" 29 #include "neverhood/graphics.h" 30 #include "neverhood/klaymen.h" 31 #include "neverhood/module.h" 32 #include "neverhood/palette.h" 33 #include "neverhood/sprite.h" 34 #include "neverhood/staticdata.h" 46 void addEntity(
Entity *entity);
47 bool removeEntity(
Entity *entity);
50 void printSurfaces(
Console *con);
52 void removeSprite(
Sprite *sprite);
54 void setSpriteSurfacePriority(
Sprite *sprite,
int priority);
55 void deleteSprite(
Sprite **sprite);
57 void setBackground(uint32 fileHash);
58 void changeBackground(uint32 fileHash);
59 void setBackgroundY(int16 y) { _background->getSurface()->getDrawRect().y = y; }
60 int16 getBackgroundY() {
return _background->getSurface()->getDrawRect().y; }
61 void setPalette(uint32 fileHash = 0);
62 void setHitRects(uint32
id);
63 Sprite *insertStaticSprite(uint32 fileHash,
int surfacePriority);
64 void insertScreenMouse(uint32 fileHash,
const NRect *mouseRect = NULL);
65 void insertPuzzleMouse(uint32 fileHash, int16 x1, int16 x2);
66 void insertNavigationMouse(uint32 fileHash,
int type);
67 void showMouse(
bool visible);
68 void changeMouseCursor(uint32 fileHash);
71 void leaveScene(uint32 result);
72 HitRect *findHitRectAtPos(int16 x, int16 y);
73 void addCollisionSprite(
Sprite *sprite);
74 void removeCollisionSprite(
Sprite *sprite);
75 void checkCollision(
Sprite *sprite, uint16 flags,
int messageNum, uint32 messageParam);
79 void insertKlaymen() {
80 _klaymen = (T*)addSprite(
new T(_vm,
this));
82 template<
class T,
class Arg1>
83 void insertKlaymen(Arg1 arg1) {
84 _klaymen = (T*)addSprite(
new T(_vm,
this, arg1));
86 template<
class T,
class Arg1,
class Arg2>
87 void insertKlaymen(Arg1 arg1, Arg2 arg2) {
88 _klaymen = (T*)addSprite(
new T(_vm,
this, arg1, arg2));
90 template<
class T,
class Arg1,
class Arg2,
class Arg3>
91 void insertKlaymen(Arg1 arg1, Arg2 arg2, Arg3 arg3) {
92 _klaymen = (T*)addSprite(
new T(_vm,
this, arg1, arg2, arg3));
94 template<
class T,
class Arg1,
class Arg2,
class Arg3,
class Arg4>
95 void insertKlaymen(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) {
96 _klaymen = (T*)addSprite(
new T(_vm,
this, arg1, arg2, arg3, arg4));
98 template<
class T,
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5>
99 void insertKlaymen(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) {
100 _klaymen = (T*)addSprite(
new T(_vm,
this, arg1, arg2, arg3, arg4, arg5));
102 template<
class T,
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class Arg6>
103 void insertKlaymen(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6) {
104 _klaymen = (T*)addSprite(
new T(_vm,
this, arg1, arg2, arg3, arg4, arg5, arg6));
109 return (T*)addSprite(
new T(_vm));
111 template<
class T,
class Arg1>
112 T* insertSprite(Arg1 arg1) {
113 return (T*)addSprite(
new T(_vm, arg1));
115 template<
class T,
class Arg1,
class Arg2>
116 T* insertSprite(Arg1 arg1, Arg2 arg2) {
117 return (T*)addSprite(
new T(_vm, arg1, arg2));
119 template<
class T,
class Arg1,
class Arg2,
class Arg3>
120 T* insertSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3) {
121 return (T*)addSprite(
new T(_vm, arg1, arg2, arg3));
123 template<
class T,
class Arg1,
class Arg2,
class Arg3,
class Arg4>
124 T* insertSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) {
125 return (T*)addSprite(
new T(_vm, arg1, arg2, arg3, arg4));
127 template<
class T,
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5>
128 T* insertSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) {
129 return (T*)addSprite(
new T(_vm, arg1, arg2, arg3, arg4, arg5));
131 template<
class T,
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class Arg6>
132 T* insertSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6) {
133 return (T*)addSprite(
new T(_vm, arg1, arg2, arg3, arg4, arg5, arg6));
140 template<
class T,
class Arg1>
141 T* createSprite(Arg1 arg1) {
142 return new T(_vm, arg1);
144 template<
class T,
class Arg1,
class Arg2>
145 T* createSprite(Arg1 arg1, Arg2 arg2) {
146 return new T(_vm, arg1, arg2);
148 template<
class T,
class Arg1,
class Arg2,
class Arg3>
149 T* createSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3) {
150 return new T(_vm, arg1, arg2, arg3);
152 template<
class T,
class Arg1,
class Arg2,
class Arg3,
class Arg4>
153 T* createSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) {
154 return new T(_vm, arg1, arg2, arg3, arg4);
156 template<
class T,
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5>
157 T* createSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) {
158 return new T(_vm, arg1, arg2, arg3, arg4, arg5);
160 template<
class T,
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class Arg6>
161 T* createSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6) {
162 return new T(_vm, arg1, arg2, arg3, arg4, arg5, arg6);
165 uint32 getBackgroundFileHash()
const {
return _backgroundFileHash; }
166 uint32 getCursorFileHash()
const {
return _cursorFileHash; }
180 int _messageListStatus;
181 uint _messageListCount;
182 uint _messageListIndex;
183 bool _doConvertMessages;
185 bool _canAcceptInput;
187 bool _isMessageListBusy;
192 bool _mouseCursorWasVisible;
204 uint32 _backgroundFileHash, _cursorFileHash;
208 bool queryPositionSprite(int16 mouseX, int16 mouseY);
209 bool queryPositionRectList(int16 mouseX, int16 mouseY);
210 void setMessageList(uint32
id,
bool canAcceptInput =
true,
bool doConvertMessages =
false);
211 void setMessageList(
MessageList *messageList,
bool canAcceptInput =
true,
bool doConvertMessages =
false);
212 bool setMessageList2(uint32
id,
bool canAcceptInput =
true,
bool doConvertMessages =
false);
213 bool setMessageList2(
MessageList *messageList,
bool canAcceptInput =
true,
bool doConvertMessages =
false);
214 bool isMessageList2(uint32
id);
215 void processMessageList();
216 void setRectList(uint32
id);
217 void setRectList(
RectList *rectList);
218 void clearRectList();
219 void loadHitRectList();
220 void cancelMessageList();
221 void loadDataResource(uint32 fileHash);
222 uint16 convertMessageNum(uint32 messageNum);
225 void clearHitRects();
226 void clearCollisionSprites();
228 void insertMouse(
Mouse *mouseCursor);
Definition: background.h:30
Definition: neverhood.h:60
Definition: graphics.h:42
Definition: background.h:32
Definition: smackerplayer.h:61
Definition: resource.h:162
Definition: staticdata.h:32
Definition: graphics.h:32