ref: aeb39efc47911c8f992e75838b47198621ba8398
parent: 119a847191fdec2ed1118c5cac0a653e20259aa5
author: Konstantinn Bonnet <qu7uux@gmail.com>
date: Sun Jan 25 19:36:07 EST 2015
remove #if, #elif, #else; remove some cpp stuff
--- a/cl_main.c
+++ b/cl_main.c
@@ -257,7 +257,7 @@
*/
void SetPal (int i)
{
-#if 0
+/*
static int old;
byte pal[768];
int c;
@@ -288,7 +288,7 @@
}
VID_SetPalette (pal);
}
-#endif
+*/
}
/*
--- a/cl_parse.c
+++ b/cl_parse.c
@@ -865,19 +865,9 @@
cl.paused = MSG_ReadByte ();
if (cl.paused)
- {
CDAudio_Pause ();
-#ifdef _WIN32
- VID_HandlePause (true);
-#endif
- }
else
- {
CDAudio_Resume ();
-#ifdef _WIN32
- VID_HandlePause (false);
-#endif
- }
}
break;
--- a/common.c
+++ b/common.c
@@ -1006,9 +1006,6 @@
if (h == -1)
{
-#if WINDED
- Sys_Error ("This dedicated server requires a full registered copy of Quake");
-#endif
Con_Printf ("Playing shareware version.\n");
if (com_modified)
Sys_Error ("You must have the registered version to use modified games");
@@ -1415,14 +1412,7 @@
strcpy (cachepath, netpath);
else
{
-#if defined(_WIN32)
- if ((strlen(netpath) < 2) || (netpath[1] != ':'))
- sprintf (cachepath,"%s%s", com_cachedir, netpath);
- else
- sprintf (cachepath,"%s%s", com_cachedir, netpath+2);
-#else
sprintf (cachepath,"%s%s", com_cachedir, netpath);
-#endif
cachetime = Sys_FileTime (cachepath);
--- a/common.h
+++ b/common.h
@@ -1,6 +1,6 @@
// comndef.h -- general definitions
-#if !defined BYTE_DEFINED
+#ifndef BYTE_DEFINED
typedef unsigned char byte;
#define BYTE_DEFINED 1
#endif
--- a/console.c
+++ b/console.c
@@ -1,9 +1,4 @@
-#ifdef NeXT
-#include <libc.h>
-#endif
-#ifndef _MSC_VER
//#include <unistd.h>
-#endif
//#include <fcntl.h>
#include <u.h>
#include <libc.h>
--- a/d_draw.s
+++ b/d_draw.s
@@ -8,7 +8,7 @@
#include "asm_draw.h"
#include "d_ifacea.h"
-#if id386
+#ifdef id386
//----------------------------------------------------------------------
// 8-bpp horizontal span drawing code for polygons, with no transparency.
--- a/d_draw16.s
+++ b/d_draw16.s
@@ -9,7 +9,7 @@
#include "asm_draw.h"
#include "d_ifacea.h"
-#if id386
+#ifdef id386
//----------------------------------------------------------------------
// 8-bpp horizontal span drawing code for polygons, with no transparency and
--- a/d_init.c
+++ b/d_init.c
@@ -128,12 +128,13 @@
for (i=0 ; i<(NUM_MIPS-1) ; i++)
d_scalemip[i] = basemip[i] * d_mipscale.value;
-#if id386
+#ifdef id386
if (d_subdiv16.value)
d_drawspans = D_DrawSpans16;
else
d_drawspans = D_DrawSpans8;
-#else
+#endif
+#ifndef id386
d_drawspans = D_DrawSpans8;
#endif
--- a/d_local.h
+++ b/d_local.h
@@ -66,7 +66,7 @@
extern int D_MipLevelForScale (float scale);
-#if id386
+#ifdef id386
extern void D_PolysetAff8Start (void);
extern void D_PolysetAff8End (void);
#endif
--- a/d_modech.c
+++ b/d_modech.c
@@ -19,7 +19,7 @@
*/
void D_Patch (void)
{
-#if id386
+#ifdef id386
static qboolean protectset8 = false;
--- a/d_part.c
+++ b/d_part.c
@@ -28,7 +28,7 @@
}
-#if !id386
+#ifndef id386
/*
==============
--- a/d_parta.s
+++ b/d_parta.s
@@ -8,7 +8,7 @@
#include "d_ifacea.h"
#include "asm_draw.h"
-#if id386
+#ifdef id386
//----------------------------------------------------------------------
// 8-bpp particle drawing code.
--- a/d_polysa.s
+++ b/d_polysa.s
@@ -8,7 +8,7 @@
#include "asm_draw.h"
#include "d_ifacea.h"
-#if id386
+#ifdef id386
// !!! if this is changed, it must be changed in d_polyse.c too !!!
#define DPS_MAXSPANS MAXHEIGHT+1
@@ -35,10 +35,8 @@
.text
-#ifndef NeXT
.extern C(D_PolysetSetEdgeTable)
.extern C(D_RasterizeAliasPolySmooth)
-#endif
//----------------------------------------------------------------------
// affine triangle gradient calculation code
--- a/d_polyse.c
+++ b/d_polyse.c
@@ -98,7 +98,7 @@
void D_RasterizeAliasPolySmooth (void);
void D_PolysetScanLeftEdge (int height);
-#if !id386
+#ifndef id386
/*
================
@@ -394,7 +394,7 @@
}
-#if !id386
+#ifndef id386
/*
===================
@@ -504,7 +504,7 @@
}
-#if !id386
+#ifndef id386
/*
================
@@ -556,10 +556,11 @@
r_zistepy = (int)((t1 * p00_minus_p20 - t0 * p10_minus_p20) *
ystepdenominv);
-#if id386
+#ifdef id386
a_sstepxfrac = r_sstepx << 16;
a_tstepxfrac = r_tstepx << 16;
-#else
+#endif
+#ifndef id386
a_sstepxfrac = r_sstepx & 0xFFFF;
a_tstepxfrac = r_tstepx & 0xFFFF;
#endif
@@ -570,7 +571,7 @@
#endif // !id386
-#if 0
+/*
byte gelmap[256];
void InitGel (byte *palette)
{
@@ -581,13 +582,13 @@
{
// r = (palette[i*3]>>4);
r = (palette[i*3] + palette[i*3+1] + palette[i*3+2])/(16*3);
- gelmap[i] = /* 64 */ 0 + r;
+ gelmap[i] = 0 + r; // 64
}
}
-#endif
+*/
-#if !id386
+#ifndef id386
/*
================
@@ -737,10 +738,11 @@
d_ptex = (byte *)r_affinetridesc.pskin + (plefttop[2] >> 16) +
(plefttop[3] >> 16) * r_affinetridesc.skinwidth;
-#if id386
+#ifdef id386
d_sfrac = (plefttop[2] & 0xFFFF) << 16;
d_tfrac = (plefttop[3] & 0xFFFF) << 16;
-#else
+#endif
+#ifndef id386
d_sfrac = plefttop[2] & 0xFFFF;
d_tfrac = plefttop[3] & 0xFFFF;
#endif
@@ -772,10 +774,11 @@
D_PolysetSetUpForLineScan(plefttop[0], plefttop[1],
pleftbottom[0], pleftbottom[1]);
- #if id386
+ #ifdef id386
d_pzbasestep = (d_zwidth + ubasestep) << 1;
d_pzextrastep = d_pzbasestep + 2;
- #else
+ #endif
+ #ifndef id386
d_pzbasestep = d_zwidth + ubasestep;
d_pzextrastep = d_pzbasestep + 1;
#endif
@@ -797,10 +800,11 @@
d_ptexbasestep = ((r_sstepy + r_sstepx * ubasestep) >> 16) +
((r_tstepy + r_tstepx * ubasestep) >> 16) *
r_affinetridesc.skinwidth;
- #if id386
+ #ifdef id386
d_sfracbasestep = (r_sstepy + r_sstepx * ubasestep) << 16;
d_tfracbasestep = (r_tstepy + r_tstepx * ubasestep) << 16;
- #else
+ #endif
+ #ifndef id386
d_sfracbasestep = (r_sstepy + r_sstepx * ubasestep) & 0xFFFF;
d_tfracbasestep = (r_tstepy + r_tstepx * ubasestep) & 0xFFFF;
#endif
@@ -810,10 +814,11 @@
d_ptexextrastep = ((r_sstepy + r_sstepx * d_countextrastep) >> 16) +
((r_tstepy + r_tstepx * d_countextrastep) >> 16) *
r_affinetridesc.skinwidth;
- #if id386
+ #ifdef id386
d_sfracextrastep = (r_sstepy + r_sstepx*d_countextrastep) << 16;
d_tfracextrastep = (r_tstepy + r_tstepx*d_countextrastep) << 16;
- #else
+ #endif
+ #ifndef id386
d_sfracextrastep = (r_sstepy + r_sstepx*d_countextrastep) & 0xFFFF;
d_tfracextrastep = (r_tstepy + r_tstepx*d_countextrastep) & 0xFFFF;
#endif
@@ -873,10 +878,11 @@
d_pdestbasestep = screenwidth + ubasestep;
d_pdestextrastep = d_pdestbasestep + 1;
- #if id386
+ #ifdef id386
d_pzbasestep = (d_zwidth + ubasestep) << 1;
d_pzextrastep = d_pzbasestep + 2;
- #else
+ #endif
+ #ifndef id386
d_pzbasestep = d_zwidth + ubasestep;
d_pzextrastep = d_pzbasestep + 1;
#endif
@@ -890,10 +896,11 @@
d_ptexbasestep = ((r_sstepy + r_sstepx * ubasestep) >> 16) +
((r_tstepy + r_tstepx * ubasestep) >> 16) *
r_affinetridesc.skinwidth;
- #if id386
+ #ifdef id386
d_sfracbasestep = (r_sstepy + r_sstepx * ubasestep) << 16;
d_tfracbasestep = (r_tstepy + r_tstepx * ubasestep) << 16;
- #else
+ #endif
+ #ifndef id386
d_sfracbasestep = (r_sstepy + r_sstepx * ubasestep) & 0xFFFF;
d_tfracbasestep = (r_tstepy + r_tstepx * ubasestep) & 0xFFFF;
#endif
@@ -903,10 +910,11 @@
d_ptexextrastep = ((r_sstepy + r_sstepx * d_countextrastep) >> 16) +
((r_tstepy + r_tstepx * d_countextrastep) >> 16) *
r_affinetridesc.skinwidth;
- #if id386
+ #ifdef id386
d_sfracextrastep = ((r_sstepy+r_sstepx*d_countextrastep) & 0xFFFF)<<16;
d_tfracextrastep = ((r_tstepy+r_tstepx*d_countextrastep) & 0xFFFF)<<16;
- #else
+ #endif
+ #ifndef id386
d_sfracextrastep = (r_sstepy+r_sstepx*d_countextrastep) & 0xFFFF;
d_tfracextrastep = (r_tstepy+r_tstepx*d_countextrastep) & 0xFFFF;
#endif
@@ -1018,8 +1026,7 @@
}
-#if 0
-
+/*
void D_PolysetRecursiveDrawLine (int *lp1, int *lp2)
{
int d;
@@ -1089,6 +1096,4 @@
D_PolysetRecursiveTriangle (lp1, new, lp3);
D_PolysetRecursiveTriangle (new, lp2, lp3);
}
-
-#endif
-
+*/
--- a/d_scan.c
+++ b/d_scan.c
@@ -73,7 +73,7 @@
}
-#if !id386
+#ifndef id386
/*
=============
@@ -230,7 +230,7 @@
}
-#if !id386
+#ifndef id386
/*
=============
@@ -368,7 +368,7 @@
#endif
-#if !id386
+#ifndef id386
/*
=============
--- a/d_scana.s
+++ b/d_scana.s
@@ -8,7 +8,7 @@
#include "asm_draw.h"
#include "d_ifacea.h"
-#if id386
+#ifdef id386
.data
--- a/d_spr8.s
+++ b/d_spr8.s
@@ -7,7 +7,7 @@
#include "quakeasm.h"
#include "asm_draw.h"
-#if id386
+#ifdef id386
//----------------------------------------------------------------------
// 8-bpp horizontal span drawing code for polygons, with transparency.
--- a/d_sprite.c
+++ b/d_sprite.c
@@ -10,7 +10,7 @@
static int minindex, maxindex;
static sspan_t *sprite_spans;
-#if !id386
+#ifndef id386
/*
=====================
--- a/d_vars.c
+++ b/d_vars.c
@@ -1,6 +1,6 @@
// r_vars.c: global refresh variables
-#if !id386
+#ifndef id386
#include <u.h>
#include <libc.h>
--- a/d_varsa.s
+++ b/d_varsa.s
@@ -7,7 +7,7 @@
#include "asm_draw.h"
#include "d_ifacea.h"
-#if id386
+#ifdef id386
.data
@@ -101,7 +101,6 @@
.long 0x10000000, 0xe38e38e, 0xccccccc, 0xba2e8ba
.long 0xaaaaaaa, 0x9d89d89, 0x9249249, 0x8888888
-#ifndef NeXT
.extern Entry2_16
.extern Entry3_16
.extern Entry4_16
@@ -117,7 +116,6 @@
.extern Entry14_16
.extern Entry15_16
.extern Entry16_16
-#endif
entryvec_table_16: .long 0, Entry2_16, Entry3_16, Entry4_16
.long Entry5_16, Entry6_16, Entry7_16, Entry8_16
@@ -136,12 +134,10 @@
DP_Pix: .long 0
-#ifndef NeXT
.extern DP_1x1
.extern DP_2x2
.extern DP_3x3
.extern DP_4x4
-#endif
DP_EntryTable: .long DP_1x1, DP_2x2, DP_3x3, DP_4x4
@@ -163,7 +159,6 @@
reciprocal_table: .long 0x40000000, 0x2aaaaaaa, 0x20000000
.long 0x19999999, 0x15555555, 0x12492492
-#ifndef NeXT
.extern Entry2_8
.extern Entry3_8
.extern Entry4_8
@@ -171,12 +166,10 @@
.extern Entry6_8
.extern Entry7_8
.extern Entry8_8
-#endif
entryvec_table: .long 0, Entry2_8, Entry3_8, Entry4_8
.long Entry5_8, Entry6_8, Entry7_8, Entry8_8
-#ifndef NeXT
.extern Spr8Entry2_8
.extern Spr8Entry3_8
.extern Spr8Entry4_8
@@ -184,7 +177,6 @@
.extern Spr8Entry6_8
.extern Spr8Entry7_8
.extern Spr8Entry8_8
-#endif
.globl spr8entryvec_table
spr8entryvec_table: .long 0, Spr8Entry2_8, Spr8Entry3_8, Spr8Entry4_8
--- a/draw.c
+++ b/draw.c
@@ -530,19 +530,20 @@
conback = Draw_CachePic ("gfx/conback.lmp");
// hack the version number directly into the pic
-#ifdef _WIN32
- sprintf (ver, "(WinQuake) %4.2f", (float)VERSION);
- dest = conback->data + 320*186 + 320 - 11 - 8*strlen(ver);
-#elif defined(X11)
+#ifdef X11
sprintf (ver, "(X11 Quake %2.2f) %4.2f", (float)X11_VERSION, (float)VERSION);
dest = conback->data + 320*186 + 320 - 11 - 8*strlen(ver);
-#elif defined(__linux__)
+#endif
+/*
+#ifdef __linux__
sprintf (ver, "(Linux Quake %2.2f) %4.2f", (float)LINUX_VERSION, (float)VERSION);
dest = conback->data + 320*186 + 320 - 11 - 8*strlen(ver);
-#else
+#endif
+#ifndef __linux__
dest = conback->data + 320 - 43 + 320*186;
sprintf (ver, "%4.2f", VERSION);
#endif
+*/
for (x=0 ; x<strlen(ver) ; x++)
Draw_CharToConback (ver[x], dest+(x<<3));
--- a/host.c
+++ b/host.c
@@ -865,32 +865,16 @@
if (!host_colormap)
Sys_Error ("Couldn't load gfx/colormap.lmp");
-#ifndef _WIN32 // on non win32, mouse comes before video for security reasons
IN_Init ();
-#endif
VID_Init (host_basepal);
Draw_Init ();
SCR_Init ();
R_Init ();
-#ifndef _WIN32
- // on Win32, sound initialization has to come before video initialization, so we
- // can put up a popup if the sound hardware is in use
S_Init ();
-#else
-
-#ifdef GLQUAKE
- // FIXME: doesn't use the new one-window approach yet
- S_Init ();
-#endif
-
-#endif // _WIN32
CDAudio_Init ();
Sbar_Init ();
CL_Init ();
-#ifdef _WIN32 // on non win32, mouse comes before video for security reasons
- IN_Init ();
-#endif
}
Cbuf_InsertText ("exec quake.rc\n");
--- a/math.s
+++ b/math.s
@@ -7,7 +7,7 @@
#include "quakeasm.h"
-#if id386
+#ifdef id386
.data
--- a/mathlib.c
+++ b/mathlib.c
@@ -68,11 +68,6 @@
VectorNormalize( dst );
}
-#ifdef _WIN32
-#pragma optimize( "", off )
-#endif
-
-
void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, float degrees )
{
float m[3][3];
@@ -128,21 +123,16 @@
}
}
-#ifdef _WIN32
-#pragma optimize( "", on )
-#endif
-
/*-----------------------------------------------------------------*/
-
float anglemod(float a)
{
-#if 0
+ /*
if (a >= 0)
a -= 360*(int)(a/360);
else
a += 360*( 1 + (int)(-a/360) );
-#endif
+ */
a = (360.0/65536) * ((int)(a*(65536/360.0)) & 65535);
return a;
}
@@ -160,7 +150,7 @@
}
-#if !id386
+#ifndef id386
/*
==================
@@ -174,8 +164,8 @@
float dist1, dist2;
int sides;
-#if 0 // this is done by the BOX_ON_PLANE_SIDE macro before calling this
- // function
+/*
+ // this is done by the BOX_ON_PLANE_SIDE macro before calling this function
// fast axial cases
if (p->type < 3)
{
@@ -185,7 +175,7 @@
return 2;
return 3;
}
-#endif
+*/
// general case
switch (p->signbits)
@@ -228,7 +218,7 @@
break;
}
-#if 0
+/*
int i;
vec3_t corners[2];
@@ -253,7 +243,7 @@
if (dist2 < 0)
sides |= 2;
-#endif
+*/
sides = 0;
if (dist1 >= p->dist)
@@ -269,7 +259,7 @@
return sides;
}
-#endif
+#endif // !id386
void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
@@ -544,7 +534,7 @@
}
-#if !id386
+#ifndef id386
// TODO: move to nonintel.c
@@ -565,4 +555,4 @@
(((double)0x10000 * (double)0x1000000 / (double)val) + 0.5);
}
-#endif
+#endif // !id386
--- a/menu.c
+++ b/menu.c
@@ -2,10 +2,6 @@
#include <libc.h>
#include "quakedef.h"
-#ifdef _WIN32
-#include "winquake.h"
-#endif
-
void (*vid_menudrawfn)(void);
void (*vid_menukeyfn)(int key);
@@ -891,17 +887,9 @@
f = 32;
if (serialAvailable)
- {
p = Draw_CachePic ("gfx/netmen1.lmp");
- }
else
- {
-#ifdef _WIN32
- p = NULL;
-#else
p = Draw_CachePic ("gfx/dim_modm.lmp");
-#endif
- }
if (p)
M_DrawTransPic (72, f, p);
@@ -909,17 +897,9 @@
f += 19;
if (serialAvailable)
- {
p = Draw_CachePic ("gfx/netmen2.lmp");
- }
else
- {
-#ifdef _WIN32
- p = NULL;
-#else
p = Draw_CachePic ("gfx/dim_drct.lmp");
-#endif
- }
if (p)
M_DrawTransPic (72, f, p);
@@ -1019,11 +999,7 @@
//=============================================================================
/* OPTIONS MENU */
-#ifdef _WIN32
-#define OPTIONS_ITEMS 14
-#else
#define OPTIONS_ITEMS 13
-#endif
#define SLIDER_RANGE 10
@@ -1034,13 +1010,6 @@
key_dest = key_menu;
m_state = m_options;
m_entersound = true;
-
-#ifdef _WIN32
- if ((options_cursor == 13) && (modestate != MS_WINDOWED))
- {
- options_cursor = 0;
- }
-#endif
}
@@ -1075,11 +1044,7 @@
Cvar_SetValue ("sensitivity", sensitivity.value);
break;
case 6: // music volume
-#ifdef _WIN32
- bgmvolume.value += dir * 1.0;
-#else
bgmvolume.value += dir * 0.1;
-#endif
if (bgmvolume.value < 0)
bgmvolume.value = 0;
if (bgmvolume.value > 1)
@@ -1119,12 +1084,6 @@
case 11: // lookstrafe
Cvar_SetValue ("lookstrafe", !lookstrafe.value);
break;
-
-#ifdef _WIN32
- case 13: // _windowed_mouse
- Cvar_SetValue ("_windowed_mouse", !_windowed_mouse.value);
- break;
-#endif
}
}
@@ -1146,12 +1105,12 @@
void M_DrawCheckbox (int x, int y, int on)
{
-#if 0
+ /*
if (on)
M_DrawCharacter (x, y, 131);
else
M_DrawCharacter (x, y, 129);
-#endif
+ */
if (on)
M_Print (x, y, "on");
else
@@ -1206,14 +1165,6 @@
if (vid_menudrawfn)
M_Print (16, 128, " Video Options");
-#ifdef _WIN32
- if (modestate == MS_WINDOWED)
- {
- M_Print (16, 136, " Use Mouse");
- M_DrawCheckbox (220, 136, _windowed_mouse.value);
- }
-#endif
-
// cursor
M_DrawCharacter (200, 32 + options_cursor*8, 12+((int)(realtime*4)&1));
}
@@ -1280,16 +1231,6 @@
else
options_cursor = 0;
}
-
-#ifdef _WIN32
- if ((options_cursor == 13) && (modestate != MS_WINDOWED))
- {
- if (k == K_UPARROW)
- options_cursor = 12;
- else
- options_cursor = 0;
- }
-#endif
}
//=============================================================================
@@ -1563,7 +1504,6 @@
int m_quit_prevstate;
qboolean wasInMenus;
-#ifndef _WIN32
char *quitMessage [] =
{
/* .........1.........2.... */
@@ -1607,7 +1547,6 @@
" for you next time! ",
" "
};
-#endif
void M_Menu_Quit_f (void)
{
@@ -1663,37 +1602,11 @@
M_Draw ();
m_state = m_quit;
}
-
-#ifdef _WIN32
- M_DrawTextBox (0, 0, 38, 23);
- M_PrintWhite (16, 12, " Quake version 1.09 by id Software\n\n");
- M_PrintWhite (16, 28, "Programming Art \n");
- M_Print (16, 36, " John Carmack Adrian Carmack\n");
- M_Print (16, 44, " Michael Abrash Kevin Cloud\n");
- M_Print (16, 52, " John Cash Paul Steed\n");
- M_Print (16, 60, " Dave 'Zoid' Kirsch\n");
- M_PrintWhite (16, 68, "Design Biz\n");
- M_Print (16, 76, " John Romero Jay Wilbur\n");
- M_Print (16, 84, " Sandy Petersen Mike Wilson\n");
- M_Print (16, 92, " American McGee Donna Jackson\n");
- M_Print (16, 100, " Tim Willits Todd Hollenshead\n");
- M_PrintWhite (16, 108, "Support Projects\n");
- M_Print (16, 116, " Barrett Alexander Shawn Green\n");
- M_PrintWhite (16, 124, "Sound Effects\n");
- M_Print (16, 132, " Trent Reznor and Nine Inch Nails\n\n");
- M_PrintWhite (16, 140, "Quake is a trademark of Id Software,\n");
- M_PrintWhite (16, 148, "inc., (c)1996 Id Software, inc. All\n");
- M_PrintWhite (16, 156, "rights reserved. NIN logo is a\n");
- M_PrintWhite (16, 164, "registered trademark licensed to\n");
- M_PrintWhite (16, 172, "Nothing Interactive, Inc. All rights\n");
- M_PrintWhite (16, 180, "reserved. Press y to exit\n");
-#else
M_DrawTextBox (56, 76, 24, 4);
M_Print (64, 84, quitMessage[msgNumber*4+0]);
M_Print (64, 92, quitMessage[msgNumber*4+1]);
M_Print (64, 100, quitMessage[msgNumber*4+2]);
M_Print (64, 108, quitMessage[msgNumber*4+3]);
-#endif
}
//=============================================================================
--- a/model.c
+++ b/model.c
@@ -658,12 +658,12 @@
out->mipadjust = 2;
else
out->mipadjust = 1;
-#if 0
+ /*
if (len1 + len2 < 0.001)
out->mipadjust = 1; // don't crash
else
out->mipadjust = 1 / floor( (len1+len2)/2 + 0.1 );
-#endif
+ */
miptex = LittleLong (in->miptex);
out->flags = LittleLong (in->flags);
--- a/net.h
+++ b/net.h
@@ -219,7 +219,7 @@
extern int hostCacheCount;
extern hostcache_t hostcache[HOSTCACHESIZE];
-#if !defined(_WIN32 ) && !defined (__linux__) && !defined (__sun__)
+#ifndef __linux__
#ifndef htonl
extern u32int htonl (u32int hostlong);
#endif
--- a/net_dgrm.c
+++ b/net_dgrm.c
@@ -4,12 +4,6 @@
#define BAN_TEST
#ifdef BAN_TEST
-#if defined(_WIN32)
-#include <windows.h>
-#elif defined (NeXT)
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#else
#include <u.h>
#include <libc.h>
#define AF_INET 2 /* internet */
@@ -32,7 +26,6 @@
};
char *inet_ntoa(struct in_addr in);
u32int inet_addr(const char *cp);
-#endif
#endif // BAN_TEST
#include "quakedef.h"
--- a/net_udp.c
+++ b/net_udp.c
@@ -19,14 +19,6 @@
#include <sys/ioctl.h>
#include <errno.h>
-#ifdef __sun__
-#include <sys/filio.h>
-#endif
-
-#ifdef NeXT
-#include <libc.h>
-#endif
-
extern int gethostname (char *, int);
extern int close (int);
--- a/nonintel.c
+++ b/nonintel.c
@@ -8,7 +8,7 @@
#include "r_local.h"
#include "d_local.h"
-#if !id386
+#ifndef id386
/*
================
--- a/quakeasm.h
+++ b/quakeasm.h
@@ -4,24 +4,13 @@
//#define GLQUAKE 1
-#if defined(_WIN32) && !defined(WINDED)
-
-#if defined(_M_IX86)
-#define __i386__ 1
-#endif
-
-#endif
-
#ifdef __i386__
-#define id386 1
-#else
-#define id386 0
+#define id386
#endif
// !!! must be kept the same as in d_iface.h !!!
#define TRANSPARENT_COLOR 255
-#ifndef NeXT
#ifndef GLQUAKE
.extern C(d_zistepu)
.extern C(d_pzbuffer)
@@ -257,5 +246,3 @@
.extern C(vup)
.extern C(vpn)
.extern C(BOPS_Error)
-
-#endif
--- a/quakedef.h
+++ b/quakedef.h
@@ -11,13 +11,8 @@
#define LINUX_VERSION 1.30
#define X11_VERSION 1.10
-//define PARANOID // speed sapping error checking
-
-#ifdef QUAKE2
+#define PARANOID // speed sapping error checking
#define GAMENAME "id1" // directory to look in by default
-#else
-#define GAMENAME "id1"
-#endif
#include <stdio.h>
//#include <math.h>
@@ -26,34 +21,17 @@
//#include <stdlib.h>
//#include <setjmp.h>
-#if defined(_WIN32) && !defined(WINDED)
-
-#if defined(_M_IX86)
-#define __i386__ 1
-#endif
-
-void VID_LockBuffer (void);
-void VID_UnlockBuffer (void);
-
-#else
-
#define VID_LockBuffer()
#define VID_UnlockBuffer()
+#ifdef __i386__ // && !defined __sun__
+#define id386
#endif
-#if defined __i386__ // && !defined __sun__
-#define id386 1
-#else
-#define id386 0
+#ifdef id386
+#define UNALIGNED_OK // unset if unaligned accesses are not supported
#endif
-#if id386
-#define UNALIGNED_OK 1 // set to 0 if unaligned accesses are not supported
-#else
-#define UNALIGNED_OK 0
-#endif
-
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
#define CACHE_SIZE 32 // used to align key data structures
@@ -225,7 +203,8 @@
#ifdef GLQUAKE
#include "gl_model.h"
-#else
+#endif
+#ifndef GLQUAKE
#include "model.h"
#include "d_iface.h"
#endif
--- a/r_aclip.c
+++ b/r_aclip.c
@@ -75,7 +75,7 @@
}
-#if !id386
+#ifndef id386
void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
{
@@ -168,7 +168,7 @@
}
}
-#endif
+#endif // !id386
int R_AliasClip (finalvert_t *in, finalvert_t *out, int flag, int count,
--- a/r_aclipa.s
+++ b/r_aclipa.s
@@ -8,7 +8,7 @@
#include "asm_draw.h"
#include "d_ifacea.h"
-#if id386
+#ifdef id386
.data
Ltemp0: .long 0
--- a/r_alias.c
+++ b/r_alias.c
@@ -432,7 +432,7 @@
}
-#if !id386
+#ifndef id386
/*
================
@@ -486,7 +486,7 @@
}
}
-#endif
+#endif //!id386
/*
@@ -716,7 +716,7 @@
}
else
{
-#if id386
+#ifdef id386
D_Aff8Patch (currententity->colormap);
#endif
}
--- a/r_aliasa.s
+++ b/r_aliasa.s
@@ -8,7 +8,7 @@
#include "asm_draw.h"
#include "d_ifacea.h"
-#if id386
+#ifdef id386
.data
--- a/r_draw.c
+++ b/r_draw.c
@@ -50,7 +50,7 @@
qboolean r_lastvertvalid;
-#if !id386
+#ifndef id386
/*
================
--- a/r_drawa.s
+++ b/r_drawa.s
@@ -8,7 +8,7 @@
#include "asm_draw.h"
#include "d_ifacea.h"
-#if id386
+#ifdef id386
// !!! if these are changed, they must be changed in r_draw.c too !!!
#define FULLY_CLIPPED_CACHED 0x80000000
--- a/r_edge.c
+++ b/r_edge.c
@@ -3,8 +3,7 @@
#include "quakedef.h"
#include "r_local.h"
-#if 0
-// FIXME
+/* FIXME
the complex cases add new polys on most lines, so dont optimize for keeping them the same
have multiple free span lists to try to get better coherence?
low depth complexity -- 1 to 3 or so
@@ -12,7 +11,7 @@
this breaks spans at every edge, even hidden ones (bad)
have a sentinal at both ends?
-#endif
+*/
edge_t *auxedges;
@@ -139,7 +138,7 @@
}
-#if !id386
+#ifndef id386
/*
==============
@@ -185,7 +184,7 @@
#endif // !id386
-#if !id386
+#ifndef id386
/*
==============
@@ -205,7 +204,7 @@
#endif // !id386
-#if !id386
+#ifndef id386
/*
==============
@@ -431,7 +430,7 @@
}
-#if !id386
+#ifndef id386
/*
==============
--- a/r_edgea.s
+++ b/r_edgea.s
@@ -7,7 +7,7 @@
#include "quakeasm.h"
#include "asm_draw.h"
-#if id386
+#ifdef id386
.data
Ltemp: .long 0
--- a/r_local.h
+++ b/r_local.h
@@ -121,7 +121,7 @@
void R_DrawSurfaceBlock8 (void);
texture_t *R_TextureAnimation (texture_t *base);
-#if id386
+#ifdef id386
void R_DrawSurfaceBlock8_mip0 (void);
void R_DrawSurfaceBlock8_mip1 (void);
--- a/r_main.c
+++ b/r_main.c
@@ -211,7 +211,7 @@
R_InitParticles ();
// TODO: collect 386-specific code in one place
-#if id386
+#ifdef id386
Sys_MakeCodeWriteable ((uintptr)R_EdgeCodeStart,
(uintptr)R_EdgeCodeEnd - (uintptr)R_EdgeCodeStart);
#endif // id386
@@ -443,7 +443,7 @@
r_fov_greater_than_90 = true;
// TODO: collect 386-specific code in one place
-#if id386
+#ifdef id386
if (r_pixbytes == 1)
{
Sys_MakeCodeWriteable ((uintptr)R_Surf8Start,
--- a/r_misc.c
+++ b/r_misc.c
@@ -273,7 +273,7 @@
}
-#if !id386
+#ifndef id386
/*
================
@@ -287,7 +287,7 @@
out[2] = DotProduct(in,vpn);
}
-#endif
+#endif //!id386
/*
@@ -396,8 +396,7 @@
numbtofpolys = 0;
-// debugging
-#if 0
+/* debugging
r_refdef.vieworg[0]= 80;
r_refdef.vieworg[1]= 64;
r_refdef.vieworg[2]= 40;
@@ -404,7 +403,7 @@
r_refdef.viewangles[0]= 0;
r_refdef.viewangles[1]= 46.763641357;
r_refdef.viewangles[2]= 0;
-#endif
+*/
// build the transformation matrix for the given view angles
VectorCopy (r_refdef.vieworg, modelorg);
--- a/r_sky.c
+++ b/r_sky.c
@@ -99,7 +99,7 @@
baseofs = ((y+yshift) & SKYMASK) * 131;
// FIXME: clean this up
-#if UNALIGNED_OK
+#ifdef UNALIGNED_OK
for (x=0 ; x<SKYSIZE ; x += 4)
{
@@ -113,7 +113,8 @@
pnewsky++;
}
-#else
+#endif /* UNALIGNED_OK */
+#ifndef UNALIGNED_OK
for (x=0 ; x<SKYSIZE ; x++)
{
@@ -125,7 +126,7 @@
pnewsky = (unsigned *)((byte *)pnewsky + 1);
}
-#endif
+#endif /* ! UNALIGNED_OK */
pnewsky += 128 / sizeof (unsigned);
}
@@ -158,7 +159,7 @@
baseofs = ((y+yshift) & SKYMASK) * 131;
// FIXME: clean this up
-#if UNALIGNED_OK
+#ifdef UNALIGNED_OK
for (x=0 ; x<SKYSIZE ; x += 4)
{
@@ -173,7 +174,8 @@
pd++;
}
-#else
+#endif /* UNALIGNED_OK */
+#ifndef UNALIGNED_OK
for (x=0 ; x<SKYSIZE ; x++)
{
@@ -186,7 +188,7 @@
pd = (unsigned *)((byte *)pd + 1);
}
-#endif
+#endif /* ! UNALIGNED_OK */
pnewsky += 128 / sizeof (unsigned);
}
--- a/r_surf.c
+++ b/r_surf.c
@@ -316,7 +316,7 @@
//=============================================================================
-#if !id386
+#ifndef id386
/*
================
@@ -565,7 +565,7 @@
prowdestbase = prowdest;
}
-#endif
+#endif //!id386
//============================================================================
--- a/r_vars.c
+++ b/r_vars.c
@@ -4,7 +4,7 @@
#include <libc.h>
#include "quakedef.h"
-#if !id386
+#ifndef id386
// all global and static refresh variables are collected in a contiguous block
// to avoid cache conflicts.
--- a/r_varsa.s
+++ b/r_varsa.s
@@ -7,7 +7,7 @@
#include "asm_draw.h"
#include "d_ifacea.h"
-#if id386
+#ifdef id386
.data
--- a/sbar.c
+++ b/sbar.c
@@ -472,7 +472,7 @@
Sbar_SoloScoreboard ();
if (cl.gametype == GAME_DEATHMATCH)
Sbar_DeathmatchOverlay ();
-#if 0
+/*
int i, j, c;
int x, y;
int l;
@@ -516,7 +516,7 @@
Sbar_DrawCharacter ( (x+j)*8, y, c);
}
}
-#endif
+*/
}
//=============================================================================
@@ -1116,7 +1116,7 @@
if (k == cl.viewentity - 1)
Draw_Character ( x - 8, y, 12);
-#if 0
+/*
{
int total;
int n, minutes, tens, units;
@@ -1132,7 +1132,7 @@
Draw_String ( x+48 , y, num);
}
-#endif
+*/
// draw name
Draw_String (x+64, y, s->name);
@@ -1218,7 +1218,7 @@
Draw_Character ( x + 32, y, 17);
}
-#if 0
+/*
{
int total;
int n, minutes, tens, units;
@@ -1234,7 +1234,7 @@
Draw_String ( x+48 , y, num);
}
-#endif
+*/
// draw name
Draw_String (x+48, y, s->name);
--- a/snd_dma.c
+++ b/snd_dma.c
@@ -4,10 +4,6 @@
#include <libc.h>
#include "quakedef.h"
-#ifdef _WIN32
-#include "winquake.h"
-#endif
-
void S_Play(void);
void S_PlayVol(void);
void S_SoundList(void);
@@ -130,9 +126,7 @@
if (!rc)
{
-#ifndef _WIN32
Con_Printf("S_Startup: SNDDMA_Init failed.\n");
-#endif
sound_started = 0;
return;
}
@@ -543,11 +537,7 @@
{
int clear;
-#ifdef _WIN32
- if (!sound_started || !shm || (!shm->buffer && !pDSBuf))
-#else
if (!sound_started || !shm || !shm->buffer)
-#endif
return;
if (shm->samplebits == 8)
@@ -555,43 +545,7 @@
else
clear = 0;
-#ifdef _WIN32
- if (pDSBuf)
- {
- DWORD dwSize;
- DWORD *pData;
- int reps;
- HRESULT hresult;
-
- reps = 0;
-
- while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, &pData, &dwSize, NULL, NULL, 0)) != DS_OK)
- {
- if (hresult != DSERR_BUFFERLOST)
- {
- Con_Printf ("S_ClearBuffer: DS::Lock Sound Buffer Failed\n");
- S_Shutdown ();
- return;
- }
-
- if (++reps > 10000)
- {
- Con_Printf ("S_ClearBuffer: DS: couldn't restore buffer\n");
- S_Shutdown ();
- return;
- }
- }
-
- Q_memset(pData, clear, shm->samples * shm->samplebits/8);
-
- pDSBuf->lpVtbl->Unlock(pDSBuf, pData, dwSize, NULL, 0);
-
- }
- else
-#endif
- {
- Q_memset(shm->buffer, clear, shm->samples * shm->samplebits/8);
- }
+ Q_memset(shm->buffer, clear, shm->samples * shm->samplebits/8);
}
@@ -803,7 +757,8 @@
// calls to S_Update. Oh well.
#ifdef __sun__
soundtime = SNDDMA_GetSamples();
-#else
+#endif
+#ifndef __sun__
samplepos = SNDDMA_GetDMAPos();
@@ -827,10 +782,6 @@
void S_ExtraUpdate (void)
{
-#ifdef _WIN32
- IN_Accumulate ();
-#endif
-
if (snd_noextraupdate.value)
return; // don't pollute timings
S_Update_();
@@ -859,25 +810,6 @@
samps = shm->samples >> (shm->channels-1);
if (endtime - soundtime > samps)
endtime = soundtime + samps;
-
-#ifdef _WIN32
-// if the buffer was lost or stopped, restore it and/or restart it
- {
- DWORD dwStatus;
-
- if (pDSBuf)
- {
- if (pDSBuf->lpVtbl->GetStatus (pDSBuf, &dwStatus) != DD_OK)
- Con_Printf ("Couldn't get sound buffer status\n");
-
- if (dwStatus & DSBSTATUS_BUFFERLOST)
- pDSBuf->lpVtbl->Restore (pDSBuf);
-
- if (!(dwStatus & DSBSTATUS_PLAYING))
- pDSBuf->lpVtbl->Play(pDSBuf, 0, 0, DSBPLAY_LOOPING);
- }
- }
-#endif
S_PaintChannels (endtime);
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -4,11 +4,7 @@
#include <libc.h>
#include "quakedef.h"
-#ifdef _WIN32
-#include "winquake.h"
-#else
#define DWORD u32int
-#endif
#define PAINTBUFFER_SIZE 512
portable_samplepair_t paintbuffer[PAINTBUFFER_SIZE];
@@ -18,7 +14,7 @@
void Snd_WriteLinearBlastStereo16 (void);
-#if !id386
+#ifndef id386
void Snd_WriteLinearBlastStereo16 (void)
{
int i;
@@ -43,7 +39,7 @@
snd_out[i+1] = val;
}
}
-#endif
+#endif //!id386
void S_TransferStereo16 (int endtime)
{
@@ -50,12 +46,6 @@
int lpos;
int lpaintedtime;
DWORD *pbuf;
-#ifdef _WIN32
- int reps;
- DWORD dwSize,dwSize2;
- DWORD *pbuf2;
- HRESULT hresult;
-#endif
snd_vol = volume.value*256;
@@ -62,37 +52,8 @@
snd_p = (int *) paintbuffer;
lpaintedtime = paintedtime;
-#ifdef _WIN32
- if (pDSBuf)
- {
- reps = 0;
+ pbuf = (DWORD *)shm->buffer;
- while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, &pbuf, &dwSize,
- &pbuf2, &dwSize2, 0)) != DS_OK)
- {
- if (hresult != DSERR_BUFFERLOST)
- {
- Con_Printf ("S_TransferStereo16: DS::Lock Sound Buffer Failed\n");
- S_Shutdown ();
- S_Startup ();
- return;
- }
-
- if (++reps > 10000)
- {
- Con_Printf ("S_TransferStereo16: DS: couldn't restore buffer\n");
- S_Shutdown ();
- S_Startup ();
- return;
- }
- }
- }
- else
-#endif
- {
- pbuf = (DWORD *)shm->buffer;
- }
-
while (lpaintedtime < endtime)
{
// handle recirculating buffer issues
@@ -112,11 +73,6 @@
snd_p += snd_linear_count;
lpaintedtime += (snd_linear_count>>1);
}
-
-#ifdef _WIN32
- if (pDSBuf)
- pDSBuf->lpVtbl->Unlock(pDSBuf, pbuf, dwSize, NULL, 0);
-#endif
}
void S_TransferPaintBuffer(int endtime)
@@ -129,12 +85,6 @@
int val;
int snd_vol;
DWORD *pbuf;
-#ifdef _WIN32
- int reps;
- DWORD dwSize,dwSize2;
- DWORD *pbuf2;
- HRESULT hresult;
-#endif
if (shm->samplebits == 16 && shm->channels == 2)
{
@@ -149,37 +99,8 @@
step = 3 - shm->channels;
snd_vol = volume.value*256;
-#ifdef _WIN32
- if (pDSBuf)
- {
- reps = 0;
+ pbuf = (DWORD *)shm->buffer;
- while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, &pbuf, &dwSize,
- &pbuf2,&dwSize2, 0)) != DS_OK)
- {
- if (hresult != DSERR_BUFFERLOST)
- {
- Con_Printf ("S_TransferPaintBuffer: DS::Lock Sound Buffer Failed\n");
- S_Shutdown ();
- S_Startup ();
- return;
- }
-
- if (++reps > 10000)
- {
- Con_Printf ("S_TransferPaintBuffer: DS: couldn't restore buffer\n");
- S_Shutdown ();
- S_Startup ();
- return;
- }
- }
- }
- else
-#endif
- {
- pbuf = (DWORD *)shm->buffer;
- }
-
if (shm->samplebits == 16)
{
short *out = (short *) pbuf;
@@ -210,23 +131,6 @@
out_idx = (out_idx + 1) & out_mask;
}
}
-
-#ifdef _WIN32
- if (pDSBuf) {
- DWORD dwNewpos, dwWrite;
- int il = paintedtime;
- int ir = endtime - paintedtime;
-
- ir += il;
-
- pDSBuf->lpVtbl->Unlock(pDSBuf, pbuf, dwSize, NULL, 0);
-
- pDSBuf->lpVtbl->GetCurrentPosition(pDSBuf, &dwNewpos, &dwWrite);
-
-// if ((dwNewpos >= il) && (dwNewpos <= ir))
-// Con_Printf("%d-%d p %d c\n", il, ir, dwNewpos);
- }
-#endif
}
@@ -324,7 +228,7 @@
}
-#if !id386
+#ifndef id386
void SND_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count)
{
--- a/snd_mixa.s
+++ b/snd_mixa.s
@@ -6,7 +6,7 @@
#include "asm_i386.h"
#include "quakeasm.h"
-#if id386
+#ifdef id386
.text
--- a/surf16.s
+++ b/surf16.s
@@ -7,7 +7,7 @@
#include "quakeasm.h"
#include "asm_draw.h"
-#if id386
+#ifdef id386
//----------------------------------------------------------------------
// Surface block drawer
--- a/surf8.s
+++ b/surf8.s
@@ -7,7 +7,7 @@
#include "quakeasm.h"
#include "asm_draw.h"
-#if id386
+#ifdef id386
.data
--- a/sv_main.c
+++ b/sv_main.c
@@ -258,7 +258,8 @@
#ifdef IDGODS
client->privileged = IsID(&client->netconnection->addr);
-#else
+#endif
+#ifndef IDGODS
client->privileged = false;
#endif
--- a/sv_user.c
+++ b/sv_user.c
@@ -149,7 +149,7 @@
*/
cvar_t sv_maxspeed = {"sv_maxspeed", "320", false, true};
cvar_t sv_accelerate = {"sv_accelerate", "10"};
-#if 0
+/*
void SV_Accelerate (vec3_t wishvel)
{
int i;
@@ -169,7 +169,7 @@
for (i=0 ; i<3 ; i++)
velocity[i] += accelspeed*pushvec[i];
}
-#endif
+*/
void SV_Accelerate (void)
{
int i;
--- a/sys_dosa.s
+++ b/sys_dosa.s
@@ -22,7 +22,7 @@
ret
-#if 0
+/*
.globl C(unmaskexceptions)
C(unmaskexceptions):
fnstenv fpenv
@@ -30,7 +30,7 @@
fldenv fpenv
ret
-#endif
+*/
.data
@@ -73,19 +73,19 @@
C(Sys_SetFPCW):
fnstcw cw
movl cw,%eax
-#if id386
+#ifdef id386
andb $0xF0,%ah
orb $0x03,%ah // round mode, 64-bit precision
#endif
movl %eax,full_cw
-#if id386
+#ifdef id386
andb $0xF0,%ah
orb $0x0C,%ah // chop mode, single precision
#endif
movl %eax,single_cw
-#if id386
+#ifdef id386
andb $0xF0,%ah
orb $0x08,%ah // ceil mode, single precision
#endif
--- a/sys_linux.c
+++ b/sys_linux.c
@@ -110,23 +110,23 @@
}
}
-#if 0
+/*
static char end1[] =
"\x1b[?7h\x1b[40m\x1b[2J\x1b[0;1;41m\x1b[1;1H QUAKE: The Doomed Dimension \x1b[33mby \x1b[44mid\x1b[41m Software \x1b[2;1H ---------------------------------------------------------------------------- \x1b[3;1H CALL 1-800-IDGAMES TO ORDER OR FOR TECHNICAL SUPPORT \x1b[4;1H PRICE: $45.00 (PRICES MAY VARY OUTSIDE THE US.) \x1b[5;1H \x1b[6;1H \x1b[37mYes! You only have one fourth of this incredible epic. That is because most \x1b[7;1H of you have paid us nothing or at most, very little. You could steal the \x1b[8;1H game from a friend. But we both know you'll be punished by God if you do. \x1b[9;1H \x1b[33mWHY RISK ETERNAL DAMNATION? CALL 1-800-IDGAMES AND BUY NOW! \x1b[10;1H \x1b[37mRemember, we love you almost as much as He does. \x1b[11;1H \x1b[12;1H \x1b[33mProgramming: \x1b[37mJohn Carmack, Michael Abrash, John Cash \x1b[13;1H \x1b[33mDesign: \x1b[37mJohn Romero, Sandy Petersen, American McGee, Tim Willits \x1b[14;1H \x1b[33mArt: \x1b[37mAdrian Carmack, Kevin Cloud \x1b[15;1H \x1b[33mBiz: \x1b[37mJay Wilbur, Mike Wilson, Donna Jackson \x1b[16;1H \x1b[33mProjects: \x1b[37mShawn Green \x1b[33mSupport: \x1b[37mBarrett Alexander \x1b[17;1H \x1b[33mSound Effects: \x1b[37mTrent Reznor and Nine Inch Nails \x1b[18;1H For other information or details on ordering outside the US, check out the \x1b[19;1H files accompanying QUAKE or our website at http://www.idsoftware.com. \x1b[20;1H \x1b[0;41mQuake is a trademark of Id Software, inc., (c)1996 Id Software, inc. \x1b[21;1H All rights reserved. NIN logo is a registered trademark licensed to \x1b[22;1H Nothing Interactive, Inc. All rights reserved. \x1b[40m\x1b[23;1H\x1b[0m";
static char end2[] =
"\x1b[?7h\x1b[40m\x1b[2J\x1b[0;1;41m\x1b[1;1H QUAKE \x1b[33mby \x1b[44mid\x1b[41m Software \x1b[2;1H ----------------------------------------------------------------------------- \x1b[3;1H \x1b[37mWhy did you quit from the registered version of QUAKE? Did the \x1b[4;1H scary monsters frighten you? Or did Mr. Sandman tug at your \x1b[5;1H little lids? No matter! What is important is you love our \x1b[6;1H game, and gave us your money. Congratulations, you are probably \x1b[7;1H not a thief. \x1b[8;1H Thank You. \x1b[9;1H \x1b[33;44mid\x1b[41m Software is: \x1b[10;1H PROGRAMMING: \x1b[37mJohn Carmack, Michael Abrash, John Cash \x1b[11;1H \x1b[33mDESIGN: \x1b[37mJohn Romero, Sandy Petersen, American McGee, Tim Willits \x1b[12;1H \x1b[33mART: \x1b[37mAdrian Carmack, Kevin Cloud \x1b[13;1H \x1b[33mBIZ: \x1b[37mJay Wilbur, Mike Wilson \x1b[33mPROJECTS MAN: \x1b[37mShawn Green \x1b[14;1H \x1b[33mBIZ ASSIST: \x1b[37mDonna Jackson \x1b[33mSUPPORT: \x1b[37mBarrett Alexander \x1b[15;1H \x1b[33mSOUND EFFECTS AND MUSIC: \x1b[37mTrent Reznor and Nine Inch Nails \x1b[16;1H \x1b[17;1H If you need help running QUAKE refer to the text files in the \x1b[18;1H QUAKE directory, or our website at http://www.idsoftware.com. \x1b[19;1H If all else fails, call our technical support at 1-800-IDGAMES. \x1b[20;1H \x1b[0;41mQuake is a trademark of Id Software, inc., (c)1996 Id Software, inc. \x1b[21;1H All rights reserved. NIN logo is a registered trademark licensed \x1b[22;1H to Nothing Interactive, Inc. All rights reserved. \x1b[23;1H\x1b[40m\x1b[0m";
-#endif
+*/
void Sys_Quit (void)
{
Host_Shutdown();
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
-#if 0
+ /*
if (registered.value)
printf("%s", end2);
else
printf("%s", end1);
-#endif
+ */
fflush(stdout);
exit(0);
}
@@ -133,7 +133,7 @@
void Sys_Init(void)
{
-#if id386
+#ifdef id386
Sys_SetFPCW();
#endif
}
@@ -345,7 +345,7 @@
return NULL;
}
-#if !id386
+#ifndef id386
void Sys_HighFPPrecision (void)
{
}
@@ -353,7 +353,7 @@
void Sys_LowFPPrecision (void)
{
}
-#endif
+#endif //!id386
int main (int c, char **v)
{
@@ -377,7 +377,8 @@
#ifdef GLQUAKE
parms.memsize = 16*1024*1024;
-#else
+#endif
+#ifndef GLQUAKE
parms.memsize = 8*1024*1024;
#endif
--- a/vid_x.c
+++ b/vid_x.c
@@ -793,30 +793,6 @@
case XK_KP_Add: key = '+'; break;
case XK_KP_Subtract: key = '-'; break;
case XK_KP_Divide: key = '/'; break;
-
-#if 0
- case 0x021: key = '1';break;/* [!] */
- case 0x040: key = '2';break;/* [@] */
- case 0x023: key = '3';break;/* [#] */
- case 0x024: key = '4';break;/* [$] */
- case 0x025: key = '5';break;/* [%] */
- case 0x05e: key = '6';break;/* [^] */
- case 0x026: key = '7';break;/* [&] */
- case 0x02a: key = '8';break;/* [*] */
- case 0x028: key = '9';;break;/* [(] */
- case 0x029: key = '0';break;/* [)] */
- case 0x05f: key = '-';break;/* [_] */
- case 0x02b: key = '=';break;/* [+] */
- case 0x07c: key = '\'';break;/* [|] */
- case 0x07d: key = '[';break;/* [}] */
- case 0x07b: key = ']';break;/* [{] */
- case 0x022: key = '\'';break;/* ["] */
- case 0x03a: key = ';';break;/* [:] */
- case 0x03f: key = '/';break;/* [?] */
- case 0x03e: key = '.';break;/* [>] */
- case 0x03c: key = ',';break;/* [<] */
-#endif
-
default:
key = *(unsigned char*)buf;
if (key >= 'A' && key <= 'Z')
@@ -1070,7 +1046,7 @@
}
}
-#if 0
+/*
char *Sys_ConsoleInput (void)
{
@@ -1099,7 +1075,7 @@
return 0;
}
-#endif
+*/
void D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height)
{
--- a/view.c
+++ b/view.c
@@ -128,12 +128,10 @@
void V_StartPitchDrift (void)
{
-#if 1
if (cl.laststop == cl.time)
{
return; // something else is keeping it from drifting
}
-#endif
if (cl.nodrift || !cl.pitchvel)
{
cl.pitchvel = v_centerspeed.value;
@@ -593,7 +591,8 @@
VID_ShiftPalette (pal);
}
-#else // !GLQUAKE
+#endif /* GLQUAKE */
+#ifndef GLQUAKE
void V_UpdatePalette (void)
{
int i, j;
@@ -661,7 +660,7 @@
VID_ShiftPalette (pal);
}
-#endif // !GLQUAKE
+#endif /* ! GLQUAKE */
/*
@@ -921,9 +920,9 @@
// fudge position around to keep amount of weapon visible
// roughly equal with different FOV
-#if 0
+ /*
if (cl.model_precache[cl.stats[STAT_WEAPON]] && strcmp (cl.model_precache[cl.stats[STAT_WEAPON]]->name, "progs/v_shot2.mdl"))
-#endif
+ */
if (scr_viewsize.value == 110)
view->origin[2] += 1;
else if (scr_viewsize.value == 100)
--- a/world.c
+++ b/world.c
@@ -463,7 +463,7 @@
===============================================================================
*/
-#if !id386
+#ifndef id386
/*
==================
@@ -608,17 +608,16 @@
t2 = DotProduct (plane->normal, p2) - plane->dist;
}
-#if 1
- if (t1 >= 0 && t2 >= 0)
- return SV_RecursiveHullCheck (hull, node->children[0], p1f, p2f, p1, p2, trace);
- if (t1 < 0 && t2 < 0)
- return SV_RecursiveHullCheck (hull, node->children[1], p1f, p2f, p1, p2, trace);
-#else
+ /*
if ( (t1 >= DIST_EPSILON && t2 >= DIST_EPSILON) || (t2 > t1 && t1 >= 0) )
return SV_RecursiveHullCheck (hull, node->children[0], p1f, p2f, p1, p2, trace);
if ( (t1 <= -DIST_EPSILON && t2 <= -DIST_EPSILON) || (t2 < t1 && t1 <= 0) )
return SV_RecursiveHullCheck (hull, node->children[1], p1f, p2f, p1, p2, trace);
-#endif
+ */
+ if (t1 >= 0 && t2 >= 0)
+ return SV_RecursiveHullCheck (hull, node->children[0], p1f, p2f, p1, p2, trace);
+ if (t1 < 0 && t2 < 0)
+ return SV_RecursiveHullCheck (hull, node->children[1], p1f, p2f, p1, p2, trace);
// put the crosspoint DIST_EPSILON pixels on the near side
if (t1 < 0)
@@ -641,7 +640,9 @@
return false;
#ifdef PARANOID
- if (SV_HullPointContents (sv_hullmodel, mid, node->children[side])
+ /* FIXME */
+ /*if (SV_HullPointContents (sv_hullmodel, mid, node->children[side])*/
+ if (SV_HullPointContents (hull, mid, node->children[side])
== CONTENTS_SOLID)
{
Con_Printf ("mid PointInHullSolid\n");
@@ -875,11 +876,11 @@
*/
void SV_MoveBounds (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, vec3_t boxmins, vec3_t boxmaxs)
{
-#if 0
-// debug to test against everything
-boxmins[0] = boxmins[1] = boxmins[2] = -9999;
-boxmaxs[0] = boxmaxs[1] = boxmaxs[2] = 9999;
-#else
+ /* debug to test against everything
+ boxmins[0] = boxmins[1] = boxmins[2] = -9999;
+ boxmaxs[0] = boxmaxs[1] = boxmaxs[2] = 9999;
+ */
+
int i;
for (i=0 ; i<3 ; i++)
@@ -895,7 +896,6 @@
boxmaxs[i] = start[i] + maxs[i] + 1;
}
}
-#endif
}
/*
--- a/worlda.s
+++ b/worlda.s
@@ -8,7 +8,7 @@
#include "quakeasm.h"
#include "d_ifacea.h"
-#if id386
+#ifdef id386
.data