-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresource.h
More file actions
169 lines (153 loc) · 4.04 KB
/
resource.h
File metadata and controls
169 lines (153 loc) · 4.04 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
168
169
/* REminiscence - Flashback interpreter
* Copyright (C) 2005-2007 Gregory Montoir
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __RESOURCE_H__
#define __RESOURCE_H__
#include "intern.h"
struct File;
struct LocaleData {
enum Id {
LI_01_CONTINUE_OR_ABORT = 0,
LI_02_TIME,
LI_03_CONTINUE,
LI_04_ABORT,
LI_05_COMPLETED,
LI_06_LEVEL,
LI_07_START,
LI_08_SKILL,
LI_09_PASSWORD,
LI_10_INFO,
LI_11_QUIT,
LI_12_SKILL_LEVEL,
LI_13_EASY,
LI_14_NORMAL,
LI_15_EXPERT,
LI_16_ENTER_PASSWORD1,
LI_17_ENTER_PASSWORD2,
LI_18_RESUME_GAME,
LI_19_ABORT_GAME,
LI_20_LOAD_GAME,
LI_21_SAVE_GAME,
LI_22_SAVE_SLOT,
LI_NUM
};
static const char *_textsTableFR[];
static const char *_textsTableEN[];
static const char *_textsTableDE[];
static const char *_textsTableSP[];
static const uint8 _stringsTableFR[];
static const uint8 _stringsTableEN[];
static const uint8 _stringsTableDE[];
static const uint8 _stringsTableSP[];
};
struct Resource {
typedef void (Resource::*LoadStub)(File *);
enum ObjectType {
OT_MBK = 0x00,
OT_PGE = 0x01,
OT_PAL = 0x02,
OT_CT = 0x03,
OT_MAP = 0x04,
OT_SGD = 0x05,
OT_SPC = 0x06,
OT_RP = 0x07,
OT_DEMO = 0x08,
OT_ANI = 0x09,
OT_OBJ = 0x0A,
OT_TBN = 0x0B,
OT_SPR = 0x0C,
OT_TAB = 0x0D,
OT_ICN = 0x0E,
OT_FNT = 0x0F,
OT_TXTBIN = 0x10,
OT_CMD = 0x11,
OT_POL = 0x12,
OT_SPRM = 0x13,
OT_OFF = 0x14,
OT_NUM = 0x15
};
static const uint16 _voicesOffsetsTable[];
const char *_dataPath;
Version _ver;
char _entryName[30];
uint8 *_fnt;
MbkEntry *_mbk;
uint8 *_mbkData;
uint8 *_icn;
uint8 *_tab;
uint8 *_spc; // BE
uint16 _numSpc;
uint8 _rp[0x4A];
uint8 *_pal; // BE
uint8 *_ani;
uint8 *_tbn;
int8 _ctData[0x1D00];
uint8 *_spr1;
uint8 *_spr_off[1287]; // 0-0x22F + 0x28E-0x2E9 ... conrad, 0x22F-0x28D : junkie
uint8 _sprm[0x8411]; // MERCENAI.SPR size
uint16 _pgeNum;
InitPGE _pgeInit[256];
uint8 *_map;
uint16 _numObjectNodes;
ObjectNode *_objectNodesMap[255];
uint8 *_memBuf;
SoundFx *_sfxList;
uint8 _numSfx;
uint8 *_cmd;
uint8 *_pol;
uint8 *_cine_off;
uint8 *_cine_txt;
uint8 *_voiceBuf;
char **_extTextsTable;
const char **_textsTable;
uint8 *_extStringsTable;
const uint8 *_stringsTable;
Resource(const char *dataPath, Version ver);
~Resource();
void clearLevelRes();
void load_FIB(const char *fileName);
void load_MAP_menu(const char *fileName, uint8 *dstPtr);
void load_PAL_menu(const char *fileName, uint8 *dstPtr);
void load_SPR_OFF(const char *fileName, uint8 *sprData);
void load_CINE();
void load_TEXT();
void free_TEXT();
void load(const char *objName, int objType);
void load_CT(File *pf);
void load_FNT(File *pf);
void load_MBK(File *pf);
void load_ICN(File *pf);
void load_SPR(File *pf);
void load_SPRM(File *pf);
void load_RP(File *pf);
void load_SPC(File *pf);
void load_PAL(File *pf);
void load_MAP(File *pf);
void load_OBJ(File *pf);
void free_OBJ();
void load_PGE(File *pf);
void load_ANI(File *pf);
void load_TBN(File *pf);
void load_CMD(File *pf);
void load_POL(File *pf);
void load_VCE(int num, int segment, uint8 **buf, uint32 *bufSize);
const uint8 *getGameString(int num) {
return _stringsTable + READ_LE_UINT16(_stringsTable + num * 2);
}
const char *getMenuString(int num) {
return (num >= 0 && num < LocaleData::LI_NUM) ? _textsTable[num] : "";
}
};
#endif // __RESOURCE_H__