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 #ifndef DRAGONS_SCENE_H
23 #define DRAGONS_SCENE_H
24 
25 #include "common/rect.h"
26 #include "common/system.h"
27 #include "dragons/screen.h"
28 
29 namespace Dragons {
30 
31 class DragonsEngine;
32 class ActorManager;
33 class Background;
34 class DragonRMS;
35 class BackgroundResourceLoader;
36 class DragonINIResource;
37 class Screen;
38 class ScriptOpcodes;
39 class ScaleLayer;
40 struct DragonINI;
41 
42 class Scene {
43 public:
44 	Common::Point _camera;
45 	int16 _mapTransitionEffectSceneID;
46 
47 private:
48 	DragonsEngine *_vm;
49 	Screen *_screen;
50 	ActorManager *_actorManager;
51 	Background *_stage;
52 	DragonRMS *_dragonRMS;
53 	DragonINIResource *_dragonINIResource;
54 	BackgroundResourceLoader *_backgroundLoader;
55 	ScriptOpcodes *_scriptOpcodes;
56 
57 	int16 _currentSceneId;
58 	int16 _data_800633ee; //TODO this isn't referenced. Is it needed?
59 
60 public:
61 	Scene(DragonsEngine *vm, Screen *screen, ScriptOpcodes *scriptOpcodes, ActorManager *actorManager, DragonRMS *_dragonRMS, DragonINIResource *_dragonINIResource, BackgroundResourceLoader *backgroundResourceLoader);
62 
63 	void loadScene(uint32 sceneId, uint32 cameraPointId);
64 	void loadSceneData(uint32 sceneId, uint32 cameraPointId);
65 	int16 getPriorityAtPosition(Common::Point pos);
66 	void draw();
67 	bool contains(DragonINI *ini);
68 	byte *getPalette();
69 	void setStagePalette(byte *newPalette);
70 	uint16 getSceneId();
71 	void setSceneId(int16 newSceneId);
72 	Common::Point getPoint(uint32 pointIndex);
73 	uint16 getStageWidth();
74 	uint16 getStageHeight();
75 	void loadImageOverlay(uint16 iptId);
76 	void removeImageOverlay(uint16 iptId);
77 
78 	void setBgLayerPriority(uint8 newPriority);
79 	void setMgLayerPriority(uint8 newPriority);
80 	void setFgLayerPriority(uint8 newPriority);
81 
82 	void setLayerOffset(uint8 layerNumber, Common::Point offset);
83 	Common::Point getLayerOffset(uint8 layerNumber);
84 	ScaleLayer *getScaleLayer();
85 	void setLayerAlphaMode(uint8 layerNumber, AlphaBlendMode mode);
86 private:
87 	void resetActorFrameFlags();
88 	void drawActorNumber(int16 x, int16 y, uint16 actorId);
89 	void drawBgLayer(uint8 layerNumber, Common::Rect rect, Graphics::Surface *surface);
90 };
91 
92 } // End of namespace Dragons
93 
94 #endif //DRAGONS_SCENE_H
95