ScummVM API documentation
mine.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 M4_BURGER_ROOMS_SECTION3_MINE_ROOM_H
23#define M4_BURGER_ROOMS_SECTION3_MINE_ROOM_H
24
25#include "m4/burger/rooms/section3/section3_room.h"
26
27namespace M4 {
28namespace Burger {
29namespace Rooms {
30
31enum MineDoors {
32 BACK, FRONT, LEFT, RIGHT, MAX_DOORS, NONE
33};
34
35enum MineScenes {
36 SCENE_305, // treasure
37 SCENE_310, // mine entrance
38 SCENE_311, // one door (a)
39 SCENE_312, // one door (b)
40 SCENE_313, // two doors (a)
41 SCENE_314, // two doors (b)
42 SCENE_315, // three doors (a)
43 SCENE_316, // three doors (b)
44 SCENE_317, // four doors (a)
45 SCENE_318, // four doors (b)
46 SCENE_319, // one door (c)
47 MAX_SCENE_TYPES,
48 TREASURE_SCENE = SCENE_310,
49 ENTRANCE_SCENE = SCENE_305,
50 NO_SCENE = MAX_SCENE_TYPES
51};
52
53
54struct MineRoom {
55 int16 roomNumber; // The mine room number
56 int16 scene_id; // The scene id (indexes for mine_scene_numbers)
57 int16 link[4]; // Links to other mine rooms
58 int16 door[4]; // Specify doors to use
59 int16 correctLink; // The correct link to take to get to the treasure
60 int16 check; // Used to check the maze sanity
61
62 void clear();
63};
64
66 int16 offscreen_x;
67 int16 offscreen_y;
68 int16 enter_facing;
69 int16 home_x;
70 int16 home_y;
71 int16 home_facing;
72};
73
74struct Rectangle {
75 int16 x1;
76 int16 y1;
77 int16 x2;
78 int16 y2;
79};
80
81class Mine : public Section3Room {
82private:
83 static const char *SAID[][4];
84 static const int16 MINE_SCENE_NUMBERS[];
85 static const MineRoom MINE_INFO[];
86
90 static const Rectangle FADE_DOWN_INFO[MAX_SCENE_TYPES][4];
91
95 static const EntranceInfo ENTRANCE_INFO[MAX_SCENE_TYPES][4];
96
97 int _mineCtr = 0;
98 int16 _presentSceneID = 0;
99 static int16 _entranceDoor; // Shared between cellar and mine room classes
100 MineRoom _mineRoomInfo;
101 bool _fade_down_rect_active = false; // True if a fade down should occur when walker in the fade_down_rect
102 Rectangle _fade_down_rect = {0, 0, 0, 0}; // If the walker is in his rectum and its active, turn off the lights
103 int _volume = 0;
104 int _random1 = 0;
105 int _random2 = 0;
106 int _treasureDistance = 0;
107 int _previousDistance = 0;
108
109 int getTreasureDistance() const;
110
111protected:
112 const char *getDigi() override {
113 return "300_004";
114 }
115
116 void mine_travel_link(int16 takeLink);
117 void set_fade_down_rect(MineDoors exit_door);
118
119public:
120 Mine();
121 virtual ~Mine() {}
122
123 void preload() override;
124 void init() override;
125 void daemon() override;
126 void pre_parser() override;
127 void parser() override;
128};
129
130} // namespace Rooms
131} // namespace Burger
132} // namespace M4
133
134#endif
Definition: mine.h:81
Definition: section3_room.h:31
Definition: database.h:28
Definition: mine.h:65
Definition: mine.h:54
Definition: mine.h:74