Repository navigation
Expand file tree
/
Copy pathDEFINES.H
More file actions
543 lines (422 loc) · 18.1 KB
/
Copy pathDEFINES.H
File metadata and controls
543 lines (422 loc) · 18.1 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
/*══════════════════════════════════════════════════════════════════════════*
█▀▀▀▄ █▀▀▀▀ █▀▀▀▀ █ ██▄ █ █▀▀▀▀ ██▀▀▀
██ █ ██▀▀ ██▀▀ ██ ██▀██ ██▀▀ ▀▀▀▀█
▀▀▀▀ ▀▀▀▀▀ ▀▀ ▀▀ ▀▀ ▀ ▀▀▀▀▀ ▀▀▀▀▀
*══════════════════════════════════════════════════════════════════════════*/
/*──────────────────────────────────────────────────────────────────────────*/
// Cdrom Version si pas define version disk
//#define CDROM 1
// mettre ce define pour une version travail seulement
// en cdrom pas d'importance ATTENTION à supprimer pour version disk
// #define MAGOUILLE_FLA_HD 1
/*----------------*/
// demo 3 cubes
// #define DEMO 1
// sauvegarde ecran/acceleration/infos
//#define DEBUG_TOOLS 1
#define START_SLIDESHOW_TEXT 900
#define MESSAGE_NO_CD "You need LBA2 CD, sorry!"
#define MESSAGE_NO_CD_US "You need Twinsen's Odyssey CD, sorry!"
#define TestBugMem() Free(Malloc(20000L))
#define FOREVER for (;;)
// Détermine le nombre d'éléments d'un tableau Static
#define NbTabIndex(tab) (sizeof(tab) / sizeof(tab[0]))
#define LoadFile3D(index) (BufferFile3D + *((U32 *)BufferFile3D + (index)))
/*----------------*/
#define MAX_ANGLE 4096
#define MUL_ANGLE 4
// Brick, Gri et Bll dans .HQR
#define BRICK_HQR 1
// samples dans .HQR
#define SAMPLE_HQR 1
// samples des FLAs dans .HQR
#define SAMPLE_FLA_HQR 1
//=======================================================================
// tous fichiers dans même dir
//#define ONE_GAME_DIRECTORY 1
//=======================================================================
/*──────────────────────────────────────────────────────────────────────────*/
/*----------------------------- camera -----------------------------*/
#define NB_VUE_CAMERA 2
/*──────────────────────────────────────────────────────────────────────────*/
/*----------------------------- details ----------------------------*/
#define MAX_DETAIL_LEVEL 3
/*──────────────────────────────────────────────────────────────────────────*/
/*----------------------------- Volumes ----------------------------*/
// a regler
#define DEF_SAMPLE_VOLUME 97
#define DEF_VOICE_VOLUME 112
#define DEF_MASTER_VOLUME 127
/*──────────────────────────────────────────────────────────────────────────*/
#define CD_TRACK_MENU 6 // theme LBA2
#define CD_TRACK_CREDITS 2 // Musique Mosquibees
#define JINGLE_TRACK_MENU 21
/*──────────────────────────────────────────────────────────────────────────*/
/*----------------------------- memoire -----------------------------*/
#define MIN_SPRITES_MEM 30000L
#define MAX_SPRITES_MEM 200000L
#define MIN_SPRITES_RAW_MEM 50000L
// 10000L quand la fonction HQR_Get() ne buggera plus !!!!!!!!!
#define MAX_SPRITES_RAW_MEM 50000L
#define MIN_ANIM_3DS_MEM 100000L
#define MAX_ANIM_3DS_MEM 300000L
/*
#define MIN_IMPACTS_MEM 5000L
#define MAX_IMPACTS_MEM 10000L
*/
#define MIN_SAMPLES_MEM 150000L
#define MAX_SAMPLES_MEM 600000L // 1000000L
#define MIN_ANIMS_MEM 40000L
#define MAX_ANIMS_MEM 400000L
#define MIN_BODYS_MEM 110000L
#define MAX_BODYS_MEM 300000L
#define MIN_OBJFIX_MEM 50000L
#define MAX_OBJFIX_MEM 300000L
/*
#define MIN_FLOW_MEM 5000L
#define MAX_FLOW_MEM 5000L
#define MIN_POF_MEM 5000L
#define MAX_POF_MEM 5000L
*/
//#define MIN_ISLE_MEM 300000L
//#define MAX_ISLE_MEM 1500000L // 1000000L
#define MIN_ISLE_OBJ_MEM 200000L // a determiner dynamiquement par mounfrac
// HQR_Isle_Obj decor-body cache ceiling, raised above the original 800 KB for
// headroom on modern RAM (heap-backed). Only takes effect with the
// AvailableMem() byte fix, which lets these budgets reach their ceilings.
#define MAX_ISLE_OBJ_MEM 16000000L
#define MIN_CUBE_INFOS_MEM 100L
#define MAX_CUBE_INFOS_MEM 1000L
#define MIN_LIST_DECORS_MEM 20000L // a determiner dynamiquement par mounfrac
#define MAX_LIST_DECORS_MEM 200000L
#define MIN_MAP_PGROUND_MEM (64 * 64 * 2 * sizeof(T_HALF_POLY)) // 32768
#define MAX_MAP_PGROUND_MEM 500000L
#define MIN_LIST_TEXDEF_MEM 40000L // a determiner dynamiquement par mounfrac
#define MAX_LIST_TEXDEF_MEM 200000L
#define MIN_MAP_SOMMETY_MEM (65 * 65 * 2) // 8450
#define MAX_MAP_SOMMETY_MEM 300000L
#define MIN_MAP_INTENSITY_MEM (65 * 65 * 2)
#define MAX_MAP_INTENSITY_MEM 200000L
/*──────────────────────────────────────────────────────────────────────────*/
/*──────────────────────────────────────────────────────────────────────────*/
#ifndef EDITLBA2
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#include <time.h>
#include <SYSTEM.H>
#include <SVGA.H>
#include <3D.H>
#include <OBJECT.H>
#include <ANIM.H>
#include <AIL.H>
#include <SMACKER_ADELINE.H>
#include <FILEIO.H>
/* The DEMO build pulled Adeline's CD-audio library by absolute path off the
1997 build machine. The demo ships its music as WAV files under MUSIC, not
as CD tracks, so nothing here needs it, and the sibling CDROM include below
was already commented out for the same reason.
#ifdef DEMO
#include "/projet/lib386/lib_cd/lib_cd.h"
#endif
#ifdef CDROM
#include "/projet/lib386/lib_cd/lib_cd.h"
#endif
*/
#endif // EDITLBA2
#include "COMMON.H"
/* Same `sprites.hqr` index as the original UI cursor (`SPRITE_CURSOR` in COMMON.H); see docs/MENU.md. */
#define MENU_MOUSE_SPRITE_HQR_INDEX SPRITE_CURSOR
// Puisqu'on n'inclue pas LIB_MEN3\LIB_MENU.H :
#ifdef WHITE
#undef WHITE
#endif
#ifdef BLACK
#undef BLACK
#endif
//#define WHITE 63 // blanc dans la banque de gris
//#define BLACK 240 // debut dernière banque
#define WHITE 255
#define LBAWHITE 15
#define BLACK 0
/*---------------- macros ------------------*/
// Pour DistribVersion
#define UNKNOWN_VERSION 0
#define ACTIVISION_VERSION 1
#define ACTIVISION_SUD_VERSION 2
#define EA_VERSION 3
#define VIRGIN_VERSION 4
#define VIRGIN_ASIA_VERSION 5
// SaveGame
#define SAVE_VERSION 4
// on stocke les sauvegardes dans BufSpeak
// NB: literal 640*480 is intentional — partitions BufSpeak (sized to
// RESOLUTION_X*RESOLUTION_Y in MEM.CPP). Keeping the slot count fixed avoids
// silently growing the save list when the framebuffer is widened.
#define MAX_PLAYER ((640 * 480) / (MAX_SIZE_PLAYER_NAME + 1 + sizeof(char *)))
#define MAX_SIZE_PLAYER_NAME 100 // Calculé avec des ',' par Isabelle
/*---------------- CONSTANTE ------------------*/
#define SIZE_CUBE_X 64
#define SIZE_CUBE_Y 25
#define SIZE_CUBE_Z 64
#define SIZE_BRICK_XZ 512
#define SIZE_BRICK_Y 256
#define DEMI_BRICK_XZ 256
#define DEMI_BRICK_Y 128
/*---------------- FENETRE ------------------*/
/* Mirrors COMMON.H (included above); see the note there on the mode-relative bounds. */
#define VIEW_X0 -50
#define VIEW_Y0 -30
#define VIEW_X1 ((S32)ModeDesiredX + 40)
#define VIEW_Y1 ((S32)ModeDesiredY + 100)
/*──────────────────────────────────────────────────────────────────────────*/
/* type objet pour affscene */
/* TYPE_OBJ_3D … TYPE_EXTRA: COMMON.H (included above). */
/*──────────────────────────────────────────────────────────────────────────*/
/* pour les menus (GAMEMENU.CPP) */
#define MENU_SHADE_LVL 11 // Shade à l'interieur des menus
#define SCREEN_SHADE_LVL 8 // Shade sous les menus
/*──────────────────────────────────────────────────────────────────────────*/
/* UI canvas placement (UI_CANVAS_H, UI_VCENTER_OFS, UI_VBOTTOM_OFS,
* UI_CENTER_X) moved to UI_LAYOUT.H, where the rule is one expression with a
* host test rather than a macro defined among the game's constants.
*
* The files that place UI now include UI_LAYOUT.H directly, so their include
* lists say they do. That is a convention, not a wall: this header includes
* INVENT.H and GAMEMENU.H, which include UI_LAYOUT.H, so anything that reaches
* C_EXTERN.H can still use the macros without asking for them. Breaking that
* chain means untangling DEFINES.H itself, which is its own job. */
/*──────────────────────────────────────────────────────────────────────────*/
/*──────────────────────────────────────────────────────────────────────────*/
/*──────────────────────────────────────────────────────────────────────────*/
#define MIN_S16 -32768
#define MAX_S16 32767
#define BODY_3D_PROTECT 62
/*──────────────────────────────────────────────────────────────────────────*/ /*──────────────────────────────────────────────────────────────────────────*/
#define NO_BODY 255
#define GEN_BODY_NORMAL 0
#define GEN_BODY_TUNIQUE 1
#define GEN_BODY_SABRE 2
#define GEN_BODY_SARBACANE 3
#define GEN_BODY_SARBATRON 4
#define GEN_BODY_GANT 5
#define GEN_BODY_PISTOLASER 6
#define GEN_BODY_MAGE 7
#define GEN_BODY_MAGE_SARBACANE 8
#define GEN_BODY_FEU 9
#define GEN_BODY_TUNIQUE_TIR 10
#define GEN_BODY_MAGE_TIR 11
#define GEN_BODY_LABYRINTHE 12
#define NO_ANIM 255
#define GEN_ANIM_RIEN 0
#define GEN_ANIM_MARCHE 1
#define GEN_ANIM_RECULE 2
#define GEN_ANIM_GAUCHE 3
#define GEN_ANIM_DROITE 4
#define GEN_ANIM_ENCAISSE 5
#define GEN_ANIM_CHOC 6
#define GEN_ANIM_TOMBE 7
#define GEN_ANIM_RECEPTION 8
#define GEN_ANIM_RECEPTION_2 9
#define GEN_ANIM_MORT 10
#define GEN_ANIM_ACTION 11
#define GEN_ANIM_MONTE 12
#define GEN_ANIM_ECHELLE 13
#define GEN_ANIM_SAUTE 14
#define GEN_ANIM_LANCE 15
#define GEN_ANIM_CACHE 16
#define GEN_ANIM_COUP_1 17
#define GEN_ANIM_COUP_2 18
#define GEN_ANIM_COUP_3 19
#define GEN_ANIM_TROUVE 20
#define GEN_ANIM_NOYADE 21
#define GEN_ANIM_CHOC2 22
#define GEN_ANIM_SABRE 23
#define GEN_ANIM_DEGAINE 24
#define GEN_ANIM_SAUTE_GAUCHE 25
#define GEN_ANIM_SAUTE_DROIT 26
#define GEN_ANIM_POUSSE 27
#define GEN_ANIM_PARLE 28
#define GEN_ANIM_DART 29
#define GEN_ANIM_DESCEND 30
#define GEN_ANIM_ECHDESC 31
#define GEN_ANIM_ARRIMAGE 32
#define GEN_ANIM_SKATE 33
#define GEN_ANIM_SKATEG 34
#define GEN_ANIM_SARBACANE 35
#define GEN_ANIM_GANT_DROIT 36
#define GEN_ANIM_GANT_GAUCHE 37
#define GEN_ANIM_PISTOLASER 38
#define GEN_ANIM_FOUDRE 39
#define GEN_ANIM_ESQUIVE_DROITE 40 // Esquive à droite
#define GEN_ANIM_ESQUIVE_GAUCHE 41 // Esquive à gauche
#define GEN_ANIM_ESQUIVE_AVANT 42 // Esquive avant
#define GEN_ANIM_ESQUIVE_ARRIERE 43 // Esquive arriere
#define GEN_ANIM_FEU 44
#define GEN_ANIM_SARBATRON 45
#define GEN_ANIM_GAZ 46
#define GEN_ANIM_LABYRINTHE 47 // Mort dans le labyrinthe du dôme
#define IMPACT_PINGOUIN 0 // index dans le HQR
/*──────────────────────────────────────────────────────────────────────────*/
//--------------- Types de sauts pour Twinsen ------------------------
#define DO_NORMAL_JUMP 1
#define DO_LEFT_JUMP 2
#define DO_RIGHT_JUMP 4
typedef struct {
U8 Func;
U8 TypeAnswer;
S16 Value;
} T_EXE_SWITCH;
/*──────────────────────────────────────────────────────────────────────────*/
/*──────────────────────────────────────────────────────────────────────────*/
// structure normalement alignée
typedef struct
{
U8 GenBody; // 0 à 254 mais je veux -1
U8 Col; /* brick en collision (inutile?) */
S16 SizeSHit; // Toujours carres
U16 GenAnim;
U16 NextGenAnim;
S32 OldPosX; /* old pos world */
S32 OldPosY;
S32 OldPosZ;
S32 Info; /* infos pour DoDir */
S32 Info1;
S32 Info2;
S32 Info3;
union {
struct {
S32 SHitX;
S32 SHitY; // Coups Super Hit
S32 SHitZ; // Servent aussi pour les Anim3DS
} SHit;
// ATTENTION: un PUSHABLE ne peut pas lancer de SUPER_HIT
struct {
S32 PushX;
S32 PushY;
S32 PushZ;
} Push;
struct {
S32 Num;
S32 Deb;
S32 Fin;
} A3DS;
} Coord;
/* B*/ U8 HitBy; /* frappe par */
/* B*/ U8 HitForce; /* si !=0 force de frappe anim */
/* B*/ S16 LifePoint; /* point de vie en cours */
S16 OptionFlags; /* flag d'init 2 */
U8 *PtrAnimAction;
S16 Sprite;
S16 OffsetLabelTrack;
// divers
T_OBJ_3D Obj;
U8 *PtrFile3D;
S32 IndexFile3D;
// constantes
/* B*/ S16 NbBonus; /* nb bonus to give */
/* B*/ U8 Armure; /* resistance */
U8 CoulObj; /* couleur dominante de l'objet */
/* game infos */
S16 XMin; /* ZV */
S16 XMax;
S16 YMin;
S16 YMax;
S16 ZMin;
S16 ZMax;
S32 OldBeta; /* angle de la boucle precedente */
BOUND_MOVE BoundAngle; /* valeur real time de rotation */
U8 *PtrTrack; /* ptr track prog */
S16 OffsetTrack; /* offset dans la track */
S16 SRot; /* vitesse de rotation */
U8 *PtrLife;
S16 OffsetLife; /* offset dans la vie */
U16 AnimDial; // se trouve ici pour l'alignement
/* B*/ S16 CarryBy;
/* B*/ U8 Move; /* type de deplacement */
/* B*/ U8 ObjCol; /* num obj en collision */
S16 ZoneSce; /* zone declenchement scenarique */
/* B*/ S16 LabelTrack; /* dernier label de track */
/* B*/ S16 MemoLabelTrack; /* memo dernier label de track */
/* B*/ S16 MemoComportement; /* memo comportement life */
U32 Flags; /* flags divers permanent */
// U16 Flags2 ; /* flags divers permanent */
U32 WorkFlags; /* flags de gestion */
S16 DoorWidth; // pour les DOOR
/* B*/ U8 FlagAnim; /* type d'anim en cours (dans flags?) */
U8 CodeJeu; // brick spéciale sample ou action
T_EXE_SWITCH ExeSwitch;
// S16 MessageChapter[MAX_CHAPTER] ;
T_ZONE *PtrZoneRail;
S32 SampleAlways; // Handle du sample always en train de se jouer
U8 SampleVolume;
} T_OBJET;
typedef struct
{
S32 X;
S32 Y;
S32 Z;
} T_TRACK;
typedef struct
{
U8 Type;
U8 Num;
} T_TABALLCUBE;
#ifndef EDITLBA2
#include "3DEXT/EXTERN.H"
#include "PTRFUNC.H"
//#include "OLDSORT.H"
#include "SORT.H"
#include "INVENT.H"
#include "COMPORTE.H"
#include "MESSAGE.H"
#include "FUNC.H"
#include "FLOW.H"
#include "POF.H"
#include "DART.H"
#include "PLAYACF.H"
#include "DEC_XCF.H"
#include "ANIMTEX.H"
#include "IMPACT.H"
#include "HOLO.H"
#include "BUGGY.H"
#include "WAGON.H"
#include "PATCH.H"
//#include "INPUT.H"
#include "BEZIER.H"
#include "INTEXT.H"
#include "EXTFUNC.H"
#include "RAIN.H"
#include "DISKFUNC.H"
#include "FICHE.H"
#include "OBJECT.H"
#include "PERSO.H"
#include "GRILLE.H"
#include "GERETRAK.H"
#include "GERELIFE.H"
#include "GAMEMENU.H"
#include "FIRE.H"
/* AMBIANCE.H is deliberately not here. Aggregating a module header into
DEFINES.H puts it in front of all 58 files that reach C_EXTERN.H, so no
caller ever has to say it uses audio and the ownership rule in CODESTYLE
has nothing to bite on. The files that use it include it. */
#include "INCRUST.H"
#include "EXTRA.H"
#include "LZSS.H"
#include "SAVEGAME.H"
#include "ADDKEYS.H" // définition de touches supplémentaires
#include "MEM.H"
#include "VALIDPOS.H"
#include "CHEATCOD.H"
#include "CONFIG.H"
#include "CREDITS.H"
#include "MUSIC.H"
#include "ZV.H"
#include "SCAN.H"
#include "KEYB.H"
#include "JOYSTICK.H"
#endif // EDITLBA2
/*──────────────────────────────────────────────────────────────────────────*/
/*──────────────────────────────────────────────────────────────────────────*/