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/vid.h"
#include "compat.h"
#ifdef WIN32 // FIXME: evil hack to get full DirectSound support with SDL
#include <windows.h>
#include <SDL_syswm.h>
HWND mainwindow;
#endif
//int modestate; // FIXME: just to avoid cross-compile errors - remove later
// The original defaults
#define BASEWIDTH 320
#define BASEHEIGHT 200
@ -69,8 +65,8 @@ SDL_Surface *screen = NULL;
void
VID_SetPalette (unsigned char *palette)
{
int i;
SDL_Color colors[256];
int i;
for (i = 0; i < 256; ++i) {
colors[i].r = *palette++;
@ -123,15 +119,13 @@ VID_Init (unsigned char *palette)
vid.conrowbytes = vid.rowbytes;
vid.direct = 0;
// allocate z buffer and surface cache
VID_InitBuffers ();
VID_InitBuffers (); // allocate z buffer and surface cache
// initialize the mouse
SDL_ShowCursor (0);
SDL_ShowCursor (0); // hide the mouse pointer
#ifdef WIN32
// FIXME: EVIL thing - but needed for win32 until
// SDL_sound works better - without this DirectSound fails.
// FIXME: EVIL thing - but needed for win32 until
// SDL_sound works better - without this DirectSound fails.
// SDL_GetWMInfo(&info);
// mainwindow=info.window;
@ -145,7 +139,7 @@ void
VID_Update (vrect_t *rects)
{
SDL_Rect *sdlrects;
int n, i;
int i, n;
vrect_t *rect;
// 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;
if (!screen)
return;
if (x < 0)

View file

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

View file

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