From 7a0582aee2e504c872aa344678e016ddb763a51b Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Mon, 14 May 2007 16:24:01 +0000 Subject: [PATCH] When running in fullscreen mode, you may now ask Tux Paint to display at the screen's (more precisely, the operating system's) current resolution. --- docs/CHANGES.txt | 8 +++++- docs/OPTIONS.txt | 13 ++++++++- docs/html/OPTIONS.html | 16 ++++++++++- src/tuxpaint.c | 65 ++++++++++++++++++++++++++++++++++++------ 4 files changed, 90 insertions(+), 12 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 8ccceffaa..9cb00bef0 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -9,7 +9,7 @@ http://www.newbreedsoftware.com/tuxpaint/ $Id$ -2007.May.3 (0.9.17) +2007.May.14 (0.9.17) * Tool Improvements: ------------------ @@ -54,6 +54,12 @@ $Id$ + Star + Triangle (up and down) + * System-related improvements: + ---------------------------- + * When running in fullscreen mode, you may now ask Tux Paint to display + at the screen's (more precisely, the operating system's) current + resolution. Either use both "fullscreen=yes" and "native=yes" in the + config file, or "--fullscreen --native" on the command-line. * Documentation Improvements: --------------------------- diff --git a/docs/OPTIONS.txt b/docs/OPTIONS.txt index 0a85e0092..342dc52c5 100644 --- a/docs/OPTIONS.txt +++ b/docs/OPTIONS.txt @@ -9,7 +9,7 @@ bill@newbreedsoftware.com http://www.tuxpaint.org/ - May 6, 2007 + May 14, 2007 -------------------------------------------------------------------------- @@ -71,6 +71,10 @@ Windows Users fullscreen=yes Run the program in full screen mode, rather than in a window. + fullscreen=native + Run the program in full screen mode. Additionally, assume the + screen's current resolution (set by the operating system). + windowsize=SIZE Run the program at a different size (in windowed mode) or at a @@ -89,6 +93,12 @@ Windows Users * 768x1024 * 1600x1200 + native=yes + + When running Tux Paint in fullscreen mode, this assumes the + screen's current resolution (overriding any "windowsize" + option), as set by the operating system. + nosound=yes Disable sound effects. (Note: Pressing [Alt] + [S] cannot be used to reenable sounds if they were disabled using this @@ -528,6 +538,7 @@ Windows Users --fullscreen --WIDTHxHEIGHT + --native --startblank --nosound --noquit diff --git a/docs/html/OPTIONS.html b/docs/html/OPTIONS.html index 205300729..eb3da3068 100644 --- a/docs/html/OPTIONS.html +++ b/docs/html/OPTIONS.html @@ -23,7 +23,7 @@ New Breed Software

http://www.tuxpaint.org/

-

May 6, 2007

+

May 14, 2007

@@ -105,6 +105,12 @@ New Breed Software

Run the program in full screen mode, rather than in a window. +
fullscreen=native
+
+ Run the program in full screen mode. Additionally, assume the + screen's current resolution (set by the operating system). +
+
windowsize=SIZE

Run the program at a different size (in windowed mode) or @@ -125,6 +131,13 @@ New Breed Software

+
native=yes
+
+

When running Tux Paint in fullscreen mode, this + assumes the screen's current resolution (overriding any + "windowsize" option), as set by the operating system. +

+
nosound=yes
Disable sound effects. (Note: Pressing [Alt] + [S] @@ -841,6 +854,7 @@ New Breed Software

--fullscreen
--WIDTHxHEIGHT
+ --native
--startblank
--nosound
--noquit
diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 518248d8f..8c904b945 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - June 14, 2002 - May 10, 2007 + June 14, 2002 - May 14, 2007 $Id$ */ @@ -799,7 +799,7 @@ static void update_canvas(int x1, int y1, int x2, int y2) /* Globals: */ -static int fullscreen, disable_quit, simple_shapes, +static int fullscreen, native_screensize, disable_quit, simple_shapes, disable_print, print_delay, only_uppercase, promptless_save, grab_input, wheely, keymouse, mouse_x, mouse_y, mousekey_up, mousekey_down, mousekey_left, mousekey_right, @@ -5311,8 +5311,7 @@ static void show_usage(FILE * f, char *prg) "Usage: %s {--usage | --help | --version | --copying}\n" "\n" " %s [--windowed | --fullscreen]\n" - " %s [--640x480 | --800x600 | --1024x768 |\n" - " %s --1280x1024 | --1400x1050 | --1600x1200]\n" + " %s [--WIDTHxHEIGHT | --native]\n" " %s [--startblank | --startlast ]\n" " %s [--sound | --nosound] [--quit | --noquit]\n" " %s [--print | --noprint] [--complexshapes | --simpleshapes]\n" @@ -5339,7 +5338,7 @@ static void show_usage(FILE * f, char *prg) prg, prg, blank, blank, blank, blank, blank, blank, - blank, blank, blank, blank, blank, blank, blank, blank, blank, + blank, blank, blank, blank, blank, blank, blank, blank, #ifdef WIN32 blank, #endif @@ -6047,6 +6046,7 @@ static void setup(int argc, char *argv[]) #else fullscreen = 0; #endif + native_screensize = 0; noshortcuts = 0; dont_do_xor = 0; keymouse = 0; @@ -6273,6 +6273,10 @@ static void setup(int argc, char *argv[]) WINDOW_WIDTH = w; WINDOW_HEIGHT = h; } + else if (strcmp(argv[i], "--native") == 0) + { + native_screensize = 1; + } else if (strcmp(argv[i], "--nooutlines") == 0) { dont_do_xor = 1; @@ -6872,9 +6876,6 @@ static void setup(int argc, char *argv[]) } - setup_screen_layout(); - - /* Set window icon and caption: */ #ifndef __APPLE__ @@ -6886,6 +6887,23 @@ static void setup(int argc, char *argv[]) SDL_ShowCursor (SDL_DISABLE); #endif + + /* Deal with 'native' screen size option */ + + if (native_screensize) + { + if (!fullscreen) + { + fprintf(stderr, "Warning: Asking for native screensize in a window. Ignoring.\n"); + } + else + { + WINDOW_WIDTH = 0; + WINDOW_HEIGHT = 0; + } + } + + /* Open Window: */ if (fullscreen) @@ -6907,6 +6925,16 @@ static void setup(int argc, char *argv[]) fullscreen = 0; } + else + { + /* Get resolution if we asked for native: */ + + if (native_screensize) + { + WINDOW_WIDTH = screen->w; + WINDOW_HEIGHT = screen->h; + } + } } @@ -6937,6 +6965,11 @@ static void setup(int argc, char *argv[]) } + /* (Need to do this after native screen resolution is handled) */ + + setup_screen_layout(); + + ////////// quickly: title image, version, progress bar, and watch cursor img_title = loadimage(DATA_PREFIX "images/title.png"); @@ -10196,7 +10229,8 @@ static void strip_trailing_whitespace(char *buf) static char *loaddesc(const char *const fname, Uint8 * locale_text) { char *txt_fname, *extptr; - char buf[512], def_buf[512]; // doubled to 512 per TOYAMA Shin-Ichi's requested; -bjk 2007.05.10 + char buf[512], def_buf[512]; // doubled to 512 per TOYAMA Shin-Ichi's reque +sted; -bjk 2007.05.10 int found, got_first; FILE *fi; @@ -15243,6 +15277,19 @@ static void parse_options(FILE * fi) { fullscreen = 1; } + else if (strcmp(str, "fullscreen=native") == 0) + { + fullscreen = 1; + native_screensize = 1; + } + else if (strcmp(str, "native=yes") == 0) + { + native_screensize = 1; + } + else if (strcmp(str, "native=no") == 0) + { + native_screensize = 0; + } else if (strcmp(str, "fullscreen=no") == 0 || strcmp(str, "windowed=yes") == 0) {