Whitespace cleanups and some cruft removal.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2002-08-21 06:00:08 +00:00
parent 9d2e09feee
commit f92c2d8525
3 changed files with 27 additions and 45 deletions

View file

@ -46,16 +46,12 @@ static const char rcsid[] =
#include "QF/sys.h" #include "QF/sys.h"
#include "QF/vid.h" #include "QF/vid.h"
#include "compat.h"
#ifdef WIN32 // FIXME: evil hack to get full DirectSound support with SDL #ifdef WIN32 // FIXME: evil hack to get full DirectSound support with SDL
#include <windows.h> #include <windows.h>
#include <SDL_syswm.h> #include <SDL_syswm.h>
HWND mainwindow; HWND mainwindow;
#endif #endif
//int modestate; // FIXME: just to avoid cross-compile errors - remove later
// The original defaults // The original defaults
#define BASEWIDTH 320 #define BASEWIDTH 320
#define BASEHEIGHT 200 #define BASEHEIGHT 200
@ -69,8 +65,8 @@ SDL_Surface *screen = NULL;
void void
VID_SetPalette (unsigned char *palette) VID_SetPalette (unsigned char *palette)
{ {
int i;
SDL_Color colors[256]; SDL_Color colors[256];
int i;
for (i = 0; i < 256; ++i) { for (i = 0; i < 256; ++i) {
colors[i].r = *palette++; colors[i].r = *palette++;
@ -123,15 +119,13 @@ VID_Init (unsigned char *palette)
vid.conrowbytes = vid.rowbytes; vid.conrowbytes = vid.rowbytes;
vid.direct = 0; vid.direct = 0;
// allocate z buffer and surface cache VID_InitBuffers (); // allocate z buffer and surface cache
VID_InitBuffers ();
// initialize the mouse SDL_ShowCursor (0); // hide the mouse pointer
SDL_ShowCursor (0);
#ifdef WIN32 #ifdef WIN32
// FIXME: EVIL thing - but needed for win32 until // FIXME: EVIL thing - but needed for win32 until
// SDL_sound works better - without this DirectSound fails. // SDL_sound works better - without this DirectSound fails.
// SDL_GetWMInfo(&info); // SDL_GetWMInfo(&info);
// mainwindow=info.window; // mainwindow=info.window;
@ -145,7 +139,7 @@ void
VID_Update (vrect_t *rects) VID_Update (vrect_t *rects)
{ {
SDL_Rect *sdlrects; SDL_Rect *sdlrects;
int n, i; int i, n;
vrect_t *rect; vrect_t *rect;
// Two-pass system, since Quake doesn't do it the SDL way... // Two-pass system, since Quake doesn't do it the SDL way...
@ -174,7 +168,6 @@ D_BeginDirectRect (int x, int y, byte * pbitmap, int width, int height)
{ {
Uint8 *offset; Uint8 *offset;
if (!screen) if (!screen)
return; return;
if (x < 0) if (x < 0)

View file

@ -55,12 +55,8 @@ static const char rcsid[] =
HWND mainwindow; HWND mainwindow;
#endif #endif
// static float oldin_grab = 0;
cvar_t *vid_bitdepth; cvar_t *vid_bitdepth;
//int modestate; // FIXME: just to avoid cross-compile errors - remove later
// The original defaults // The original defaults
#define BASEWIDTH 320 #define BASEWIDTH 320
#define BASEHEIGHT 200 #define BASEHEIGHT 200
@ -75,10 +71,9 @@ static SDL_Surface *rendersurface = NULL;
void void
VID_SetPalette (unsigned char *palette) VID_SetPalette (unsigned char *palette)
{ {
if (vid_bitdepth->int_val == 8) if (vid_bitdepth->int_val == 8) {
{
int i;
SDL_Color colors[256]; SDL_Color colors[256];
int i;
for (i = 0; i < 256; ++i) { for (i = 0; i < 256; ++i) {
colors[i].r = *palette++; colors[i].r = *palette++;
@ -165,15 +160,13 @@ VID_Init (unsigned char *palette)
vid.conrowbytes = vid.rowbytes; vid.conrowbytes = vid.rowbytes;
vid.direct = rendersurface->pixels; vid.direct = rendersurface->pixels;
// allocate z buffer and surface cache VID_InitBuffers (); // allocate z buffer and surface cache
VID_InitBuffers ();
// initialize the mouse SDL_ShowCursor (0); // initialize the mouse
SDL_ShowCursor (0);
#ifdef WIN32 #ifdef WIN32
// FIXME: EVIL thing - but needed for win32 until // FIXME: EVIL thing - but needed for win32 until
// SDL_sound works better - without this DirectSound fails. // SDL_sound works better - without this DirectSound fails.
// SDL_GetWMInfo(&info); // SDL_GetWMInfo(&info);
// mainwindow=info.window; // mainwindow=info.window;
@ -187,8 +180,7 @@ void
VID_Update (vrect_t *rects) VID_Update (vrect_t *rects)
{ {
while (rects) { while (rects) {
if (vid_bitdepth->int_val != 8) if (vid_bitdepth->int_val != 8) {
{
SDL_Rect sdlrect; SDL_Rect sdlrect;
sdlrect.x = rects->x; sdlrect.x = rects->x;
@ -211,7 +203,6 @@ D_BeginDirectRect (int x, int y, byte * pbitmap, int width, int height)
{ {
Uint8 *offset; Uint8 *offset;
if (!screen) if (!screen)
return; return;
if (x < 0) if (x < 0)

View file

@ -62,7 +62,6 @@ HWND mainwindow;
#define WARP_HEIGHT 200 #define WARP_HEIGHT 200
int VID_options_items = 1; int VID_options_items = 1;
//int modestate; //FIXME: cross-compile issue, ready to remove?
SDL_Surface *screen = NULL; SDL_Surface *screen = NULL;
@ -133,8 +132,7 @@ VID_Init (unsigned char *palette)
vid.conheight = vid.conwidth * 3 / 4; vid.conheight = vid.conwidth * 3 / 4;
i = COM_CheckParm ("-conheight"); i = COM_CheckParm ("-conheight");
if (i != 0) // Set console height, but no smaller if (i != 0) // Set console height, no smaller than 200
// than 200 px
vid.conheight = max (atoi (com_argv[i + 1]), 200); vid.conheight = max (atoi (com_argv[i + 1]), 200);
// Check if we want fullscreen // Check if we want fullscreen
@ -144,7 +142,6 @@ VID_Init (unsigned char *palette)
#ifndef WIN32 // Don't annoy Mesa/3dfx folks #ifndef WIN32 // Don't annoy Mesa/3dfx folks
// FIXME: Maybe this could be put in a different spot, but I don't // FIXME: Maybe this could be put in a different spot, but I don't
// know where. Anyway, it's to work around a 3Dfx Glide bug. // know where. Anyway, it's to work around a 3Dfx Glide bug.
SDL_ShowCursor (0);
SDL_WM_GrabInput (SDL_GRAB_ON); SDL_WM_GrabInput (SDL_GRAB_ON);
putenv ("MESA_GLX_FX=fullscreen"); putenv ("MESA_GLX_FX=fullscreen");
} else { } else {
@ -177,16 +174,17 @@ VID_Init (unsigned char *palette)
VID_InitGamma (palette); VID_InitGamma (palette);
VID_SetPalette (palette); VID_SetPalette (palette);
// Check for 3DFX Extensions and initialize them. VID_Init8bitPalette (); // Check for 3DFX Extensions and initialize them.
VID_Init8bitPalette ();
Con_Printf ("Video mode %dx%d initialized.\n", scr_width, scr_height); Con_Printf ("Video mode %dx%d initialized.\n", scr_width, scr_height);
vid.initialized = true; vid.initialized = true;
SDL_ShowCursor (0); // hide the mouse pointer
#ifdef WIN32 #ifdef WIN32
// FIXME: EVIL thing - but needed for win32 until // FIXME: EVIL thing - but needed for win32 until
// SDL_sound works better - without this DirectSound fails. // SDL_sound works better - without this DirectSound fails.
// SDL_GetWMInfo(&info); // SDL_GetWMInfo(&info);
// mainwindow=info.window; // mainwindow=info.window;