doomdef.h 18.8 KB
Newer Older
Alam Ed Arias committed
1 2 3 4
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
James R. committed
5
// Copyright (C) 1999-2020 by Sonic Team Junior.
Alam Ed Arias committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file  doomdef.h
/// \brief Internally used data structures for virtually everything,
///        key definitions, lots of other stuff.

#ifndef __DOOMDEF__
#define __DOOMDEF__

// Sound system select
// This should actually be in the makefile,
// but I can't stand that gibberish. D:
#define SOUND_DUMMY   0
#define SOUND_SDL     1
#define SOUND_MIXER   2
#define SOUND_FMOD    3

#ifndef SOUND
Alam Ed Arias committed
27
#ifdef HAVE_SDL
Alam Ed Arias committed
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

// Use Mixer interface?
#ifdef HAVE_MIXER
    #define SOUND SOUND_MIXER
    #define NOHS // No HW3SOUND
    #ifdef HW3SOUND
    #undef HW3SOUND
    #endif
#endif

// Use generic SDL interface.
#ifndef SOUND
#define SOUND SOUND_SDL
#endif

#else // No SDL.

// Use FMOD?
#ifdef HAVE_FMOD
    #define SOUND SOUND_FMOD
    #define NOHS // No HW3SOUND
    #ifdef HW3SOUND
    #undef HW3SOUND
    #endif
#else
    // No more interfaces. :(
    #define SOUND SOUND_DUMMY
#endif

#endif
#endif

#ifdef _WINDOWS
61
#define NONET
Alam Ed Arias committed
62 63 64 65 66 67 68 69 70
#if !defined (HWRENDER) && !defined (NOHW)
#define HWRENDER
#endif
// judgecutor: 3D sound support
#if !defined(HW3SOUND) && !defined (NOHS)
#define HW3SOUND
#endif
#endif

Monster Iestyn committed
71
#ifdef _WIN32
Alam Ed Arias committed
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
#define ASMCALL __cdecl
#else
#define ASMCALL
#endif

#ifdef _MSC_VER
#pragma warning(disable : 4127 4152 4213 4514)
#ifdef _WIN64
#pragma warning(disable : 4306)
#endif
#endif
// warning level 4
// warning C4127: conditional expression is constant
// warning C4152: nonstandard extension, function/data pointer conversion in expression
// warning C4213: nonstandard extension used : cast on l-value


#include "doomtype.h"

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

96
#define _USE_MATH_DEFINES // fixes M_PI errors in r_plane.c for Visual Studio
Alam Ed Arias committed
97 98 99 100 101
#include <math.h>

#ifdef GETTEXT
#include <libintl.h>
#endif
102
#include <locale.h> // locale should not be dependent on GETTEXT -- 11/01/20 Monster Iestyn
Alam Ed Arias committed
103 104 105 106 107

#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>

Monster Iestyn committed
108
#if defined (_WIN32) || defined (__DJGPP__)
Alam Ed Arias committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
#include <io.h>
#endif

#ifdef PC_DOS
#include <conio.h>
#endif

//#define NOMD5

// Uncheck this to compile debugging code
//#define RANGECHECK
//#ifndef PARANOIA
//#define PARANOIA // do some tests that never fail but maybe
// turn this on by make etc.. DEBUGMODE = 1 or use the Debug profile in the VC++ projects
//#endif
#if defined (_WIN32) || (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON) || defined (macintosh)
#define LOGMESSAGES // write message in log.txt
#endif

#ifdef LOGMESSAGES
extern FILE *logstream;
130
extern char logfilename[1024];
Alam Ed Arias committed
131 132
#endif

James R. committed
133 134 135
/* A mod name to further distinguish versions. */
#define SRB2APPLICATION "SRB2"

136
//#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
137
#ifdef DEVELOP
Alam Ed Arias committed
138 139
#define VERSION    0 // Game version
#define SUBVERSION 0 // more precise version number
140 141 142 143
#define VERSIONSTRING "Development EXE"
#define VERSIONSTRINGW L"Development EXE"
// most interface strings are ignored in development mode.
// we use comprevision and compbranch instead.
Alam Ed Arias committed
144
#else
145
#define VERSION    202 // Game version
SteelT committed
146
#define SUBVERSION 6  // more precise version number
SteelT committed
147 148
#define VERSIONSTRING "v2.2.6"
#define VERSIONSTRINGW L"v2.2.6"
149 150
// Hey! If you change this, add 1 to the MODVERSION below!
// Otherwise we can't force updates!
Alam Ed Arias committed
151 152
#endif

153 154 155
/* A custom URL protocol for server links. */
#define SERVER_URL_PROTOCOL "srb2://"

156 157
// Does this version require an added patch file?
// Comment or uncomment this as necessary.
SteelT committed
158
#define USE_PATCH_DTA
159

160 161 162
// Use .kart extension addons
//#define USE_KART

Alam Ed Arias committed
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
// Modification options
// If you want to take advantage of the Master Server's ability to force clients to update
// to the latest version, fill these out.  Otherwise, just comment out UPDATE_ALERT and leave
// the other options the same.

// Comment out this line to completely disable update alerts (recommended for testing, but not for release)
#define UPDATE_ALERT

// The string used in the alert that pops up in the event of an update being available.
// Please change to apply to your modification (we don't want everyone asking where your mod is on SRB2.org!).
#define UPDATE_ALERT_STRING \
"A new update is available for SRB2.\n"\
"Please visit SRB2.org to download it.\n"\
"\n"\
"You are using version: %s\n"\
"The newest version is: %s\n"\
"\n"\
"This update is required for online\n"\
"play using the Master Server.\n"\
"You will not be able to connect to\n"\
"the Master Server until you update to\n"\
"the newest version of the game.\n"\
"\n"\
"(Press a key)\n"

// The string used in the I_Error alert upon trying to host through command line parameters.
// Generally less filled with newlines, since Windows gives you lots more room to work with.
#define UPDATE_ALERT_STRING_CONSOLE \
"A new update is available for SRB2.\n"\
"Please visit SRB2.org to download it.\n"\
"\n"\
"You are using version: %s\n"\
"The newest version is: %s\n"\
"\n"\
"This update is required for online play using the Master Server.\n"\
"You will not be able to connect to the Master Server\n"\
"until you update to the newest version of the game.\n"

// For future use, the codebase is the version of SRB2 that the modification is based on,
// and should not be changed unless you have merged changes between versions of SRB2
// (such as 2.0.4 to 2.0.5, etc) into your working copy.
// Will always resemble the versionstring, 205 = 2.0.5, 210 = 2.1, etc.
205
#define CODEBASE 220
Alam Ed Arias committed
206

207
// The Modification ID; must be obtained from a Master Server Admin ( https://mb.srb2.org/showgroups.php ).
Alam Ed Arias committed
208
// DO NOT try to set this otherwise, or your modification will be unplayable through the Master Server.
209 210
// "18" is the default mod ID for version 2.2
#define MODID 18
Alam Ed Arias committed
211 212 213 214

// The Modification Version, starting from 1. Do not follow your version string for this,
// it's only for detection of the version the player is using so the MS can alert them of an update.
// Only set it higher, not lower, obviously.
215
// Note that we use this to help keep internal testing in check; this is why v2.2.0 is not version "1".
SteelT committed
216
#define MODVERSION 47
Alam Ed Arias committed
217

218
// To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically.
219 220 221
// Increment MINOREXECVERSION whenever a config change is needed that does not correspond
// to an increment in MODVERSION. This might never happen in practice.
// If MODVERSION increases, set MINOREXECVERSION to 0.
222
#define MAJOREXECVERSION MODVERSION
223
#define MINOREXECVERSION 0
224
// (It would have been nice to use VERSION and SUBVERSION but those are zero'd out for DEVELOP builds)
225 226 227 228 229 230

// Macros
#define GETMAJOREXECVERSION(v) (v & 0xFFFF)
#define GETMINOREXECVERSION(v) (v >> 16)
#define GETEXECVERSION(major,minor) (major + (minor << 16))
#define EXECVERSION GETEXECVERSION(MAJOREXECVERSION, MINOREXECVERSION)
Alam Ed Arias committed
231 232 233 234 235 236 237

// =========================================================================

// The maximum number of players, multiplayer/networking.
// NOTE: it needs more than this to increase the number of players...

#define MAXPLAYERS 32
238
#define MAXSKINS 32
Alam Ed Arias committed
239 240 241
#define PLAYERSMASK (MAXPLAYERS-1)
#define MAXPLAYERNAME 21

James Hale committed
242 243
#define COLORRAMPSIZE 16
#define MAXCOLORNAME 32
244
#define NUMCOLORFREESLOTS 1024
James Hale committed
245 246 247 248 249

typedef struct skincolor_s
{
	char name[MAXCOLORNAME+1];  // Skincolor name
	UINT8 ramp[COLORRAMPSIZE];  // Colormap ramp
250
	UINT16 invcolor;            // Signpost color
James Hale committed
251 252 253 254 255
	UINT8 invshade;             // Signpost color shade
	UINT16 chatcolor;           // Chat color
	boolean accessible;         // Accessible by the color command + setup menu
} skincolor_t;

Alam Ed Arias committed
256 257 258
typedef enum
{
	SKINCOLOR_NONE = 0,
259 260

	// Greyscale ranges
Alam Ed Arias committed
261
	SKINCOLOR_WHITE,
262 263
	SKINCOLOR_BONE,
	SKINCOLOR_CLOUDY,
264 265
	SKINCOLOR_GREY,
	SKINCOLOR_SILVER,
266 267
	SKINCOLOR_CARBON,
	SKINCOLOR_JET,
Alam Ed Arias committed
268
	SKINCOLOR_BLACK,
269 270 271 272

	// Desaturated
	SKINCOLOR_AETHER,
	SKINCOLOR_SLATE,
SteelT committed
273
	SKINCOLOR_BLUEBELL,
274 275
	SKINCOLOR_PINK,
	SKINCOLOR_YOGURT,
Alam Ed Arias committed
276
	SKINCOLOR_BROWN,
SteelT committed
277
	SKINCOLOR_BRONZE,
278 279 280 281 282 283 284 285 286
	SKINCOLOR_TAN,
	SKINCOLOR_BEIGE,
	SKINCOLOR_MOSS,
	SKINCOLOR_AZURE,
	SKINCOLOR_LAVENDER,

	// Viv's vivid colours (toast 21/07/17)
	SKINCOLOR_RUBY,
	SKINCOLOR_SALMON,
Alam Ed Arias committed
287
	SKINCOLOR_RED,
Sryder committed
288
	SKINCOLOR_CRIMSON,
289
	SKINCOLOR_FLAME,
SteelT committed
290
	SKINCOLOR_KETCHUP,
291 292 293
	SKINCOLOR_PEACHY,
	SKINCOLOR_QUAIL,
	SKINCOLOR_SUNSET,
SteelT committed
294
	SKINCOLOR_COPPER,
295
	SKINCOLOR_APRICOT,
wolfs committed
296 297
	SKINCOLOR_ORANGE,
	SKINCOLOR_RUST,
Alam Ed Arias committed
298
	SKINCOLOR_GOLD,
299
	SKINCOLOR_SANDY,
wolfs committed
300
	SKINCOLOR_YELLOW,
301 302
	SKINCOLOR_OLIVE,
	SKINCOLOR_LIME,
wolfs committed
303
	SKINCOLOR_PERIDOT,
SteelT committed
304
	SKINCOLOR_APPLE,
wolfs committed
305
	SKINCOLOR_GREEN,
306
	SKINCOLOR_FOREST,
wolfs committed
307
	SKINCOLOR_EMERALD,
308 309
	SKINCOLOR_MINT,
	SKINCOLOR_SEAFOAM,
wolfs committed
310 311
	SKINCOLOR_AQUA,
	SKINCOLOR_TEAL,
312
	SKINCOLOR_WAVE,
wolfs committed
313
	SKINCOLOR_CYAN,
314 315 316 317 318
	SKINCOLOR_SKY,
	SKINCOLOR_CERULEAN,
	SKINCOLOR_ICY,
	SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave – slender aphrodite has overcome me with longing for a girl
	SKINCOLOR_CORNFLOWER,
wolfs committed
319
	SKINCOLOR_BLUE,
320 321 322
	SKINCOLOR_COBALT,
	SKINCOLOR_VAPOR,
	SKINCOLOR_DUSK,
wolfs committed
323 324
	SKINCOLOR_PASTEL,
	SKINCOLOR_PURPLE,
325
	SKINCOLOR_BUBBLEGUM,
wolfs committed
326
	SKINCOLOR_MAGENTA,
327 328 329 330
	SKINCOLOR_NEON,
	SKINCOLOR_VIOLET,
	SKINCOLOR_LILAC,
	SKINCOLOR_PLUM,
SteelT committed
331
	SKINCOLOR_RASPBERRY,
wolfs committed
332
	SKINCOLOR_ROSY,
Alam Ed Arias committed
333

James Hale committed
334
	FIRSTSUPERCOLOR,
Alam Ed Arias committed
335 336

	// Super special awesome Super flashing colors!
James Hale committed
337
	SKINCOLOR_SUPERSILVER1 = FIRSTSUPERCOLOR,
toaster committed
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
	SKINCOLOR_SUPERSILVER2,
	SKINCOLOR_SUPERSILVER3,
	SKINCOLOR_SUPERSILVER4,
	SKINCOLOR_SUPERSILVER5,

	SKINCOLOR_SUPERRED1,
	SKINCOLOR_SUPERRED2,
	SKINCOLOR_SUPERRED3,
	SKINCOLOR_SUPERRED4,
	SKINCOLOR_SUPERRED5,

	SKINCOLOR_SUPERORANGE1,
	SKINCOLOR_SUPERORANGE2,
	SKINCOLOR_SUPERORANGE3,
	SKINCOLOR_SUPERORANGE4,
	SKINCOLOR_SUPERORANGE5,

	SKINCOLOR_SUPERGOLD1,
	SKINCOLOR_SUPERGOLD2,
	SKINCOLOR_SUPERGOLD3,
	SKINCOLOR_SUPERGOLD4,
	SKINCOLOR_SUPERGOLD5,

	SKINCOLOR_SUPERPERIDOT1,
	SKINCOLOR_SUPERPERIDOT2,
	SKINCOLOR_SUPERPERIDOT3,
	SKINCOLOR_SUPERPERIDOT4,
	SKINCOLOR_SUPERPERIDOT5,

367 368 369 370 371
	SKINCOLOR_SUPERSKY1,
	SKINCOLOR_SUPERSKY2,
	SKINCOLOR_SUPERSKY3,
	SKINCOLOR_SUPERSKY4,
	SKINCOLOR_SUPERSKY5,
toaster committed
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390

	SKINCOLOR_SUPERPURPLE1,
	SKINCOLOR_SUPERPURPLE2,
	SKINCOLOR_SUPERPURPLE3,
	SKINCOLOR_SUPERPURPLE4,
	SKINCOLOR_SUPERPURPLE5,

	SKINCOLOR_SUPERRUST1,
	SKINCOLOR_SUPERRUST2,
	SKINCOLOR_SUPERRUST3,
	SKINCOLOR_SUPERRUST4,
	SKINCOLOR_SUPERRUST5,

	SKINCOLOR_SUPERTAN1,
	SKINCOLOR_SUPERTAN2,
	SKINCOLOR_SUPERTAN3,
	SKINCOLOR_SUPERTAN4,
	SKINCOLOR_SUPERTAN5,

James Hale committed
391
	SKINCOLOR_FIRSTFREESLOT,
392
	SKINCOLOR_LASTFREESLOT = SKINCOLOR_FIRSTFREESLOT + NUMCOLORFREESLOTS - 1,
James Hale committed
393 394 395 396 397 398

	MAXSKINCOLORS,

	NUMSUPERCOLORS = ((SKINCOLOR_FIRSTFREESLOT - FIRSTSUPERCOLOR)/5)
} skincolornum_t;

399
extern UINT16 numskincolors;
James Hale committed
400 401

extern skincolor_t skincolors[MAXSKINCOLORS];
Alam Ed Arias committed
402 403 404 405 406 407 408

// State updates, number of tics / second.
// NOTE: used to setup the timer rate, see I_StartupTimer().
#define TICRATE 35
#define NEWTICRATERATIO 1 // try 4 for 140 fps :)
#define NEWTICRATE (TICRATE*NEWTICRATERATIO)

409 410
#define MUSICRATE 1000 // sound timing is calculated by milliseconds

Alam Ed Arias committed
411 412 413 414 415 416
#define RING_DIST 512*FRACUNIT // how close you need to be to a ring to attract it

#define PUSHACCEL (2*FRACUNIT) // Acceleration for MF2_SLIDEPUSH items.

// Special linedef executor tag numbers!
enum {
417 418 419
	LE_PINCHPHASE      =    -2, // A boss entered pinch phase (and, in most cases, is preparing their pinch phase attack!)
	LE_ALLBOSSESDEAD   =    -3, // All bosses in the map are dead (Egg capsule raise)
	LE_BOSSDEAD        =    -4, // A boss in the map died (Chaos mode boss tally)
420
	LE_BOSS4DROP       =    -5, // CEZ boss dropped its cage (also subtract the number of hitpoints it's lost)
421 422 423 424 425 426 427 428 429
	LE_BRAKVILEATACK   =    -6, // Brak's doing his LOS attack, oh noes
	LE_TURRET          = 32000, // THZ turret
	LE_BRAKPLATFORM    =  4200, // v2.0 Black Eggman destroys platform
	LE_CAPSULE2        =   682, // Egg Capsule
	LE_CAPSULE1        =   681, // Egg Capsule
	LE_CAPSULE0        =   680, // Egg Capsule
	LE_KOOPA           =   650, // Distant cousin to Gay Bowser
	LE_AXE             =   649, // MKB Axe object
	LE_PARAMWIDTH      =  -100  // If an object that calls LinedefExecute has a nonzero parameter value, this times the parameter will be subtracted. (Mostly for the purpose of coexisting bosses...)
Alam Ed Arias committed
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
};

// Name of local directory for config files and savegames
#if (((defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON)) && !defined (__CYGWIN__)) && !defined (__APPLE__)
#define DEFAULTDIR ".srb2"
#else
#define DEFAULTDIR "srb2"
#endif

#include "g_state.h"

// commonly used routines - moved here for include convenience

/**	\brief	The I_Error function

	\param	error	the error message

	\return	void


*/
void I_Error(const char *error, ...) FUNCIERROR;

/**	\brief	write a message to stderr (use before I_Quit) for when you need to quit with a msg, but need
 the return code 0 of I_Quit();

	\param	error	message string

	\return	void
*/
void I_OutputMsg(const char *error, ...) FUNCPRINTF;

// console.h
typedef enum
{
	CONS_NOTICE,
	CONS_WARNING,
	CONS_ERROR
} alerttype_t;

void CONS_Printf(const char *fmt, ...) FUNCPRINTF;
void CONS_Alert(alerttype_t level, const char *fmt, ...) FUNCDEBUG;
void CONS_Debug(INT32 debugflags, const char *fmt, ...) FUNCDEBUG;

// For help debugging functions.
#define POTENTIALLYUNUSED CONS_Alert(CONS_WARNING, "(%s:%d) Unused code appears to be used.\n", __FILE__, __LINE__)

#include "m_swap.h"

// Things that used to be in dstrings.h
#define SAVEGAMENAME "srb2sav"
481
extern char savegamename[256];
482
extern char liveeventbackup[256];
Alam Ed Arias committed
483 484 485 486 487 488 489 490 491

// m_misc.h
#ifdef GETTEXT
#define M_GetText(String) gettext(String)
#else
// If no translations are to be used, make a stub
// M_GetText function that just returns the string.
#define M_GetText(x) (x)
#endif
492
void M_StartupLocale(void);
Alam Ed Arias committed
493 494 495
extern void *(*M_Memcpy)(void* dest, const void* src, size_t n) FUNCNONNULL;
char *va(const char *format, ...) FUNCPRINTF;
char *M_GetToken(const char *inputString);
496
void M_UnGetToken(void);
497 498
UINT32 M_GetTokenPos(void);
void M_SetTokenPos(UINT32 newPos);
Alam Ed Arias committed
499 500 501 502 503 504 505 506 507 508 509 510 511
char *sizeu1(size_t num);
char *sizeu2(size_t num);
char *sizeu3(size_t num);
char *sizeu4(size_t num);
char *sizeu5(size_t num);

// d_main.c
extern boolean devparm; // development mode (-debug)
// d_netcmd.c
extern INT32 cv_debug;

#define DBG_BASIC       0x0001
#define DBG_DETAILED    0x0002
512
#define DBG_PLAYER      0x0004
Alam Ed Arias committed
513 514 515 516 517 518 519 520 521
#define DBG_RENDER      0x0008
#define DBG_NIGHTSBASIC 0x0010
#define DBG_NIGHTS      0x0020
#define DBG_POLYOBJ     0x0040
#define DBG_GAMELOGIC   0x0080
#define DBG_NETPLAY     0x0100
#define DBG_MEMORY      0x0200
#define DBG_SETUP       0x0400
#define DBG_LUA         0x0800
522
#define DBG_RANDOMIZER  0x1000
523
#define DBG_VIEWMORPH   0x2000
Alam Ed Arias committed
524 525 526 527 528

// =======================
// Misc stuff for later...
// =======================

I  
Jaime Ita Passos committed
529 530
#define ANG2RAD(angle) ((float)((angle)*M_PI)/ANGLE_180)

531 532
// Modifier key variables, accessible anywhere
extern UINT8 shiftdown, ctrldown, altdown;
Latapostrophe committed
533
extern boolean capslock;
534

Alam Ed Arias committed
535 536
// if we ever make our alloc stuff...
#define ZZ_Alloc(x) Z_Malloc(x, PU_STATIC, NULL)
James R. committed
537
#define ZZ_Calloc(x) Z_Calloc(x, PU_STATIC, NULL)
Alam Ed Arias committed
538 539 540 541 542 543 544 545 546 547 548

// i_system.c, replace getchar() once the keyboard has been appropriated
INT32 I_GetKey(void);

#ifndef min // Double-Check with WATTCP-32's cdefs.h
#define min(x, y) (((x) < (y)) ? (x) : (y))
#endif
#ifndef max // Double-Check with WATTCP-32's cdefs.h
#define max(x, y) (((x) > (y)) ? (x) : (y))
#endif

SteelT committed
549 550 551
// Max gamepad/joysticks that can be detected/used.
#define MAX_JOYSTICKS 4

James R. committed
552 553 554 555
#ifndef M_PIl
#define M_PIl 3.1415926535897932384626433832795029L
#endif

556
// Floating point comparison epsilons from float.h
557
#ifndef FLT_EPSILON
558
#define FLT_EPSILON 1.1920928955078125e-7f
559 560 561
#endif

#ifndef DBL_EPSILON
James R. committed
562
#define DBL_EPSILON 2.2204460492503131e-16l
563
#endif
564

Alam Ed Arias committed
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579
// An assert-type mechanism.
#ifdef PARANOIA
#define I_Assert(e) ((e) ? (void)0 : I_Error("assert failed: %s, file %s, line %d", #e, __FILE__, __LINE__))
#else
#define I_Assert(e) ((void)0)
#endif

// The character that separates pathnames. Forward slash on
// most systems, but reverse solidus (\) on Windows and DOS.
#if defined (PC_DOS) || defined (_WIN32)
	#define PATHSEP "\\"
#else
	#define PATHSEP "/"
#endif

580 581
#define PUNCTUATION "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"

Alam Ed Arias committed
582
// Compile date and time and revision.
583
extern const char *compdate, *comptime, *comprevision, *compbranch;
Alam Ed Arias committed
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610

// Disabled code and code under testing
// None of these that are disabled in the normal build are guaranteed to work perfectly
// Compile them at your own risk!

///	Allows the use of devmode in multiplayer. AKA "fishcake"
//#define NETGAME_DEVMODE

///	Allows gravity changes in netgames, no questions asked.
//#define NETGAME_GRAVITY

///	Dumps the contents of a network save game upon consistency failure for debugging.
//#define DUMPCONSISTENCY

///	See name of player in your crosshair
#define SEENAMES

///	Who put weights on my recycler?  ... Inuyasha did.
///	\note	XMOD port.
//#define WEIGHTEDRECYCLER

///	Allow loading of savegames between different versions of the game.
///	\note	XMOD port.
///	    	Most modifications should probably enable this.
//#define SAVEGAME_OTHERVERSIONS

///	Shuffle's incomplete OpenGL sorting code.
Sryder committed
611
#define SHUFFLE // This has nothing to do with sorting, why was it disabled?
Alam Ed Arias committed
612 613 614 615 616 617 618 619

///	Allow the use of the SOC RESETINFO command.
///	\note	Builds that are tight on memory should disable this.
///	    	This stops the game from storing backups of the states, sprites, and mobjinfo tables.
///	    	Though this info is compressed under normal circumstances, it's still a lot of extra
///	    	memory that never gets touched.
#define ALLOW_RESETDATA

Alam Ed Arias committed
620 621 622
/// Experimental tweaks to analog mode. (Needs a lot of work before it's ready for primetime.)
//#define REDSANALOG

Inuyasha committed
623 624 625 626
/// Backwards compatibility with musicslots.
/// \note	You should leave this enabled unless you're working with a future SRB2 version.
#define MUSICSLOT_COMPATIBILITY

627
/// Experimental attempts at preventing MF_PAPERCOLLISION objects from getting stuck in walls.
628 629
//#define PAPER_COLLISIONCORRECTION

630 631 632 633 634
/// FINALLY some real clipping that doesn't make walls dissappear AND speeds the game up
/// (that was the original comment from SRB2CB, sadly it is a lie and actually slows game down)
/// on the bright side it fixes some weird issues with translucent walls
/// \note	SRB2CB port.
///      	SRB2CB itself ported this from PrBoom+
635
#define NEWCLIP
636

637
/// OpenGL shaders
638 639
#define GL_SHADERS

640 641
/// Handle touching sector specials in P_PlayerAfterThink instead of P_PlayerThink.
/// \note   Required for proper collision with moving sloped surfaces that have sector specials on them.
642
#define SECTORSPECIALSAFTERTHINK
643

644 645
/// Cache patches in Lua in a way that renderer switching will work flawlessly.
//#define LUA_PATCH_SAFETY
Jaime Ita Passos committed
646

I  
Jaime Ita Passos committed
647 648
/// Sprite rotation
#define ROTSPRITE
649
#define ROTANGLES 72 // Needs to be a divisor of 360 (45, 60, 90, 120...)
I  
Jaime Ita Passos committed
650 651
#define ROTANGDIFF (360 / ROTANGLES)

652
/// PNG support
Jaime Ita Passos committed
653 654 655
#ifndef HAVE_PNG
#define NO_PNG_LUMPS
#endif
Jaime Ita Passos committed
656

657 658 659
/// Render flats on walls
#define WALLFLATS

660 661 662
/// Maintain compatibility with older 2.2 demos
#define OLD22DEMOCOMPAT

Alam Ed Arias committed
663
#endif // __DOOMDEF__