diff --git a/libs/audio/cd/cd_sdl.c b/libs/audio/cd/cd_sdl.c index a4dec421d..7688a53cf 100644 --- a/libs/audio/cd/cd_sdl.c +++ b/libs/audio/cd/cd_sdl.c @@ -30,9 +30,6 @@ static const char rcsid[] = #ifdef HAVE_CONFIG_H # include "config.h" #endif -#ifdef HAVE_WINDOWS_H -# include -#endif #ifdef HAVE_STRING_H # include #endif diff --git a/libs/audio/renderer/snd_dma.c b/libs/audio/renderer/snd_dma.c index 08d3cdfbf..3b069969b 100644 --- a/libs/audio/renderer/snd_dma.c +++ b/libs/audio/renderer/snd_dma.c @@ -39,9 +39,7 @@ static const char rcsid[] = #include -#ifdef _WIN32 -# include "winquake.h" -#endif +#include "winquake.h" #include "QF/cmd.h" #include "QF/cvar.h" @@ -171,9 +169,7 @@ SND_Startup (void) rc = S_O_Init (); if (!rc) { -#ifndef _WIN32 Sys_Printf ("S_Startup: S_O_Init failed.\n"); -#endif sound_started = 0; return; } diff --git a/libs/audio/renderer/snd_mix.c b/libs/audio/renderer/snd_mix.c index 62559d7ff..bf5fe18b9 100644 --- a/libs/audio/renderer/snd_mix.c +++ b/libs/audio/renderer/snd_mix.c @@ -43,11 +43,7 @@ static const char rcsid[] = #include "compat.h" -#ifdef _WIN32 -# include "winquake.h" -#else -# define DWORD unsigned long -#endif +#include "winquake.h" #define PAINTBUFFER_SIZE 512 portable_samplepair_t paintbuffer[PAINTBUFFER_SIZE * 2]; @@ -89,7 +85,7 @@ void SND_TransferStereo16 (int endtime) { int lpaintedtime, lpos; - DWORD *pbuf; + unsigned long *pbuf; snd_vol = volume->value * 256; @@ -109,7 +105,7 @@ SND_TransferStereo16 (int endtime) #endif #endif { - pbuf = (DWORD *) shm->buffer; + pbuf = (unsigned long *) shm->buffer; } while (lpaintedtime < endtime) { @@ -144,7 +140,7 @@ SND_TransferPaintBuffer (int endtime) { int count, out_idx, out_mask, snd_vol, step, val; int *p; - DWORD *pbuf; + unsigned long *pbuf; if (shm->samplebits == 16 && shm->channels == 2) { SND_TransferStereo16 (endtime); @@ -170,7 +166,7 @@ SND_TransferPaintBuffer (int endtime) #endif #endif { - pbuf = (DWORD *) shm->buffer; + pbuf = (unsigned long *) shm->buffer; } if (shm->samplebits == 16) { diff --git a/libs/util/quakefs.c b/libs/util/quakefs.c index 815800294..8d44801d2 100644 --- a/libs/util/quakefs.c +++ b/libs/util/quakefs.c @@ -56,7 +56,7 @@ static const char rcsid[] = # endif #endif -#ifdef WIN32 +#ifdef HAVE_IO_H # include #endif diff --git a/libs/util/zone.c b/libs/util/zone.c index 6980f7c52..89b582f72 100644 --- a/libs/util/zone.c +++ b/libs/util/zone.c @@ -395,18 +395,10 @@ Hunk_AllocName (int size, const char *name) size = sizeof (hunk_t) + ((size + 15) & ~15); if (hunk_size - hunk_low_used - hunk_high_used < size) -// Sys_Error ("Hunk_Alloc: failed on %i bytes",size); -#ifdef _WIN32 - Sys_Error - ("Not enough RAM allocated. Try starting using " - "\"-heapsize 16000\" on the %s command line.", - PROGRAM); -#else Sys_Error ("Not enough RAM allocated. Try starting using \"-mem 16\" on " "the %s command line.", PROGRAM); -#endif h = (hunk_t *) (hunk_base + hunk_low_used); hunk_low_used += size; diff --git a/libs/video/renderer/sw/screen.c b/libs/video/renderer/sw/screen.c index f56b4ccbb..88db5d3da 100644 --- a/libs/video/renderer/sw/screen.c +++ b/libs/video/renderer/sw/screen.c @@ -825,15 +825,6 @@ SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs, int swap) if (scr_disabled_for_loading) return; -#ifdef _WIN32 - { // don't suck up any cpu if minimized - extern qboolean Minimized; - - if (Minimized) - return; - } -#endif - r_realtime = realtime; scr_copytop = 0; diff --git a/libs/video/renderer/sw32/d_polyse.c b/libs/video/renderer/sw32/d_polyse.c index 18ab07b0e..a0d0bbf6c 100644 --- a/libs/video/renderer/sw32/d_polyse.c +++ b/libs/video/renderer/sw32/d_polyse.c @@ -354,24 +354,6 @@ D_PolysetCalcGradients (int skinwidth) // a_ststepxwhole = skinwidth * (r_tstepx >> 16) + (r_sstepx >> 16); } -#if 0 -byte gelmap[256]; - -void -InitGel (byte * palette) -{ - int i; - int r; - - for (i = 0; i < 256; i++) { -// r = (palette[i*3]>>4); - r = - (palette[i * 3] + palette[i * 3 + 1] + - palette[i * 3 + 2]) / (16 * 3); - gelmap[i] = /* 64 */ 0 + r; - } -} -#endif void D_PolysetDrawSpans (spanpackage_t * pspanpackage) @@ -627,89 +609,6 @@ done32: ; } -/* - D_PolysetFillSpans -*/ -#if 0 -void -D_PolysetFillSpans (spanpackage_t * pspanpackage) -{ - int color, lcount; - switch(r_pixbytes) - { - case 1: - // FIXME: do z buffering - color = (d_aflatcolor++) & 0xFF; - while (1) { - int lcount; - byte *lpdest; - - lcount = pspanpackage->count; - - if (lcount == -1) - return; - - if (lcount) { - lpdest = (byte *) d_viewbuffer + pspanpackage->pdest; - - do { - *lpdest++ = color; - } while (--lcount); - } - - pspanpackage++; - } - break; - case 2: - color = d_8to16table[(d_aflatcolor++) & 0xFF]; - while (1) { - short *lpdest; - - lcount = pspanpackage->count; - - if (lcount == -1) - return; - - if (lcount) { - lpdest = (short *) d_viewbuffer + pspanpackage->pdest; - - do { - *lpdest++ = color; - } while (--lcount); - } - - pspanpackage++; - } - break; - case 4: - color = d_8to24table[(d_aflatcolor++) & 0xFF]; - while (1) { - int lcount; - int *lpdest; - - lcount = pspanpackage->count; - - if (lcount == -1) - return; - - if (lcount) { - lpdest = (int *) d_viewbuffer + pspanpackage->pdest; - - do { - *lpdest++ = color; - } while (--lcount); - } - - pspanpackage++; - } - break; - default: - Sys_Error("D_PolysetFillSpans: unsupported r_pixbytes %i\n", r_pixbytes); - } -} -#endif - - void D_RasterizeAliasPolySmooth (void) { @@ -926,79 +825,3 @@ D_PolysetSetEdgeTable (void) pedgetable = &edgetables[edgetableindex]; } - - -#if 0 - -void -D_PolysetRecursiveDrawLine (int *lp1, int *lp2) -{ - int d; - int new[6]; - int ofs; - - d = lp2[0] - lp1[0]; - if (d < -1 || d > 1) - goto split; - d = lp2[1] - lp1[1]; - if (d < -1 || d > 1) - goto split; - - return; // line is completed - - split: - // split this edge - new[0] = (lp1[0] + lp2[0]) >> 1; - new[1] = (lp1[1] + lp2[1]) >> 1; - new[5] = (lp1[5] + lp2[5]) >> 1; - new[2] = (lp1[2] + lp2[2]) >> 1; - new[3] = (lp1[3] + lp2[3]) >> 1; - new[4] = (lp1[4] + lp2[4]) >> 1; - - // draw the point - ofs = d_scantable[new[1]] + new[0]; - if (new[5] > d_pzbuffer[ofs]) { - int pix; - - d_pzbuffer[ofs] = new[5]; - pix = skintable[new[3] >> 16][new[2] >> 16]; -// pix = ((byte *)acolormap)[pix + (new[4] & 0xFF00)]; - d_viewbuffer[ofs] = pix; - } - // recursively continue - D_PolysetRecursiveDrawLine (lp1, new); - D_PolysetRecursiveDrawLine (new, lp2); -} - - -void -D_PolysetRecursiveTriangle2 (int *lp1, int *lp2, int *lp3) -{ - int d; - int new[4]; - - d = lp2[0] - lp1[0]; - if (d < -1 || d > 1) - goto split; - d = lp2[1] - lp1[1]; - if (d < -1 || d > 1) - goto split; - return; - - split: - // split this edge - new[0] = (lp1[0] + lp2[0]) >> 1; - new[1] = (lp1[1] + lp2[1]) >> 1; - new[5] = (lp1[5] + lp2[5]) >> 1; - new[2] = (lp1[2] + lp2[2]) >> 1; - new[3] = (lp1[3] + lp2[3]) >> 1; - new[4] = (lp1[4] + lp2[4]) >> 1; - - D_PolysetRecursiveDrawLine (new, lp3); - - // recursively continue - D_PolysetRecursiveTriangle (lp1, new, lp3); - D_PolysetRecursiveTriangle (new, lp2, lp3); -} - -#endif diff --git a/libs/video/renderer/sw32/screen.c b/libs/video/renderer/sw32/screen.c index 479eee087..cb828e58c 100644 --- a/libs/video/renderer/sw32/screen.c +++ b/libs/video/renderer/sw32/screen.c @@ -845,15 +845,6 @@ SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs, int swap) if (scr_disabled_for_loading) return; -#ifdef _WIN32 - { // don't suck up any cpu if minimized - extern qboolean Minimized; - - if (Minimized) - return; - } -#endif - r_realtime = realtime; scr_copytop = 0; diff --git a/libs/video/renderer/sw32/sw32_rsky.c b/libs/video/renderer/sw32/sw32_rsky.c index ee406ce5f..bf79d6750 100644 --- a/libs/video/renderer/sw32/sw32_rsky.c +++ b/libs/video/renderer/sw32/sw32_rsky.c @@ -189,55 +189,6 @@ R_MakeSky (void) default: Sys_Error("R_MakeSky: unsupported r_pixbytes %i\n", r_pixbytes); } - /* - int x, y; - int ofs, baseofs; - int xshift, yshift; - unsigned int *pnewsky; - static int xlast = -1, ylast = -1; - - xshift = skytime * skyspeed; - yshift = skytime * skyspeed; - - if ((xshift == xlast) && (yshift == ylast)) - return; - - xlast = xshift; - ylast = yshift; - - pnewsky = (unsigned int *) &newsky[0]; - - for (y = 0; y < SKYSIZE; y++) { - baseofs = ((y + yshift) & SKYMASK) * 131; - -// FIXME: clean this up -#if UNALIGNED_OK - for (x = 0; x < SKYSIZE; x += 4) { - ofs = baseofs + ((x + xshift) & SKYMASK); - - // PORT: unaligned dword access to bottommask and bottomsky - - *pnewsky = (*(pnewsky + (128 / sizeof (unsigned int))) & - *(unsigned int *) &bottommask[ofs]) | - *(unsigned int *) &bottomsky[ofs]; - - pnewsky++; - } -#else - for (x = 0; x < SKYSIZE; x++) { - ofs = baseofs + ((x + xshift) & SKYMASK); - - *(byte *) pnewsky = (*((byte *) pnewsky + 128) & - *(byte *) & bottommask[ofs]) | - *(byte *) & bottomsky[ofs]; - pnewsky = (unsigned int *) ((byte *) pnewsky + 1); - } -#endif - - pnewsky += 128 / sizeof (unsigned int); - } - */ - r_skymade = 1; } diff --git a/libs/video/targets/in_sdl.c b/libs/video/targets/in_sdl.c index f0a597898..e4b6f8bdd 100644 --- a/libs/video/targets/in_sdl.c +++ b/libs/video/targets/in_sdl.c @@ -46,12 +46,6 @@ static const char rcsid[] = #include "compat.h" -#ifdef WIN32 -// FIXME: this is evil... -# include -HWND mainwindow; -#endif - cvar_t *m_filter; cvar_t *in_grab; diff --git a/libs/video/targets/keys.c b/libs/video/targets/keys.c index 4a01d00b2..289086ba7 100644 --- a/libs/video/targets/keys.c +++ b/libs/video/targets/keys.c @@ -30,9 +30,6 @@ static const char rcsid[] = #ifdef HAVE_CONFIG_H # include "config.h" #endif -#ifdef _WIN32 -# include -#endif #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/targets/vid_common_gl.c b/libs/video/targets/vid_common_gl.c index e8b788785..e2538a841 100644 --- a/libs/video/targets/vid_common_gl.c +++ b/libs/video/targets/vid_common_gl.c @@ -41,11 +41,6 @@ static const char rcsid[] = # include #endif -#ifdef _WIN32 -// must be BEFORE include gl/gl.h -# include "winquake.h" -#endif - #include "QF/console.h" #include "QF/cvar.h" #include "QF/input.h" diff --git a/nq/source/sys_sdl.c b/nq/source/sys_sdl.c index dd72d5d11..38fa561f9 100644 --- a/nq/source/sys_sdl.c +++ b/nq/source/sys_sdl.c @@ -76,8 +76,6 @@ int noconinput; #ifdef _WIN32 # include "winquake.h" -// FIXME: minimized is not currently supported under SDL -qboolean Minimized = false; void MaskExceptions (void); #endif diff --git a/nq/source/sys_win.c b/nq/source/sys_win.c index 0089d6d68..02d7a702d 100644 --- a/nq/source/sys_win.c +++ b/nq/source/sys_win.c @@ -379,11 +379,11 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, if (parms.memsize > MAXIMUM_WIN_MEMORY) parms.memsize = MAXIMUM_WIN_MEMORY; - if (COM_CheckParm ("-heapsize")) { - t = COM_CheckParm ("-heapsize") + 1; + if (COM_CheckParm ("-mem")) { + t = COM_CheckParm ("-mem") + 1; if (t < com_argc) - parms.memsize = atoi (com_argv[t]) * 1024; + parms.memsize = atoi (com_argv[t]) * 1024 * 1024; } parms.membase = malloc (parms.memsize); diff --git a/qw/source/cl_sys_sdl.c b/qw/source/cl_sys_sdl.c index 5e4fd42dc..ff554dae3 100644 --- a/qw/source/cl_sys_sdl.c +++ b/qw/source/cl_sys_sdl.c @@ -77,9 +77,6 @@ int noconinput; #ifdef _WIN32 # include "winquake.h" -// FIXME: minimized is not currently supported under SDL -qboolean Minimized = false; -void MaskExceptions (void); #endif void @@ -89,9 +86,6 @@ Sys_Init (void) OSVERSIONINFO vinfo; #endif #ifdef USE_INTEL_ASM -#ifdef _WIN32 - MaskExceptions (); -#endif Sys_SetFPCW (); #endif diff --git a/qw/source/cl_sys_win.c b/qw/source/cl_sys_win.c index 2719c8995..9d0647fa8 100644 --- a/qw/source/cl_sys_win.c +++ b/qw/source/cl_sys_win.c @@ -366,11 +366,11 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, if (host_parms.memsize > MAXIMUM_WIN_MEMORY) host_parms.memsize = MAXIMUM_WIN_MEMORY; - if (COM_CheckParm ("-heapsize")) { - t = COM_CheckParm ("-heapsize") + 1; + if (COM_CheckParm ("-mem")) { + t = COM_CheckParm ("-mem") + 1; if (t < com_argc) - host_parms.memsize = atoi (com_argv[t]) * 1024; + host_parms.memsize = atoi (com_argv[t]) * 1024 * 1024; } host_parms.membase = malloc (host_parms.memsize); diff --git a/qw/source/net_chan.c b/qw/source/net_chan.c index 649ffd694..d5400d7ee 100644 --- a/qw/source/net_chan.c +++ b/qw/source/net_chan.c @@ -30,12 +30,8 @@ static const char rcsid[] = #ifdef HAVE_CONFIG_H # include "config.h" #endif -#ifndef _WIN32 -# ifdef HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H # include -# endif -#else -# include #endif #ifdef HAVE_STRING_H # include @@ -116,11 +112,7 @@ Netchan_Init (void) int port; // pick a port value that should be nice and random -#ifdef _WIN32 - port = ((int) (timeGetTime () * 1000) * time (NULL)) & 0xffff; -#else - port = ((int) (getpid () + getuid () * 1000) * time (NULL)) & 0xffff; -#endif + port = rand () * (65536.0 / RAND_MAX); Cvar_SetValue (qport, port); } @@ -132,11 +124,11 @@ Netchan_Init_Cvars (void) "Show all network packets"); showdrop = Cvar_Get ("showdrop", "0", CVAR_NONE, NULL, "Toggle the " "display of how many packets you are dropping"); - qport = Cvar_Get ("qport", "0", CVAR_NONE, NULL, "The internal port " - "number for the game networking code. Useful for " - "clients who use multiple connections through one " - "IP address (NAT/IP-MASQ) because default port is " - "random."); + qport = Cvar_Get ("qport", "0", CVAR_NONE, NULL, "The internal port " + "number for the game networking code. Useful for " + "clients who use multiple connections through one " + "IP address (NAT/IP-MASQ) because default port is " + "random."); } /* diff --git a/qw/source/sv_sys_win.c b/qw/source/sv_sys_win.c index 456624147..e04286e08 100644 --- a/qw/source/sv_sys_win.c +++ b/qw/source/sv_sys_win.c @@ -136,9 +136,6 @@ main (int argc, const char **argv) host_parms.memsize = 8 * 1024 * 1024; - if ((t = COM_CheckParm ("-heapsize")) != 0 && t + 1 < com_argc) - host_parms.memsize = atoi (com_argv[t + 1]) * 1024; - if ((t = COM_CheckParm ("-mem")) != 0 && t + 1 < com_argc) host_parms.memsize = atoi (com_argv[t + 1]) * 1024 * 1024; diff --git a/tools/qfcc/source/cmdlib.c b/tools/qfcc/source/cmdlib.c index d3ce03169..2e4f6fbf2 100644 --- a/tools/qfcc/source/cmdlib.c +++ b/tools/qfcc/source/cmdlib.c @@ -39,10 +39,6 @@ #include #include -#ifdef WIN32 -#include -#endif - #ifdef NeXT #include #endif