Fix black screens in -sdl, and lack of gamma correction in -sgl.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-04-12 06:26:14 +00:00
parent f35a629c61
commit 3a395dd87f
2 changed files with 11 additions and 9 deletions

View file

@ -35,10 +35,11 @@
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#include <stdlib.h>
#include <stdlib.h>
#include <SDL.h>
#include "QF/compat.h"
#include "QF/console.h"
#include "QF/cvar.h"
#include "d_local.h"
@ -160,8 +161,9 @@ VID_Init (unsigned char *palette)
// Initialize display
if (!(screen = SDL_SetVideoMode (vid.width, vid.height, 8, flags)))
Sys_Error ("VID: Couldn't set video mode: %s\n", SDL_GetError ());
VID_InitGamma (palette);
VID_SetPalette (palette);
VID_SetCaption ("");
// VID_SetCaption (""); // FIXME?
// now know everything we need to know about the buffer
VGA_width = vid.conwidth = vid.width;
@ -297,5 +299,6 @@ VID_SetCaption (char *text)
qboolean
VID_SetGamma (double gamma)
{
return false; //FIXME
// return SDL_SetGamma ((float) gamma, (float) gamma, (float) gamma);
return false; // FIXME
}

View file

@ -78,11 +78,9 @@ extern void VID_Init8bitPalette (void);
void
VID_Shutdown (void)
{
if (!vid_initialized)
return;
Con_Printf ("VID_Shutdown\n");
// if (!vid_initialized)
// return;
// Con_Printf ("VID_Shutdown\n");
SDL_Quit ();
}
@ -206,6 +204,7 @@ VID_Init (unsigned char *palette)
GL_Init ();
GL_CheckBrightness (palette);
VID_InitGamma (palette);
VID_SetPalette (palette);
// Check for 3DFX Extensions and initialize them.
@ -252,7 +251,7 @@ VID_SetCaption (char *text)
qboolean
VID_SetGamma (double gamma)
{
return false; //FIXME
return SDL_SetGamma((float) gamma, (float) gamma, (float) gamma);
}
void