"Yay, it builds!"

"Ah, but does it work?"
This commit is contained in:
Bill Currie 2001-08-25 03:52:34 +00:00
parent 8fa46e9fc0
commit 4ed75b014a
6 changed files with 80 additions and 11 deletions

View File

@ -963,3 +963,10 @@ SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs, int swap)
VID_Update (&vrect);
}
}
void
VID_ShiftPalette (unsigned char *p)
{
VID_SetPalette (p);
}

View File

@ -366,9 +366,6 @@ R_TrailingEdge (surf_t *surf, edge_t *edge)
// don't generate a span if this is an inverted span, with the end edge
// preceding the start edge (that is, we haven't seen the start edge yet)
if (--surf->spanstate == 0) {
if (surf->insubmodel)
r_bmodelactive--;
if (surf == surfaces[1].next) {
// emit a span (current top going away)
iu = edge->u >> 20;
@ -404,9 +401,6 @@ R_LeadingEdge (edge_t *edge)
// don't start a span if this is an inverted span, with the end edge
// preceding the start edge (that is, we've already seen the end edge)
if (++surf->spanstate == 1) {
if (surf->insubmodel)
r_bmodelactive++;
surf2 = surfaces[1].next;
if (surf->key < surf2->key)
@ -504,8 +498,6 @@ R_GenerateSpans (void)
edge_t *edge;
surf_t *surf;
r_bmodelactive = 0;
// clear active surfaces to just the background surface
surfaces[1].next = surfaces[1].prev = &surfaces[1];
surfaces[1].last_u = edge_head_u_shift20;
@ -533,8 +525,6 @@ R_GenerateSpansBackward (void)
{
edge_t *edge;
r_bmodelactive = 0;
// clear active surfaces to just the background surface
surfaces[1].next = surfaces[1].prev = &surfaces[1];
surfaces[1].last_u = edge_head_u_shift20;

View File

@ -176,6 +176,11 @@ Skin_Do_Translation (skin_t *player_skin, int slot, skin_t *skin)
{
}
void
Skin_Do_Translation_Model (model_t *model, int skinnum, int slot, skin_t *skin)
{
}
void
Skin_Init_Translation (void)
{

View File

@ -64,7 +64,7 @@ libQFsdl.la: $(libQFsdl_la_OBJECTS) $(libQFsdl_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libQFsdl_la_LDFLAGS) $(libQFsdl_la_OBJECTS) $(libQFsdl_la_LIBADD) $(LIBS)
libQFsdl32_la_LDFLAGS= -version-info 1:0:0
libQFsdl32_la_SOURCES= $(in_common_SOURCE) in_sdl.c vid.c vid_common_sw.c vid_sdl32.c
libQFsdl32_la_SOURCES= $(in_common_SOURCE) in_sdl.c vid.c vid_common_sw32.c vid_sdl32.c
libQFsdl32.la: $(libQFsdl32_la_OBJECTS) $(libQFsdl32_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libQFsdl32_la_LDFLAGS) $(libQFsdl32_la_OBJECTS) $(libQFsdl32_la_LIBADD) $(LIBS)

View File

@ -36,6 +36,8 @@
#include "QF/va.h"
#include "QF/vid.h"
#include "compat.h"
extern viddef_t vid; // global video state
int scr_width, scr_height;
@ -199,3 +201,62 @@ VID_MakeColormaps (int fullbrights, byte *pal)
VID_MakeColormap16(vid.colormap16, pal);
VID_MakeColormap32(vid.colormap32, pal);
}
void
VID_InitBuffers (void)
{
int buffersize, zbuffersize, cachesize = 1;
void *vid_surfcache;
// Calculate the sizes we want first
buffersize = vid.rowbytes * vid.height;
zbuffersize = vid.width * vid.height * sizeof (*vid.zbuffer);
if (vid.surf_cache_size)
cachesize = vid.surf_cache_size (vid.width, vid.height);
// Free the old z-buffer
if (vid.zbuffer) {
free (vid.zbuffer);
vid.zbuffer = NULL;
}
// Free the old surface cache
if (vid.surfcache) {
if (vid.flush_caches)
vid.flush_caches ();
free (vid.surfcache);
vid.surfcache = NULL;
}
if (vid.do_screen_buffer) {
vid.do_screen_buffer ();
} else {
// Free the old screen buffer
if (vid.buffer) {
free (vid.buffer);
vid.conbuffer = vid.buffer = NULL;
}
// Allocate the new screen buffer
vid.conbuffer = vid.buffer = calloc (buffersize, 1);
if (!vid.conbuffer) {
Sys_Error ("Not enough memory for video mode\n");
}
}
// Allocate the new z-buffer
vid.zbuffer = calloc (zbuffersize, 1);
if (!vid.zbuffer) {
free (vid.buffer);
vid.conbuffer = vid.buffer = NULL;
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) {
free (vid.buffer);
free (vid.zbuffer);
vid.zbuffer = NULL;
Sys_Error ("Not enough memory for video mode\n");
}
if (vid.init_caches)
vid.init_caches (vid.surfcache, cachesize);
}

View File

@ -281,3 +281,9 @@ VID_SetCaption (const char *text)
} else
SDL_WM_SetCaption (va ("%s %s", PROGRAM, VERSION), NULL);
}
qboolean
VID_SetGamma (double gamma)
{
return false; //FIXME
}