forked from Russian-Doom/russian-doom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjn.h
439 lines (376 loc) · 14.6 KB
/
jn.h
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
//
// Copyright(C) 2014 Fabian Greffrath
// Copyright(C) 2016-2023 Julian Nechaevsky
// Copyright(C) 2020-2024 Leonid Murin (Dasperal)
//
// 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.
//
// DESCRIPTION:
// Russian Doom specific variables.
//
#pragma once
#include "doomtype.h"
#ifndef MIN
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef MAX
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
#ifndef BETWEEN
#define BETWEEN(l,u,x) (((l)>(x))?(l):((x)>(u))?(u):(x))
#endif
#define singleplayer (!demorecording && !demoplayback && !netgame)
/**
* Macro for vanilla visual bug fix condition.
* It accounts for '-vanilla' cli param.
*
* Vanilla visual bug fixes should be wrapped in if statement with this macro as condition.
*
* @param option - Name of the config option.
* It should be true if the fix is enabled.
* And it should be false if the fix is disabled, i.e., vanilla behavior.
* @returns True - when fix should be enabled.
* False - when fix should be disabled, i.e., vanilla behavior.
*/
#define vanilla_visual_bug_fix(option) (!vanillaparm && !strict_mode && singleplayer && (option))
/**
* Macro for vanilla gameplay bug fix condition.
* It accounts for '-vanilla' cli param, the 'strict gameplay mode' option,
* demo playback/record and netgame
*
* Vanilla gameplay bug fixes should be wrapped in if statement with this macro as condition.
*
* @param option - Name of the config option.
* It should be true if the fix is enabled.
* And it should be false if the fix is disabled, i.e., vanilla behavior.
* @returns True - when fix should be enabled.
* False - when fix should be disabled, i.e., vanilla behavior.
*/
#define vanilla_gameplay_bug_fix(option) (!vanillaparm && !strict_mode && singleplayer && (option))
/**
* Macro for vanilla gameplay feature condition.
* It accounts for '-vanilla' cli param, the 'strict gameplay mode' option,
* demo playback/record and netgame
*
* Vanilla gameplay features that can be disabled should be wrapped in if statement with this macro as condition.
*
* @param option - Name of the config option.
* It should be true if the feature is enabled, i.e., vanilla behavior.
* And it should be false if the feature is disabled.
* @returns True - when feature should be enabled, i.e., vanilla behavior.
* False - when feature should be disabled.
*/
#define vanilla_gameplay_feature(option) (vanillaparm || strict_mode || !singleplayer || (option))
/**
* Macro for additional visual feature condition.
* It accounts for '-vanilla' cli param.
*
* Additional visual features should be wrapped in if statement with this macro as condition.
*
* @param option - Name of the config option.
* It should be true if the feature is enabled.
* And it should be false if the feature is disabled, i.e., vanilla behavior.
* @returns True - when feature should be enabled.
* False - when feature should be disabled, i.e., vanilla behavior.
*/
#define visual_feature(option) (!vanillaparm && (option))
/**
* Macro for additional gameplay feature condition.
* It accounts for '-vanilla' cli param, the 'strict gameplay mode' option,
* demo playback/record and netgame
*
* Additional gameplay features should be wrapped in if statement with this macro as condition.
*
* @param option - Name of the config option.
* It should be true if the feature is enabled.
* And it should be false if the feature is disabled, i.e., vanilla behavior.
* @returns True - when feature should be enabled.
* False - when feature should be disabled, i.e., vanilla behavior.
*/
#define gameplay_feature(option) (!vanillaparm && !strict_mode && singleplayer && (option))
void *crispy_realloc (void *ptr, size_t size);
enum
{
REINIT_FRAMEBUFFERS = 1,
REINIT_RENDERER = 2,
REINIT_TEXTURES = 4,
REINIT_ASPECTRATIO = 8,
};
extern int lang_param;
// -----------------------------------------------------------------------------
// Language (0 = Russian, 1 = English)
// -----------------------------------------------------------------------------
extern int english_language;
// -----------------------------------------------------------------------------
// Command line parameters
// -----------------------------------------------------------------------------
extern boolean vanillaparm;
extern int demowarp; // [JN] Demo warp from Crispy Doom.
// -----------------------------------------------------------------------------
// Rendering
// -----------------------------------------------------------------------------
extern int vsync;
// extern int preserve_window_aspect_ratio;
extern int uncapped_fps;
extern int show_fps, real_fps;
extern int max_fps;
extern int smoothlight;
extern int show_diskicon;
extern int screen_wiping;
extern int png_screenshots;
extern int show_endoom;
extern int flashing_hom;
// -----------------------------------------------------------------------------
// Display
// -----------------------------------------------------------------------------
extern int screenblocks, screenSize;
extern int extra_level_brightness;
extern int menu_shading;
extern float brightness;
extern float color_saturation;
extern int show_palette;
extern float r_color_factor;
extern float g_color_factor;
extern float b_color_factor;
extern int local_time;
extern int hud_detaillevel;
extern int showMessages;
extern int message_fade;
extern int draw_shadowed_text;
extern int messages_alignment;
extern int messages_timeout;
extern int message_color_pickup;
extern int message_color_secret;
extern int message_color_system;
extern int message_color_chat;
extern int message_color_quest;
// -----------------------------------------------------------------------------
// Automap
// -----------------------------------------------------------------------------
extern int automap_color;
extern int automap_antialias;
extern int automap_rotate;
extern int automap_overlay;
extern int automap_overlay_bg;
extern int automap_follow;
extern int automap_grid;
extern int automap_grid_size;
extern int automap_mark_color;
extern int automap_secrets;
// -----------------------------------------------------------------------------
// Stats
// -----------------------------------------------------------------------------
extern int stats_placement;
extern int stats_kis;
extern int stats_skill;
extern int stats_level_time;
extern int stats_total_time;
extern int stats_coords;
extern int stats_level_name;
extern int stats_color;
// -----------------------------------------------------------------------------
// Sound
// -----------------------------------------------------------------------------
extern int snd_channels_rd, snd_channels, snd_channels_vanilla;
extern int snd_monomode;
extern int mute_inactive_window;
extern boolean window_focused;
extern boolean volume_needs_update;
// -----------------------------------------------------------------------------
// Controls
// -----------------------------------------------------------------------------
extern int mlook;
extern int novert;
extern int mouse_y_invert;
// -----------------------------------------------------------------------------
// Selective game
// -----------------------------------------------------------------------------
extern int selective_class; // Hexen player class
extern int selective_skill;
extern int selective_episode;
extern int selective_map;
extern int selective_health;
extern int selective_armor;
extern int selective_armortype;
extern int selective_armor_0; // Hexen armor: MESH ARMOR
extern int selective_armor_1; // Hexen armor: FALCON SHIELD
extern int selective_armor_2; // Hexen armor: PLATINUM HELMET
extern int selective_armor_3; // Hexen armor: AMULET OF WARDING
// Doom weapons
extern int selective_wp_chainsaw;
extern int selective_wp_shotgun;
extern int selective_wp_supershotgun;
extern int selective_wp_chaingun;
extern int selective_wp_missile;
extern int selective_wp_plasma;
extern int selective_wp_bfg;
// Heretic weapons
extern int selective_wp_gauntlets;
extern int selective_wp_crossbow;
extern int selective_wp_dragonclaw;
extern int selective_wp_hellstaff;
extern int selective_wp_phoenixrod;
extern int selective_wp_firemace;
// Hexen weapons
extern int selective_wp_second;
extern int selective_wp_third;
extern int selective_wp_fourth;
extern int selective_wp_piece_0;
extern int selective_wp_piece_1;
extern int selective_wp_piece_2;
extern int selective_backpack;
extern int selective_ammo_0; // bullets | wand crystals | blue mana
extern int selective_ammo_1; // shells | ethereal arrows | green mana
extern int selective_ammo_2; // cells | claw orbs |
extern int selective_ammo_3; // rockets | hellstaff runes |
extern int selective_ammo_4; // | flame orbs |
extern int selective_ammo_5; // | mace spheres |
extern int selective_key_0; // blue keycard | yellow key | EMERALD KEY
extern int selective_key_1; // yellow keycard | green key | SILVER KEY
extern int selective_key_2; // red keycard | blue key | FIRE KEY
extern int selective_key_3; // blue skull key | | STEEL KEY
extern int selective_key_4; // yellow skull key | | HORN KEY
extern int selective_key_5; // red skull key | | CAVE KEY
extern int selective_key_6; // | | CASTLE KEY
extern int selective_key_7; // | | SWAMP KEY
extern int selective_key_8; // | | RUSTED KEY
extern int selective_key_9; // | | DUNGEON KEY
extern int selective_key_10; // | | AXE KEY
extern int selective_fast;
extern int selective_respawn;
// Heretic artifacts
extern int selective_arti_0; // Quartz Flask
extern int selective_arti_1; // Mystic Urn
extern int selective_arti_2; // Timebomb | FLECHETTE
extern int selective_arti_3; // Tome of Power | DISC OF REPULSION
extern int selective_arti_4; // Ring of Invincibility | ICON OF THE DEFENDER
extern int selective_arti_5; // Morph Ovum | PORKALATOR
extern int selective_arti_6; // Chaos Device
extern int selective_arti_7; // Shadowsphere | BANISHMENT DEVICE
extern int selective_arti_8; // Wings of Wrath
extern int selective_arti_9; // Torch
extern int selective_arti_10; // | KRATER OF MIGHT
extern int selective_arti_11; // | DRAGONSKIN BRACERS
extern int selective_arti_12; // | DARK SERVANT
extern int selective_arti_13; // | BOOTS OF SPEED
extern int selective_arti_14; // | MYSTIC AMBIT INCANT
extern int selective_puzzle_0; // FLAME MASK
extern int selective_puzzle_1; // HEART OF D'SPARIL
extern int selective_puzzle_2; // RUBY PLANET
extern int selective_puzzle_3; // EMERALD PLANET 1
extern int selective_puzzle_4; // EMERALD PLANET 2
extern int selective_puzzle_5; // SAPPHIRE PLANET 1
extern int selective_puzzle_6; // SAPPHIRE PLANET 2
extern int selective_puzzle_7; // CLOCK GEAR ((S)
extern int selective_puzzle_8; // CLOCK GEAR ((B)
extern int selective_puzzle_9; // CLOCK GEAR ((S B)
extern int selective_puzzle_10; // CLOCK GEAR ((B S)
extern int selective_puzzle_11; // DAEMON CODEX
extern int selective_puzzle_12; // LIBER OSCURA
extern int selective_puzzle_13; // YORICK'S SKULL
extern int selective_puzzle_14; // GLAIVE SEAL
extern int selective_puzzle_15; // HOlY RELIC
extern int selective_puzzle_16; // SIGIL OF THE MAGUS
// -----------------------------------------------------------------------------
// Gameplay feautures
// -----------------------------------------------------------------------------
// Gameplay: Game Mechanics
extern int strict_mode;
// Gameplay: Graphical
extern int brightmaps;
extern int fake_contrast;
extern int translucency;
extern int improved_fuzz;
extern int colored_blood;
extern int swirling_liquids;
extern int invul_sky;
extern int linear_sky;
extern int randomly_flipcorpses;
extern int flip_weapons;
// Gameplay: Status Bar
extern int extra_player_faces;
extern int negative_health;
extern int sbar_colored;
extern int sbar_colored_gem;
extern int stbar_color_high;
extern int stbar_color_normal;
extern int stbar_color_low;
extern int stbar_color_critical;
extern int stbar_color_armor_1;
extern int stbar_color_armor_2;
extern int stbar_color_armor_0;
extern int ammo_widget;
extern int ammo_widget_colored;
extern int weapon_widget;
extern int center_inventory_cursor;
// Gameplay: Audible
extern int z_axis_sfx;
extern int play_exit_sfx;
extern int crushed_corpses_sfx;
extern int blazing_door_fix_sfx;
extern int noise_alert_sfx;
extern int correct_endlevel_sfx;
// Gameplay: Tactical
extern int secret_notification;
extern int infragreen_visor;
extern int horizontal_autoaim;
extern int show_all_artifacts;
extern int show_artifacts_timer;
// Gameplay: Physical
extern int improved_collision;
extern int over_under;
extern int torque;
extern int ssg_blast_enemies;
extern int floating_powerups;
extern int toss_drop;
extern int weapon_bobbing;
// Gameplay: Crosshair
extern int crosshair_draw;
extern int crosshair_shape;
extern int crosshair_type;
extern int crosshair_scale;
extern int crosshair_opacity;
// Gameplay: Gameplay
extern int default_skill;
extern int fix_map_errors;
extern int flip_levels;
extern int pistol_start;
extern int breathing;
extern int unlimited_lost_souls;
extern int fast_quickload;
extern int skip_unused_artifact;
// Gameplay: Demos
extern int demotimer;
extern int demotimerdir;
extern int demobar;
extern int no_internal_demos;
// -----------------------------------------------------------------------------
// Doom Press Release Beta
// -----------------------------------------------------------------------------
extern int artifactcount; // Amount of artifacts
extern int lifecount; // Amount of lifes
typedef enum
{
v_message_color_secret = 0,
v_message_color_quest,
v_stbar_color_high,
v_stbar_color_normal,
v_stbar_color_low,
v_stbar_color_critical,
v_stbar_color_armor_1,
v_stbar_color_armor_2,
v_stbar_color_armor_0
} notCommonVar_t;
/**
* [Dasperal] This function is used to get a pointer to some of the previously declared variables.
* It is needed because direct use of them leads to a linking error
*/
int* JN_getNotCommonIntVarPointer(notCommonVar_t var);