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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 // TODO: I couldn't come up with a better name than 'Module' so far
24 
25 #ifndef NEVERHOOD_MODULE_H
26 #define NEVERHOOD_MODULE_H
27 
28 #include "neverhood/neverhood.h"
29 #include "neverhood/background.h"
30 #include "neverhood/entity.h"
31 #include "neverhood/graphics.h"
32 #include "neverhood/mouse.h"
33 #include "neverhood/palette.h"
34 #include "neverhood/screen.h"
35 
36 namespace Neverhood {
37 
38 class NavigationScene;
39 
40 enum SceneType {
41 	kSceneTypeNormal,
42 	kSceneTypeSmacker,
43 	kSceneTypeNavigation
44 };
45 
46 class Module : public Entity {
47 public:
48 	Module(NeverhoodEngine *vm, Module *parentModule);
49 	~Module() override;
50 	void draw() override;
getSceneType()51 	SceneType getSceneType() { return _sceneType; }
52 
53 	Entity *_childObject;
54 protected:
55 	Module *_parentModule;
56 	bool _done;
57 	uint32 _moduleResult;
58 	SceneType _sceneType;
59 	int _navigationAreaType;
60 	uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
61 	NavigationScene *navigationScene();
62 	void createNavigationScene(uint32 navigationListId, int navigationIndex, const byte *itemsTypes = NULL);
63 	void createSmackerScene(uint32 fileHash, bool doubleSurface, bool canSkip, bool canAbort);
64 	void createSmackerScene(const uint32 *fileHashList, bool doubleSurface, bool canSkip, bool canAbort);
65 	void createStaticScene(uint32 backgroundFileHash, uint32 cursorFileHash);
66 	void createDemoScene();
67 	bool updateChild();
68 	void leaveModule(uint32 result);
69 };
70 
71 } // End of namespace Neverhood
72 
73 #endif /* NEVERHOOD_MODULE_H */
74