-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathack.h
More file actions
167 lines (146 loc) · 4.06 KB
/
ack.h
File metadata and controls
167 lines (146 loc) · 4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/* ScummVM - ACK Graphic Adventure Engine Header
*
* This file defines the necessary structures, constants, and the main engine class
* for the ACK engine. It has been adapted from the original Free Pascal source of ackfree.
*
* Distributed under the terms of the GNU General Public License.
*/
#ifndef ACK_H
#define ACK_H
#include "common/scummsys.h"
#include "common/system.h"
#include "common/error.h"
#include "common/fs.h"
#include "common/events.h"
#include "common/file.h"
#include "common/savefile.h"
#include "common/str.h"
#include "common/array.h"
#include "common/memstream.h"
#include "common/rect.h"
#include "common/textconsole.h"
#include "engines/util.h"
#include "engines/engine.h"
#include "graphics/surface.h"
#include "graphics/palette.h"
namespace Ack {
// Type alias for strings.
typedef Common::String IttyString;
// Structure for swapping information used originally.
struct SwapInfoRec {
Common::String execFile;
Common::String execParam;
byte data[11];
};
// 16x16 graphic tile structure (converted from Pascal type).
struct Grap256Unit {
byte data[17][17];
};
typedef Grap256Unit GrapArray256;
// Palette record.
struct PaletteRec {
byte r, g, b;
};
// Master record for game configuration data.
struct MasterRec {
byte textColors[10];
int ackVersion;
byte phaseColors[3][5][4];
};
// Forward declaration for game description structure.
struct AckGameDescription;
// Main ACK engine class.
class AckEngine : public Engine {
public:
AckEngine(OSystem *syst, const AckGameDescription *gd);
~AckEngine() override;
Common::Error run() override;
private:
// Private member variables.
bool _quitTime;
SwapInfoRec *_swapInfo;
char _menuCmd;
Common::String _daughter;
Common::String _ds, _dc, _hres;
GrapArray256 *_icons;
int16 _whatOpt;
int16 _oldWhatOpt;
int _i, _i1, _i2;
Common::String _systemDir;
bool _passwordOk;
Common::String _registration;
Common::String _regno;
MasterRec _ack;
SwapInfoRec *_p4ts;
bool _checking;
byte *_block;
Common::String _bgiDir;
bool _disableMouse;
Grap256Unit *_graphic;
Common::String _advName;
Common::String _lastCfgLoad;
int _doserror;
int _dosexitcode;
// Mouse state.
bool _mouseOn;
bool _mouseActive;
int _mouseX, _mouseY;
bool _mouseClicked;
// Screen memory.
Graphics::Surface *_surface;
byte *_screenBuffer;
int _scrnl;
int _scrnh[40];
bool _spaceMono;
// Constants.
static const int kBlockSize = 10;
static const int kGrapsSize = 10;
static const int kPalette = 0;
static const int kAckVersion = 20;
static const int kScreenWidth = 320;
static const int kScreenHeight = 200;
static const int kMaxIcons = 100;
// Method declarations.
void initVars();
void freeResources();
Common::Error allocateResources();
void initGameState();
void processParameters();
void loadBmpPalette(int version, const Common::String &name, const Common::String &sysdir);
void menuSkinBmp();
void updateScreen();
Common::String version(byte v);
void loadConfig();
void loadIcons(const Common::String &fn);
void saveIcons(const Common::String &fn);
void putIcon(int xb, int yy, int bb);
void showOption(byte x, byte n, int16 mo);
void redisplay();
void checkRegistration();
void displayText(int x, int y, int color, const Common::String &text);
void clearScreen();
void mainMenuLoop();
bool handleEvents();
void checkMouseClick();
void checkMouseMenuRegions();
bool mouseIn(int x1, int y1, int x2, int y2);
void processMenuCommand();
void handleAdventureSelection();
void handleAdventurePlay();
bool loadAdventure(const Common::String &name);
char convertKeyCode(Common::KeyCode keycode);
void initMouse();
void showMouse();
void hideMouse();
void trackMouse();
void closeMouse();
void loadFont();
void loadGraps();
Common::String getParameter(int idx);
// Manager object references.
GraphicsManager *_graphicsManager;
SoundManager *_soundManager;
ScriptManager *_scriptManager;
};
} // End of namespace Ack
#endif // ACK_H