22 #ifndef XEEN_RESOURCES_H 23 #define XEEN_RESOURCES_H 25 #include "common/scummsys.h" 26 #include "common/str-array.h" 27 #include "gui/debugger.h" 28 #include "mm/xeen/files.h" 29 #include "mm/xeen/party.h" 30 #include "mm/xeen/spells.h" 35 #define Res (*g_resources) 36 #define STRING_BUFFER_SIZE 32768 46 class ResFile :
public File {
51 ResFile(
const char *type,
char *buffer,
int num) :
53 _buffer(buffer), _buffStart(buffer) {
56 void syncString(
const char *&str) {
58 size_t available = STRING_BUFFER_SIZE - (_buffer - _buffStart);
60 assert(available > ln);
63 void syncStrings(
const char **str,
int count) {
64 uint tag = readUint32LE();
65 assert(tag ==
MKTAG(count, 0, 0, 0));
66 for (
int idx = 0; idx < count; ++idx)
69 void syncStrings2D(
const char **str,
int count1,
int count2) {
70 uint tag = readUint32LE();
71 assert(tag ==
MKTAG(count1, count2, 0, 0));
72 for (
int idx = 0; idx < count1 * count2; ++idx)
75 void syncNumber(
int &val) {
78 void syncNumbers(
int *vals,
int count) {
79 uint tag = readUint32LE();
80 assert(tag ==
MKTAG(count, 0, 0, 0));
81 for (
int idx = 0; idx < count; ++idx)
82 vals[idx] = readSint32LE();
84 void syncNumbers2D(
int *vals,
int count1,
int count2) {
85 uint tag = readUint32LE();
86 assert(tag ==
MKTAG(count1, count2, 0, 0));
87 for (
int idx = 0; idx < count1 * count2; ++idx)
88 vals[idx] = readSint32LE();
90 void syncNumbers3D(
int *vals,
int count1,
int count2,
int count3) {
91 uint tag = readUint32LE();
92 assert(tag ==
MKTAG(count1, count2, count3, 0));
93 for (
int idx = 0; idx < count1 * count2 * count3; ++idx)
94 vals[idx] = readSint32LE();
96 void syncNumbers4D(
int *vals,
int count1,
int count2,
int count3,
int count4) {
97 uint tag = readUint32LE();
98 assert(tag ==
MKTAG(count1, count2, count3, count4));
99 for (
int idx = 0; idx < count1 * count2 * count3 * count4; ++idx)
100 vals[idx] = readSint32LE();
102 void syncBytes2D(byte *vals,
int count1,
int count2) {
103 uint tag = readUint32LE();
104 assert(tag ==
MKTAG(count1, count2, 0, 0));
105 read(vals, count1 * count2);
109 char _buffer[STRING_BUFFER_SIZE];
121 const char **ITEM_NAMES[4];
124 const char *CLOUDS_CREDITS;
125 const char *DARK_SIDE_CREDITS;
126 const char *SWORDS_CREDITS1;
127 const char *SWORDS_CREDITS2;
128 const char *OPTIONS_MENU;
129 const char *GAME_NAMES[3];
130 const char *THE_PARTY_NEEDS_REST;
131 const char *WHO_WILL;
132 const char *HOW_MUCH;
133 const char *WHATS_THE_PASSWORD;
134 const char *PASSWORD_INCORRECT;
135 const char *IN_NO_CONDITION;
136 const char *NOTHING_HERE;
137 const char *TERRAIN_TYPES[6];
138 const char *OUTDOORS_WALL_TYPES[16];
139 const char *SURFACE_NAMES[16];
140 const char *WHO_ACTIONS[32];
141 const char *WHO_WILL_ACTIONS[4];
142 byte SYMBOLS[20][64];
143 byte TEXT_COLORS[40][4];
144 byte TEXT_COLORS_STARTUP[40][4];
145 const char *DIRECTION_TEXT_UPPER[4];
146 const char *DIRECTION_TEXT[4];
147 const char *RACE_NAMES[5];
148 int RACE_HP_BONUSES[5];
149 int RACE_SP_BONUSES[5][2];
150 const char *CLASS_NAMES[11];
151 int CLASS_EXP_LEVELS[10];
152 const char *ALIGNMENT_NAMES[3];
153 const char *SEX_NAMES[2];
154 const char *SKILL_NAMES[18];
155 const char *CONDITION_NAMES_M[17];
156 const char *CONDITION_NAMES_F[17];
157 int CONDITION_COLORS[17];
160 const char *POWER_SHIELD;
161 const char *HOLY_BONUS;
163 const char *IN_PARTY;
164 const char *PARTY_DETAILS;
165 const char *PARTY_DIALOG_TEXT;
166 int FACE_CONDITION_FRAMES[17];
169 const char *NO_ONE_TO_ADVENTURE_WITH;
170 byte DARKNESS_XLAT[3][256];
171 const char *YOUR_ROSTER_IS_FULL;
172 const char *PLEASE_WAIT;
174 int SCREEN_POSITIONING_X[4][48];
175 int SCREEN_POSITIONING_Y[4][48];
176 int MONSTER_GRID_BITMASK[12];
177 int INDOOR_OBJECT_X[2][12];
178 int MAP_OBJECT_Y[2][12];
179 int INDOOR_MONSTERS_Y[4];
180 int OUTDOOR_OBJECT_X[2][12];
181 int OUTDOOR_MONSTER_INDEXES[26];
182 int OUTDOOR_MONSTERS_Y[26];
183 int DIRECTION_ANIM_POSITIONS[4][4];
184 byte WALL_SHIFTS[4][48];
185 int DRAW_NUMBERS[25];
186 int DRAW_FRAMES[25][2];
187 int COMBAT_FLOAT_X[8];
188 int COMBAT_FLOAT_Y[8];
189 int MONSTER_EFFECT_FLAGS[15][8];
190 int SPELLS_ALLOWED[3][40];
191 int BASE_HP_BY_CLASS[10];
193 int AGE_RANGES_ADJUST[2][10];
195 int STAT_BONUSES[24];
196 int ELEMENTAL_CATEGORIES[6];
197 int ATTRIBUTE_CATEGORIES[10];
198 int ATTRIBUTE_BONUSES[72];
199 int ELEMENTAL_RESISTANCES[37];
200 int ELEMENTAL_DAMAGE[37];
201 int WEAPON_DAMAGE_BASE[35];
202 int WEAPON_DAMAGE_MULTIPLIER[35];
203 int METAL_DAMAGE[22];
204 int METAL_DAMAGE_PERCENT[22];
206 int ARMOR_STRENGTHS[14];
207 int MAKE_ITEM_ARR1[6];
208 int MAKE_ITEM_ARR2[6][7][2];
209 int MAKE_ITEM_ARR3[10][7][2];
210 int MAKE_ITEM_ARR4[2][7][2];
211 int MAKE_ITEM_ARR5[8][2];
212 int OUTDOOR_DRAWSTRUCT_INDEXES[44];
213 int TOWN_MAXES[2][11];
214 const char *TOWN_ACTION_MUSIC[2][7];
215 const char *TOWN_ACTION_SHAPES[7];
216 int TOWN_ACTION_FILES[2][7];
217 const char *BANK_TEXT;
218 const char *BLACKSMITH_TEXT;
219 const char *GUILD_NOT_MEMBER_TEXT;
220 const char *GUILD_TEXT;
221 const char *TAVERN_TEXT;
222 const char *GOOD_STUFF;
223 const char *HAVE_A_DRINK;
224 const char *YOURE_DRUNK;
225 int TAVERN_EXIT_LIST[2][6][5][2];
226 const char *FOOD_AND_DRINK;
227 const char *TEMPLE_TEXT;
228 const char *EXPERIENCE_FOR_LEVEL;
229 const char *TRAINING_LEARNED_ALL;
230 const char *ELIGIBLE_FOR_LEVEL;
231 const char *TRAINING_TEXT;
232 const char *GOLD_GEMS;
233 const char *GOLD_GEMS_2;
234 const char *DEPOSIT_WITHDRAWL[2];
235 const char *NOT_ENOUGH_X_IN_THE_Y;
236 const char *NO_X_IN_THE_Y;
237 const char *STAT_NAMES[16];
238 const char *CONSUMABLE_NAMES[4];
239 const char *CONSUMABLE_GOLD_FORMS[1];
240 const char *CONSUMABLE_GEM_FORMS[1];
241 const char *WHERE_NAMES[2];
243 const char *FOOD_PACKS_FULL;
244 const char *BUY_SPELLS;
245 const char *GUILD_OPTIONS;
246 int MISC_SPELL_INDEX[74];
248 int CLOUDS_GUILD_SPELLS[5][20];
249 int DARK_SPELL_OFFSETS[3][39];
250 int DARK_SPELL_RANGES[12][2];
251 int SWORDS_SPELL_RANGES[12][2];
252 int SPELL_GEM_COST[77];
253 const char *NOT_A_SPELL_CASTER;
254 const char *SPELLS_LEARNED_ALL;
255 const char *SPELLS_FOR;
256 const char *SPELL_LINES_0_TO_9;
257 const char *SPELLS_DIALOG_SPELLS;
258 const char *SPELL_PTS;
260 const char *SPELL_INFO;
261 const char *SPELL_PURCHASE;
262 const char *MAP_TEXT;
263 const char *LIGHT_COUNT_TEXT;
264 const char *FIRE_RESISTANCE_TEXT;
265 const char *ELECRICITY_RESISTANCE_TEXT;
266 const char *COLD_RESISTANCE_TEXT;
267 const char *POISON_RESISTANCE_TEXT;
268 const char *CLAIRVOYANCE_TEXT;
269 const char *LEVITATE_TEXT;
270 const char *WALK_ON_WATER_TEXT;
271 const char *GAME_INFORMATION;
272 const char *WORLD_GAME_TEXT;
273 const char *DARKSIDE_GAME_TEXT;
274 const char *CLOUDS_GAME_TEXT;
275 const char *SWORDS_GAME_TEXT;
276 const char *WEEK_DAY_STRINGS[10];
277 const char *CHARACTER_DETAILS;
279 const char *PARTY_GOLD;
281 const char *CHARACTER_TEMPLATE;
282 const char *EXCHANGING_IN_COMBAT;
283 const char *CURRENT_MAXIMUM_RATING_TEXT;
284 const char *CURRENT_MAXIMUM_TEXT;
285 const char *RATING_TEXT[24];
287 const char *AGE_TEXT;
288 const char *LEVEL_TEXT;
289 const char *RESISTANCES_TEXT;
291 const char *EXPERIENCE_TEXT;
292 const char *ELIGIBLE;
293 const char *IN_PARTY_IN_BANK;
294 const char *FOOD_ON_HAND[3];
295 const char *FOOD_TEXT;
296 const char *EXCHANGE_WITH_WHOM;
297 const char *QUICK_REF_LINE;
298 const char *QUICK_REFERENCE;
299 int BLACKSMITH_MAP_IDS[2][4];
300 const char *ITEMS_DIALOG_TEXT1;
301 const char *ITEMS_DIALOG_TEXT2;
302 const char *ITEMS_DIALOG_LINE1;
303 const char *ITEMS_DIALOG_LINE2;
305 const char *BTN_SELL;
306 const char *BTN_IDENTIFY;
309 const char *BTN_EQUIP;
310 const char *BTN_REMOVE;
311 const char *BTN_DISCARD;
312 const char *BTN_QUEST;
313 const char *BTN_ENCHANT;
314 const char *BTN_RECHARGE;
315 const char *BTN_GOLD;
316 const char *ITEM_BROKEN;
317 const char *ITEM_CURSED;
319 const char *BONUS_NAMES[7];
320 const char *WEAPON_NAMES[41];
321 const char *ARMOR_NAMES[14];
322 const char *ACCESSORY_NAMES[11];
323 const char *MISC_NAMES[22];
324 const char *SPECIAL_NAMES[74];
325 const char *ELEMENTAL_NAMES[6];
326 const char *ATTRIBUTE_NAMES[10];
327 const char *EFFECTIVENESS_NAMES[7];
328 const char *QUEST_ITEM_NAMES[85];
329 const char *QUEST_ITEM_NAMES_SWORDS[51];
330 int WEAPON_BASE_COSTS[35];
331 int ARMOR_BASE_COSTS[14];
332 int ACCESSORY_BASE_COSTS[11];
333 int MISC_MATERIAL_COSTS[22];
334 int MISC_BASE_COSTS[76];
335 int METAL_BASE_MULTIPLIERS[22];
336 int ITEM_SKILL_DIVISORS[4];
337 int RESTRICTION_OFFSETS[4];
338 int ITEM_RESTRICTIONS[86];
339 const char *NOT_PROFICIENT;
340 const char *NO_ITEMS_AVAILABLE;
341 const char *CATEGORY_NAMES[4];
342 const char *X_FOR_THE_Y;
344 const char *X_FOR_Y_GOLD;
345 const char *FMT_CHARGES;
346 const char *AVAILABLE_GOLD_COST;
349 const char *ITEM_ACTIONS[7];
350 const char *WHICH_ITEM;
351 const char *WHATS_YOUR_HURRY;
352 const char *USE_ITEM_IN_COMBAT;
353 const char *NO_SPECIAL_ABILITIES;
354 const char *CANT_CAST_WHILE_ENGAGED;
355 const char *EQUIPPED_ALL_YOU_CAN;
356 const char *REMOVE_X_TO_EQUIP_Y;
359 const char *CANNOT_REMOVE_CURSED_ITEM;
360 const char *CANNOT_DISCARD_CURSED_ITEM;
361 const char *PERMANENTLY_DISCARD;
362 const char *BACKPACK_IS_FULL;
363 const char *CATEGORY_BACKPACK_IS_FULL[4];
364 const char *BUY_X_FOR_Y_GOLD;
365 const char *SELL_X_FOR_Y_GOLD;
366 const char *GOLDS[2];
367 const char *NO_NEED_OF_THIS;
368 const char *NOT_RECHARGABLE;
369 const char *SPELL_FAILED;
370 const char *NOT_ENCHANTABLE;
371 const char *ITEM_NOT_BROKEN;
372 const char *FIX_IDENTIFY[2];
373 const char *FIX_IDENTIFY_GOLD;
374 const char *IDENTIFY_ITEM_MSG;
375 const char *ITEM_DETAILS;
377 const char *FIELD_NONE;
378 const char *DAMAGE_X_TO_Y;
379 const char *ELEMENTAL_XY_DAMAGE;
380 const char *ATTR_XY_BONUS;
381 const char *EFFECTIVE_AGAINST;
382 const char *QUESTS_DIALOG_TEXT;
383 const char *CLOUDS_OF_XEEN_LINE;
384 const char *DARKSIDE_OF_XEEN_LINE;
385 const char *SWORDS_OF_XEEN_LINE;
386 const char *NO_QUEST_ITEMS;
387 const char *NO_CURRENT_QUESTS;
388 const char *NO_AUTO_NOTES;
389 const char *QUEST_ITEMS_DATA;
390 const char *CURRENT_QUESTS_DATA;
391 const char *AUTO_NOTES_DATA;
392 const char *REST_COMPLETE;
393 const char *PARTY_IS_STARVING;
394 const char *HIT_SPELL_POINTS_RESTORED;
395 const char *TOO_DANGEROUS_TO_REST;
396 const char *SOME_CHARS_MAY_DIE;
397 const char *DISMISS_WHOM;
398 const char *CANT_DISMISS_LAST_CHAR;
399 const char *DELETE_CHAR_WITH_ELDER_WEAPON;
400 const char *REMOVE_DELETE[2];
401 const char *REMOVE_OR_DELETE_WHICH;
402 const char *YOUR_PARTY_IS_FULL;
403 const char *HAS_SLAYER_SWORD;
404 const char *SURE_TO_DELETE_CHAR;
405 const char *CREATE_CHAR_DETAILS;
406 const char *NEW_CHAR_STATS;
407 const char *NAME_FOR_NEW_CHARACTER;
408 const char *SELECT_CLASS_BEFORE_SAVING;
409 const char *EXCHANGE_ATTR_WITH;
410 int NEW_CHAR_SKILLS[10];
411 int NEW_CHAR_SKILLS_OFFSET[10];
412 int NEW_CHAR_SKILLS_LEN[10];
413 int NEW_CHAR_RACE_SKILLS[10];
414 int RACE_MAGIC_RESISTANCES[5];
415 int RACE_FIRE_RESISTANCES[5];
416 int RACE_ELECTRIC_RESISTANCES[5];
417 int RACE_COLD_RESISTANCES[5];
418 int RACE_ENERGY_RESISTANCES[5];
419 int RACE_POISON_RESISTANCES[5];
420 int NEW_CHARACTER_SPELLS[10][4];
421 const char *COMBAT_DETAILS;
422 const char *NOT_ENOUGH_TO_CAST;
423 const char *SPELL_CAST_COMPONENTS[2];
424 const char *CAST_SPELL_DETAILS;
425 const char *PARTY_FOUND;
426 const char *BACKPACKS_FULL_PRESS_KEY;
427 const char *HIT_A_KEY;
428 const char *GIVE_TREASURE_FORMATTING;
429 const char *FOUND[2];
430 const char *X_FOUND_Y;
432 const char *WHICH_ELEMENT1;
433 const char *WHICH_ELEMENT2;
434 const char *DETECT_MONSTERS;
435 const char *LLOYDS_BEACON;
436 const char *HOW_MANY_SQUARES;
437 const char *TOWN_PORTAL;
438 const char *TOWN_PORTAL_SWORDS;
439 int TOWN_MAP_NUMBERS[3][5];
440 const char *MONSTER_DETAILS;
441 const char *MONSTER_SPECIAL_ATTACKS[23];
442 const char *IDENTIFY_MONSTERS;
443 const char *EVENT_SAMPLES[6];
444 const char *MOONS_NOT_ALIGNED;
445 const char *AWARDS_FOR;
446 const char *AWARDS_TEXT;
447 const char *NO_AWARDS;
448 const char *WARZONE_BATTLE_MASTER;
449 const char *WARZONE_MAXED;
450 const char *WARZONE_LEVEL;
451 const char *WARZONE_HOW_MANY;
452 const char *PICKS_THE_LOCK;
453 const char *PICK_FORM[2];
454 const char *UNABLE_TO_PICK_LOCK;
455 const char *UNABLE_TO_PICK_FORM[2];
456 const char *CONTROL_PANEL_TEXT;
457 const char *CONTROL_PANEL_BUTTONS;
460 const char *CONFIRM_QUIT;
461 const char *MR_WIZARD;
462 const char *NO_LOADING_IN_COMBAT;
463 const char *NO_SAVING_IN_COMBAT;
464 const char *QUICK_FIGHT_TEXT;
465 const char *QUICK_FIGHT_OPTIONS[4];
466 const char *WORLD_END_TEXT[9];
467 const char *WORLD_CONGRATULATIONS;
468 const char *WORLD_CONGRATULATIONS2;
469 const char *CLOUDS_CONGRATULATIONS1;
470 const char *CLOUDS_CONGRATULATIONS2;
471 const char *GOOBER[3];
472 const char *MUSIC_FILES1[5];
473 const char *MUSIC_FILES2[6][7];
474 const char *DIFFICULTY_TEXT;
475 const char *SAVE_OFF_LIMITS;
476 const char *CLOUDS_INTRO1;
477 const char *DARKSIDE_ENDING1;
478 const char *DARKSIDE_ENDING2;
479 const char *PHAROAH_ENDING_TEXT1;
480 const char *PHAROAH_ENDING_TEXT2;
481 const char *CLOUDS_MAE_NAMES[131];
482 const char *CLOUDS_MIRROR_LOCATIONS[58];
483 const char *CLOUDS_MAP_NAMES[86];
484 const char *CLOUDS_MONSTERS[91];
485 const char *CLOUDS_SPELLS[77];
503 } DialogsControlPanel;
550 int KEY_CURRENT_QUESTS;
589 int KEY_START_NEW_GAME;
591 int KEY_SHOW_CREDITS;
592 int KEY_VIEW_ENDGAME;
static String format(MSVC_PRINTF const char *fmt,...) GCC_PRINTF(1
size_t strlcpy(char *dst, const char *src, size_t size)
Resources * init(XeenEngine *vm)
Definition: detection.h:27
#define MKTAG(a0, a1, a2, a3)
Definition: endian.h:188
Definition: resources.h:40