ScummVM API documentation
spellbook.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_SPELLBOOK_H
23 #define PELROCK_SPELLBOOK_H
24 
25 namespace Pelrock {
26 
27 struct Spell {
29  int page;
30  byte *image;
31 };
32 
33 struct Bookmark {
34  int16 x;
35  int16 y;
36  byte w;
37  byte h;
38  int page;
39 };
40 
41 static const Bookmark _bookmarks[13] = {
42  {244, 8, 23, 40, 0},
43  {396, 17, 44, 20, 1},
44  {480, 68, 40, 42, 4},
45  {480, 129, 30, 25, 5},
46  {480, 224, 28, 32, 8},
47  {416, 344, 23, 17, 12},
48  {368, 346, 28, 34, 11},
49  {198, 340, 26, 28, 10},
50  {164, 336, 33, 17, 9},
51  {95, 277, 33, 24, 7},
52  {105, 227, 27, 33, 6},
53  {103, 118, 30, 26, 3},
54  {101, 78, 36, 33, 2}};
55 
56 class SpellBook {
57 
58 public:
60  ~SpellBook();
61 
65  Spell *run();
66 
67 private:
68  PelrockEventManager *_events;
69  ResourceManager *_res;
70  Graphics::ManagedSurface _backgroundScreen;
71  Graphics::ManagedSurface _compositeScreen;
72  byte *_palette;
73 
74  Spell *_spell = nullptr;
75  Spell *_selectedSpell = nullptr;
76 
77  void init();
78  void selectPage(int page);
79  void drawScreen();
80  void loadBackground();
81  void cleanup();
82  bool checkMouse(int x, int y);
83 };
84 
85 } // End of namespace Pelrock
86 
87 #endif
Definition: managed_surface.h:51
Definition: spellbook.h:27
Definition: spellbook.h:56
Definition: events.h:28
Definition: actions.h:26
Definition: spellbook.h:33
Definition: resources.h:30