version 1.3 | | version 1.4 |
---|
| | |
#include "args.h" | | #include "args.h" |
| | |
int sdl_video_flags = SDL_SWSURFACE | SDL_HWPALETTE; | | int sdl_video_flags = SDL_SWSURFACE | SDL_HWPALETTE; |
| | char checkvidmodeok=1; |
//end addition -MM | | //end addition -MM |
| | |
SDL_Surface *screen; | | SDL_Surface *screen; |
| | |
| | |
void gr_palette_clear(); // Function prototype for gr_init; | | void gr_palette_clear(); // Function prototype for gr_init; |
| | |
| | |
void gr_update() | | void gr_update() |
{ | | { |
//added 05/19/99 Matt Mueller - locking stuff | | //added 05/19/99 Matt Mueller - locking stuff |
| | |
//edited 10/05/98 by Matt Mueller - make fullscreen mode optional | | //edited 10/05/98 by Matt Mueller - make fullscreen mode optional |
// changed by adb on 980913: added SDL_HWPALETTE (should be option?) | | // changed by adb on 980913: added SDL_HWPALETTE (should be option?) |
// changed by someone on 980923 to add SDL_FULLSCREEN | | // changed by someone on 980923 to add SDL_FULLSCREEN |
if(SDL_VideoModeOK(w,h,8,sdl_video_flags)){ | | if(!checkvidmodeok || SDL_VideoModeOK(w,h,8,sdl_video_flags)){ |
screen = SDL_SetVideoMode(w, h, 8, sdl_video_flags); | | screen = SDL_SetVideoMode(w, h, 8, sdl_video_flags); |
} else { | | } else { |
screen=NULL; | | screen=NULL; |
| | |
| | |
| | |
| | |
| | int gr_check_fullscreen(void){ |
| | return (sdl_video_flags & SDL_FULLSCREEN)?1:0; |
| | } |
| | int gr_toggle_fullscreen(void){ |
| | sdl_video_flags^=SDL_FULLSCREEN; |
| | grd_curscreen->sc_mode=0;//hack to get it to reset screen mode |
| | return (sdl_video_flags & SDL_FULLSCREEN)?1:0; |
| | } |
| | |
int gr_init(int mode) | | int gr_init(int mode) |
{ | | { |
int retcode; | | int retcode; |
| | |
if (FindArg("-hwsurface")) | | if (FindArg("-hwsurface")) |
sdl_video_flags|=SDL_HWSURFACE; | | sdl_video_flags|=SDL_HWSURFACE; |
//end addition -MM | | //end addition -MM |
| | if (FindArg("-nosdlvidmodecheck")) |
| | checkvidmodeok=0; |
| | |
// Set the mode. | | // Set the mode. |
if ((retcode=gr_set_mode(mode))) | | if ((retcode=gr_set_mode(mode))) |