extern bool campaign;
+extern void toggleFullscreen();
+
void Loadlevel(int which);
void Loadlevel(const char *name);
-
class CampaignLevel
{
private:
else
sprintf (sbuf, "Resolution: %d*%d (widescreen)", (int)newscreenwidth, (int)newscreenheight);
Menu::setText(0, sbuf);
+ Menu::setText(14, fullscreen ? "Fullscreen: On" : "Fullscreen: Off");
if (newdetail == 0) Menu::setText(1, "Detail: Low");
if (newdetail == 1) Menu::setText(1, "Detail: Medium");
if (newdetail == 2) Menu::setText(1, "Detail: High");
break;
case 3:
Menu::addButton( 0, "", 10 + 20, 440);
+ Menu::addButton(14, "", 10 + 400, 440);
Menu::addButton( 1, "", 10 + 60, 405);
Menu::addButton( 2, "", 10 + 70, 370);
Menu::addButton( 3, "", 10 + 20 - 1000, 335 - 1000);
case 13:
showdamagebar = !showdamagebar;
break;
+ case 14:
+ toggleFullscreen();
+ break;
}
updateSettingsMenu();
break;
float multiplier = 0;
float realmultiplier = 0;
float screenwidth = 0, screenheight = 0;
+bool fullscreen = 0;
float viewdistance = 0;
XYZ viewer;
XYZ viewerfacing;
}
}
-static void toggleFullscreen()
+void toggleFullscreen()
{
+ fullscreen = !fullscreen;
Uint32 flags = SDL_GetWindowFlags(sdlwindow);
if (flags & SDL_WINDOW_FULLSCREEN) {
flags &= ~SDL_WINDOW_FULLSCREEN;
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);
Uint32 sdlflags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN;
- if (!cmdline("windowed"))
+ if ((fullscreen || cmdline("fullscreen")) && !cmdline("windowed")) {
+ fullscreen = 1;
sdlflags |= SDL_WINDOW_FULLSCREEN;
+ }
if (!cmdline("nomousegrab"))
sdlflags |= SDL_WINDOW_INPUT_GRABBED;
usermousesensitivity = 1;
newscreenwidth = kContextWidth = 640;
newscreenheight = kContextHeight = 480;
+ fullscreen = 0;
kBitsPerPixel = 32;
floatjump = 0;
autoslomo = 1;
opstream << newscreenwidth;
opstream << "\nScreenheight:\n";
opstream << newscreenheight;
+ opstream << "\nFullscreen:\n";
+ opstream << fullscreen;
opstream << "\nMouse sensitivity:\n";
opstream << usermousesensitivity;
opstream << "\nBlur(0,1):\n";
ipstream >> kContextWidth;
} else if ( !strncmp(setting, "Screenheight", 12) ) {
ipstream >> kContextHeight;
+ } else if ( !strncmp(setting, "Fullscreen", 10) ) {
+ ipstream >> fullscreen;
} else if ( !strncmp(setting, "Mouse sensitivity", 17) ) {
ipstream >> usermousesensitivity;
} else if ( !strncmp(setting, "Blur", 4) ) {
extern int kContextWidth;
extern int kContextHeight;
extern float screenwidth, screenheight;
+extern bool fullscreen;
void DefaultSettings();
void SaveSettings();