rnd-20140115-1-src
authorHolger Schemel <info@artsoft.org>
Wed, 15 Jan 2014 18:23:46 +0000 (19:23 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 09:00:36 +0000 (11:00 +0200)
* fixed bug when displaying game envelope with even sized playfield

ChangeLog
src/conftime.h
src/libgame/misc.c
src/libgame/misc.h
src/screens.c

index d6269f26380e07ba96cb8ecfc9073525e6a0a054..5d35816c59f139ffc2f077a0c0026ad8bac5ae40 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
 2014-01-14
+       * fixed bug when displaying game envelope with even sized playfield
        * added graphic configuration options for request (dialog) buttons
 
+2014-01-13
+       * fixed some redraw bugs with window scaling under Mac OS X
+
+2014-01-10
+       * fixed problems with window scaling and updating related setup value
+
 2014-01-07
        * fixed problems related to fullscreen switching and window scaling
 
index 6513193484da54d0d0cfbb0004f0104b112bf0b9..2921eb0c0fafb9b71b61d44572abe93d13786dbf 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2014-01-14 23:33"
+#define COMPILE_DATE_STRING "2014-01-15 19:23"
index ae4b5d78e797c470863e88e09313172700eeca0d..38c062dec0724f267527d79649c54c78e8bfb1fc 100644 (file)
@@ -708,7 +708,7 @@ char *getPath3(char *path1, char *path2, char *path3)
   return getStringCat3WithSeparator(path1, path2, path3, STRING_PATH_SEPARATOR);
 }
 
-char *getStringCopy(char *s)
+char *getStringCopy(const char *s)
 {
   char *s_copy;
 
@@ -721,7 +721,7 @@ char *getStringCopy(char *s)
   return s_copy;
 }
 
-char *getStringCopyN(char *s, int n)
+char *getStringCopyN(const char *s, int n)
 {
   char *s_copy;
   int s_len = MAX(0, n);
@@ -736,7 +736,18 @@ char *getStringCopyN(char *s, int n)
   return s_copy;
 }
 
-char *getStringToLower(char *s)
+char *getStringCopyNStatic(const char *s, int n)
+{
+  static char *s_copy = NULL;
+
+  checked_free(s_copy);
+
+  s_copy = getStringCopyN(s, n);
+
+  return s_copy;
+}
+
+char *getStringToLower(const char *s)
 {
   char *s_copy = checked_malloc(strlen(s) + 1);
   char *s_ptr = s_copy;
@@ -1057,15 +1068,17 @@ void GetOptions(char *argv[], void (*print_usage_function)(void))
 /* error handling functions                                                  */
 /* ------------------------------------------------------------------------- */
 
+#define MAX_INTERNAL_ERROR_SIZE                1024
+
 /* used by SetError() and GetError() to store internal error messages */
-static char internal_error[1024];      /* this is bad */
+static char internal_error[MAX_INTERNAL_ERROR_SIZE];
 
 void SetError(char *format, ...)
 {
   va_list ap;
 
   va_start(ap, format);
-  vsprintf(internal_error, format, ap);
+  vsnprintf(internal_error, MAX_INTERNAL_ERROR_SIZE, format, ap);
   va_end(ap);
 }
 
index b2d84573b16e19e4d7161707dd4b1bac3e899f88..98cc3fe12670a6a60d67fc18b063d9b976e8ab4f 100644 (file)
@@ -154,9 +154,10 @@ char *getStringCat2(char *, char *);
 char *getStringCat3(char *, char *, char *);
 char *getPath2(char *, char *);
 char *getPath3(char *, char *, char*);
-char *getStringCopy(char *);
-char *getStringCopyN(char *, int);
-char *getStringToLower(char *);
+char *getStringCopy(const char *);
+char *getStringCopyN(const char *, int);
+char *getStringCopyNStatic(const char *, int);
+char *getStringToLower(const char *);
 void setString(char **, char *);
 boolean strEqual(char *, char *);
 boolean strEqualN(char *, char *, int);
index d3cb7b1f806b76902d6fd7c982a7f2da5e756e10..6543e1688174a3926e792a91652c81cd859c9d52 100644 (file)
@@ -2992,19 +2992,17 @@ void DrawInfoScreen_Version()
   int ystart1 = mSY - SY + 100;
   int ystart2 = mSY - SY + 150;
   int ybottom = mSY - SY + SYSIZE - 20;
-  int xstart1 = mSX + 2 * xstep;
-  int xstart2 = mSX + 19 * xstep;
+  int xstart1 = mSX - SX + 2 * xstep;
+  int xstart2 = mSX - SX + 18 * xstep;
 #if defined(TARGET_SDL)
-  int xstart3 = mSX + 29 * xstep;
+  int xstart3 = mSX - SX + 28 * xstep;
   SDL_version sdl_version_compiled;
-#if defined(TARGET_SDL2)
-  SDL_version sdl_version_linked_ext;
-#endif
   const SDL_version *sdl_version_linked;
+  int driver_name_len = 10;
 #if defined(TARGET_SDL2)
+  SDL_version sdl_version_linked_ext;
   const char *driver_name = NULL;
 #else
-  int driver_name_len = 8;
   char driver_name[driver_name_len];
 #endif
 #endif
@@ -3112,7 +3110,7 @@ void DrawInfoScreen_Version()
   DrawTextF(xstart3, ystart2, font_header, "Used");
 
 #if defined(TARGET_SDL2)
-  driver_name = SDL_GetVideoDriver(0);
+  driver_name = getStringCopyNStatic(SDL_GetVideoDriver(0), driver_name_len);
 #else
   SDL_VideoDriverName(driver_name, driver_name_len);
 #endif
@@ -3123,7 +3121,7 @@ void DrawInfoScreen_Version()
   DrawTextF(xstart3, ystart2, font_text, "%s", driver_name);
 
 #if defined(TARGET_SDL2)
-  driver_name = SDL_GetAudioDriver(0);
+  driver_name = getStringCopyNStatic(SDL_GetAudioDriver(0), driver_name_len);
 #else
   SDL_AudioDriverName(driver_name, driver_name_len);
 #endif