Fixed excessive use of set_screen_mode; Menu fixes

This commit is contained in:
zicodxx 2007-08-08 18:06:33 +00:00
parent 2860b159e9
commit eea4b87d86
3 changed files with 15 additions and 5 deletions

View file

@ -3,6 +3,7 @@ D1X-Rebirth Changelog
20070808
--------
main/config.c, main/game.c, main/gameseq.c, main/menu.c, main/polyobj.c, main/titles.c, main/titles.h: Set default value for Game_screen_mode which is necessary if there's no config file yet; Made resolution switching more failsafe by not allowing resolutions below 320x200; Cleaned up briefings code (I hope so)
main/game.c, main/menu.c: Fixed excessive use of set_screen_mode; Menu fixes
20070727
--------

View file

@ -518,7 +518,14 @@ void game_init_render_buffers(int render_w, int render_h, int render_method )
//mode if cannot init requested mode)
int set_screen_mode(int sm)
{
gr_set_current_canvas(NULL);
if ( (Screen_mode == sm) && !((sm==SCREEN_GAME) && (grd_curscreen->sc_mode != Game_screen_mode)) && !(sm==SCREEN_MENU) )
{
gr_set_current_canvas(NULL);
#ifndef OGL
gr_set_draw_buffer(0); // Set to the front buffer
#endif
return 1;
}
Screen_mode = sm;

View file

@ -833,16 +833,18 @@ void change_res()
screen_width = SM_W(screen_mode);
screen_height = SM_H(screen_mode);
if (Game_screen_mode == screen_mode)
return;
if (screen_width > sdlmode[0]->w || screen_height > sdlmode[0]->h) {
if (!nm_messagebox( TXT_WARNING, 2, "NO", "YES", "Could not verify selected\nscreen resolution.\nThe game may crash.\nDo you really want to proceed?" ))
return;
}
if (screen_height <= 320 || screen_width <= 200)
return;
if (Game_screen_mode == screen_mode)
if (screen_width < 320 || screen_height < 200) {
nm_messagebox( TXT_WARNING, 1, "OK", "Entered resolution is too small.\nReverting ..." );
return;
}
newmenu_close();