mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
various init order fixes and a */[] snafu sorted
also make translations big enough for the 32 bit colors
This commit is contained in:
parent
2634b447b5
commit
2a027969d5
8 changed files with 17 additions and 12 deletions
|
@ -31,7 +31,7 @@
|
|||
#endif
|
||||
|
||||
#include "QF/cvar.h"
|
||||
// #include "QF/render.h"
|
||||
#include "QF/render.h"
|
||||
// #include "QF/vid.h"
|
||||
|
||||
#include "compat.h"
|
||||
|
@ -65,13 +65,18 @@ D_Init (void)
|
|||
r_aliasuvscale = 1.0;
|
||||
|
||||
// LordHavoc: compute 1/zi table for use in rendering code everywhere
|
||||
if (!d_zitable[1])
|
||||
{
|
||||
if (!d_zitable[1]) {
|
||||
int i;
|
||||
d_zitable[0] = 0;
|
||||
for (i = 1;i < 65536;i++)
|
||||
d_zitable[i] = (65536.0 * 65536.0 / (double) i);
|
||||
}
|
||||
|
||||
vid.surf_cache_size = D_SurfaceCacheForRes;
|
||||
vid.flush_caches = D_FlushCaches;
|
||||
vid.init_caches = D_InitCaches;
|
||||
|
||||
VID_InitBuffers ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -46,7 +46,7 @@ int r_turb_spancount;
|
|||
|
||||
void D_DrawTurbulentSpan (void);
|
||||
|
||||
extern float *d_zitable;
|
||||
extern float d_zitable[65536];
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -39,7 +39,7 @@ static int sprite_height;
|
|||
static int minindex, maxindex;
|
||||
static sspan_t *sprite_spans;
|
||||
|
||||
extern float *d_zitable;
|
||||
extern float d_zitable[65536];
|
||||
|
||||
|
||||
void
|
||||
|
|
|
@ -111,6 +111,8 @@ D_InitCaches (void *buffer, int size)
|
|||
sc_base->owner = NULL;
|
||||
sc_base->size = sc_size;
|
||||
|
||||
d_pzbuffer = vid.zbuffer;
|
||||
|
||||
D_ClearCacheGuard ();
|
||||
}
|
||||
|
||||
|
|
|
@ -210,7 +210,6 @@ void
|
|||
VID_InitBuffers (void)
|
||||
{
|
||||
int buffersize, zbuffersize, cachesize = 1;
|
||||
void *vid_surfcache;
|
||||
|
||||
// Calculate the sizes we want first
|
||||
buffersize = vid.rowbytes * vid.height;
|
||||
|
@ -252,8 +251,8 @@ VID_InitBuffers (void)
|
|||
Sys_Error ("Not enough memory for video mode\n");
|
||||
}
|
||||
// Allocate the new surface cache; free the z-buffer if we fail
|
||||
vid_surfcache = calloc (cachesize, 1);
|
||||
if (!vid_surfcache) {
|
||||
vid.surfcache = calloc (cachesize, 1);
|
||||
if (!vid.surfcache) {
|
||||
free (vid.buffer);
|
||||
free (vid.zbuffer);
|
||||
vid.zbuffer = NULL;
|
||||
|
|
|
@ -95,8 +95,7 @@ VID_Init (unsigned char *palette)
|
|||
Uint32 flags;
|
||||
|
||||
// Load the SDL library
|
||||
if (SDL_Init (SDL_INIT_VIDEO) < 0) // |SDL_INIT_AUDIO|SDL_INIT_CDROM) <
|
||||
// 0)
|
||||
if (SDL_Init (SDL_INIT_VIDEO) < 0)
|
||||
Sys_Error ("VID: Couldn't load SDL: %s", SDL_GetError ());
|
||||
|
||||
// Set up display mode (width and height)
|
||||
|
|
|
@ -64,7 +64,7 @@ typedef struct
|
|||
int frags;
|
||||
int colors; // two 4 bit fields
|
||||
int _colors;
|
||||
byte translations[VID_GRADES*256];
|
||||
byte translations[4*VID_GRADES*256]; // space for colormap32
|
||||
} scoreboard_t;
|
||||
|
||||
#define NAME_LENGTH 64
|
||||
|
|
|
@ -92,7 +92,7 @@ typedef struct player_info_s
|
|||
int _bottomcolor;
|
||||
|
||||
int spectator;
|
||||
byte translations[VID_GRADES*256];
|
||||
byte translations[4*VID_GRADES*256]; // space for colormap32
|
||||
struct skin_s *skin;
|
||||
} player_info_t;
|
||||
|
||||
|
|
Loading…
Reference in a new issue