ScummVM API documentation
backgroundbook.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 PELROCK_BACKGROUNDBOOK_H
23#define PELROCK_BACKGROUNDBOOK_H
24
25namespace Pelrock {
26class PelrockEventManager;
27class ResourceManager;
28class RoomManager;
29
31
32 enum Buttons {
33 PREVIOUS_BUTTON,
34 NEXT_BUTTON,
35 NO_BG_BUTTON
36 };
37
38 int kItemsPerPage = 22;
39
40public:
43
44 void run();
45
46private:
47 void init();
48 void loadRoomNames();
49 void drawScreen();
50 void drawButtons();
51 void loadButtons();
52 void loadBackground();
53 void checkMouse(int x, int y);
54 Buttons isButtonClicked(int x, int y);
55 void showRoom(int roomIndex);
56 void cleanup();
57
58 PelrockEventManager *_events;
59 ResourceManager *_res;
60 RoomManager *_room;
61 Graphics::ManagedSurface _backgroundScreen;
62 Graphics::ManagedSurface _compositeScreen;
63 Graphics::ManagedSurface *thumbSurface = nullptr;
64 byte *_palette;
65 byte *_buttons[2][2];
66 Buttons _selectedButton = NO_BG_BUTTON;
67 int _selectedPage = 0;
68
69 Common::Rect _buttonRects[2] = {
70 Common::Rect(Common::Point(238, 104), 28, 44), // Previous
71 Common::Rect(Common::Point(238, 178), 28, 44), // Next
72 };
73 Common::StringArray _roomNames;
74};
75
76} // End of namespace Pelrock
77
78#endif
Definition: managed_surface.h:51
Definition: backgroundbook.h:30
Definition: events.h:28
Definition: resources.h:30
Definition: room.h:36
Definition: rect.h:144
Definition: rect.h:536