ScummVM API documentation
scene.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 NGI_SCENE_H
23 #define NGI_SCENE_H
24 
25 #include "common/ptr.h"
26 #include "ngi/gfx.h"
27 
28 namespace NGI {
29 
30 class MessageQueue;
31 
32 class Scene : public Background {
33  public:
36 
37  Common::Array<StaticANIObject *> _staticANIObjectList2;
38  Common::Array<MessageQueue *> _messageQueueList;
39  // PtrList _faObjectList; // not used
42  int16 _sceneId;
43  Common::String _sceneName;
44  int _field_BC;
46 
47  public:
48  Scene();
49  ~Scene() override;
50 
51  bool load(MfcArchive &file) override;
52 
53  void initStaticANIObjects();
54  void init();
55  void draw();
56  void drawContent(int minPri, int maxPri, bool drawBG);
57  void updateScrolling();
58  void updateScrolling2();
59 
60  void update(int counterdiff);
61 
62  StaticANIObject *getAniMan();
63  StaticANIObject *getStaticANIObject1ById(int obj, int a3);
64  StaticANIObject *getStaticANIObject1ByName(const Common::String &name, int a3);
65  MessageQueue *getMessageQueueById(int messageId);
66  MessageQueue *getMessageQueueByName(const Common::String &name);
67 
68  void deleteStaticANIObject(StaticANIObject *obj);
70  void addStaticANIObject(StaticANIObject *obj, bool addList2);
71 
72  void setPictureObjectsFlag4();
73  PictureObject *getPictureObjectById(int objId, int flags);
74  PictureObject *getPictureObjectByName(const Common::String &name, int keyCode);
75  void deletePictureObject(PictureObject *obj);
76  void preloadMovements(GameVar *var);
77 
78  StaticANIObject *getStaticANIObjectAtPos(int x, int y);
79  PictureObject *getPictureObjectAtPos(int x, int y);
80  int getPictureObjectIdAtPos(int x, int y);
81 
82  void initObjectCursors(const char *name);
83 
84  void stopAllSounds();
85 
86  private:
87 #if 0
88  static bool compareObjPriority(const void *p1, const void *p2);
89  void objectList_sortByPriority(Common::Array<StaticANIObject *> &list, bool skipFirst = false);
90  void objectList_sortByPriority(Common::Array<PictureObject *> &list, bool skipFirst = false);
91 #else
92  template<typename T>
93  void objectList_sortByPriority(Common::Array<T*> &list, uint startIndex = 0);
94 #endif
95 };
96 
97 class SceneTag : public CObject {
98  public:
99  Common::String _tag;
102  int16 _sceneId;
103 
104  public:
105  SceneTag();
106  ~SceneTag() override;
107 
108  bool load(MfcArchive &file) override;
109  void loadScene();
110 };
111 
112 class SceneTagList : public Common::List<SceneTag>, public CObject {
113  public:
114  bool load(MfcArchive &file) override;
115 };
116 
117 } // End of namespace NGI
118 
119 #endif /* NGI_SCENE_H */
Definition: gfx.h:193
Definition: str.h:59
Definition: utils.h:39
Definition: scene.h:97
Definition: array.h:52
Scene * _scene
Definition: scene.h:101
Definition: list.h:44
Definition: scene.h:112
Definition: gfx.h:166
Definition: ptr.h:572
Definition: messages.h:108
Common::Array< StaticANIObject * > _staticANIObjectList1
Definition: scene.h:35
Definition: objects.h:76
Definition: statics.h:172
Definition: scene.h:32
Definition: anihandler.h:25
void addStaticANIObject(StaticANIObject *obj, bool addList2)
Definition: utils.h:106