diff --git a/config/menus_settings.cfg b/config/menus_settings.cfg index ce6684c1..0ec5e88a 100644 --- a/config/menus_settings.cfg +++ b/config/menus_settings.cfg @@ -203,6 +203,8 @@ newmenu video menuitemtextinput "screen width: " "$scr_w" "scr_w $arg1" menuitemtextinput "screen height: " "$scr_h" "scr_h $arg1" +menuitemcheckbox "fullscreen: " "$fullscreen" "fullscreen $arg1" + alias fsaa_valuemap "-1 2 4 8 16" menuitemslider "antialiasing (FSAA): " 0 4 "(findlist $fsaa_valuemap $fsaa)" 1 "off 2 4 8 16" "fsaa (at $fsaa_valuemap $arg1)" @@ -233,7 +235,7 @@ menuitemslider "music volume: " 0 255 "$musicvol" 16 "" "musicvol $arg1" menuitemcheckbox "stereo: " "$stereo" "stereo $arg1" menuitemslider "channels: " 0 128 "$soundchans" 4 "" "soundchans $arg1" menuitemslider "sounds at once: " 0 100 "$maxsoundsatonce" 2 "" "maxsoundsatonce $arg1" -menuitemslider "sound buffer: " 128 4096 "$soundbufferlen" 128 "" "soundbufferlen $arg1" +menuitemslider "sound buffer length: " 128 4096 "$soundbufferlen" 128 "" "soundbufferlen $arg1" newmenu fpsrange diff --git a/source/src/main.cpp b/source/src/main.cpp index 9ea36902..e71a31b0 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -16,7 +16,7 @@ void cleanup(char *msg) // single program exit point; if(msg) { #ifdef WIN32 - MessageBox(NULL, msg, "cube fatal error", MB_OK|MB_SYSTEMMODAL); + MessageBox(NULL, msg, "AssaultCube fatal error", MB_OK|MB_SYSTEMMODAL); #else printf(msg); #endif @@ -49,18 +49,24 @@ bool initwarning() { if(!initing) { - if(restoredinits) conoutf("Please restart AssaultCube for this setting to take effect."); - else conoutf("Please restart AssaultCube with the --init command-line option for this setting to take effect."); + if(restoredinits) conoutf("\f3Please restart AssaultCube for this setting to take effect."); + else conoutf("\f3Please restart AssaultCube with the --init command-line option for this setting to take effect."); } return !initing; } -VARF(scr_w, 0, 1024, 10000, initwarning()); -VARF(scr_h, 0, 768, 10000, initwarning()); -VARF(colorbits, 0, 0, 32, initwarning()); -VARF(depthbits, 0, 0, 32, initwarning()); -VARF(fsaa, -1, -1, 16, initwarning()); -VARF(vsync, -1, -1, 1, initwarning()); +VAR(scr_w, 0, 1024, 10000); +VAR(scr_h, 0, 768, 10000); +VAR(colorbits, 0, 0, 32); +VAR(depthbits, 0, 0, 32); +VAR(fsaa, -1, -1, 16); +VAR(vsync, -1, -1, 1); + +#if defined(WIN32) || defined(__APPLE__) +VARF(fullscreen, 0, 0, 1, initwarning()); +#else +VARF(fullscreen, 0, 1, 1, setfullscreen(fullscreen!=0)); +#endif void writeinitcfg() { @@ -73,6 +79,8 @@ void writeinitcfg() fprintf(f, "depthbits %d\n", depthbits); fprintf(f, "fsaa %d\n", fsaa); fprintf(f, "vsync %d\n", vsync); + extern int fullscreen; + fprintf(f, "fullscreen %d\n", fullscreen > 0 ? 1 : 0); extern int soundchans, soundfreq, soundbufferlen; fprintf(f, "soundchans %d\n", soundchans); fprintf(f, "soundfreq %d\n", soundfreq); @@ -108,20 +116,17 @@ void screenshot(char *imagepath) COMMAND(screenshot, ARG_1STR); COMMAND(quit, ARG_NONE); +#if !defined(WIN32) && !defined(__APPLE__) void setfullscreen(bool enable) { if(enable == !(screen->flags&SDL_FULLSCREEN)) { -#if defined(WIN32) || defined(__APPLE__) - conoutf("\"fullscreen\" variable not supported on this platform. Use the -t command-line option."); - extern int fullscreen; - fullscreen = !enable; -#else SDL_WM_ToggleFullScreen(screen); SDL_WM_GrabInput((screen->flags&SDL_FULLSCREEN) ? SDL_GRAB_ON : SDL_GRAB_OFF); -#endif } } +#endif + void screenres(int w, int h) { @@ -153,12 +158,6 @@ void setresdata(char *s, enet_uint32 c) } #endif -#ifdef _DEBUG -VARF(fullscreen, 0, 0, 1, setfullscreen(fullscreen!=0)); -#else -VARF(fullscreen, 0, 1, 1, setfullscreen(fullscreen!=0)); -#endif - COMMAND(screenres, ARG_2INT); VARFP(gamma, 30, 100, 300, diff --git a/source/src/rendertext.cpp b/source/src/rendertext.cpp index e013553c..5502b9dd 100644 --- a/source/src/rendertext.cpp +++ b/source/src/rendertext.cpp @@ -190,7 +190,7 @@ void draw_text(const char *str, int left, int top) case '0': glColor3ub(64, 255, 128); continue; // green: player talk case '1': glColor3ub(96, 160, 255); continue; // blue: team chat case '2': glColor3ub(255, 192, 64); continue; // yellow: gameplay action messages, only actions done by players - case '3': glColor3ub(255, 64, 64); continue; // red: important errors + case '3': glColor3ub(255, 64, 64); continue; // red: important errors and notes case '4': glColor3ub(128, 128, 128); continue; // gray case '5': glColor3ub(255, 255, 255); continue; // white: everything else case '6': glColor3ub(192, 64, 192); continue; // magenta