rnd-20070125-1-src
authorHolger Schemel <info@artsoft.org>
Thu, 25 Jan 2007 02:13:06 +0000 (03:13 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:54:14 +0000 (10:54 +0200)
12 files changed:
src/Makefile
src/conf_gfx.c
src/conf_gfx.h
src/config.c
src/config.h
src/conftime.h
src/game.c
src/init.c
src/libgame/platform.h
src/main.c
src/main.h
src/screens.c

index 5c273676726ba290a4a7cf5743181bbec63ff967..ee0da818ba6bf2f5e6fb2a451e3e9af04773b92b 100644 (file)
@@ -251,7 +251,7 @@ conf_mus.h: conf_mus.c
        @$(MAKE) auto-conf
 
 $(TIMESTAMP_FILE): $(SRCS) $(LIBGAME) $(GAME_EM)
-       @date '+"[%Y-%m-%d %H:%M]"' \
+       @date '+"%Y-%m-%d %H:%M"' \
        | sed -e 's/^/#define COMPILE_DATE_STRING /' \
        > $(TIMESTAMP_FILE)
 
index d21f22ec0cff55f51e7ff734bca19d8a6788fb65..333a842624df92f9c065d925aadd9d66ffaec6bb 100644 (file)
@@ -4929,6 +4929,7 @@ struct ConfigInfo image_config[] =
   { "background.INFO[MUSIC]",                  UNDEFINED_FILENAME      },
   { "background.INFO[CREDITS]",                        UNDEFINED_FILENAME      },
   { "background.INFO[PROGRAM]",                        UNDEFINED_FILENAME      },
+  { "background.INFO[VERSION]",                        UNDEFINED_FILENAME      },
   { "background.INFO[LEVELSET]",               UNDEFINED_FILENAME      },
   { "background.SETUP",                                UNDEFINED_FILENAME      },
   { "background.DOOR",                         UNDEFINED_FILENAME      },
@@ -4987,6 +4988,8 @@ struct ConfigInfo image_config[] =
   { "menu.draw_yoffset.INFO[CREDITS]",         "0"                     },
   { "menu.draw_xoffset.INFO[PROGRAM]",         "0"                     },
   { "menu.draw_yoffset.INFO[PROGRAM]",         "0"                     },
+  { "menu.draw_xoffset.INFO[VERSION]",         "0"                     },
+  { "menu.draw_yoffset.INFO[VERSION]",         "0"                     },
   { "menu.draw_xoffset.INFO[LEVELSET]",                "0"                     },
   { "menu.draw_yoffset.INFO[LEVELSET]",                "0"                     },
   { "menu.draw_xoffset.SETUP",                 "0"                     },
index 4ed38dbb16d355a1536b6d63843d1e47c360bfe4..04787c51c550634a428ef684d1aeb75fc0811544 100644 (file)
 #define IMG_BACKGROUND_INFO_MUSIC                      1722
 #define IMG_BACKGROUND_INFO_CREDITS                    1723
 #define IMG_BACKGROUND_INFO_PROGRAM                    1724
-#define IMG_BACKGROUND_INFO_LEVELSET                   1725
-#define IMG_BACKGROUND_SETUP                           1726
-#define IMG_BACKGROUND_DOOR                            1727
-#define IMG_TITLESCREEN_INITIAL_1                      1728
-#define IMG_TITLESCREEN_INITIAL_2                      1729
-#define IMG_TITLESCREEN_INITIAL_3                      1730
-#define IMG_TITLESCREEN_INITIAL_4                      1731
-#define IMG_TITLESCREEN_INITIAL_5                      1732
-#define IMG_TITLESCREEN_1                              1733
-#define IMG_TITLESCREEN_2                              1734
-#define IMG_TITLESCREEN_3                              1735
-#define IMG_TITLESCREEN_4                              1736
-#define IMG_TITLESCREEN_5                              1737
+#define IMG_BACKGROUND_INFO_VERSION                    1725
+#define IMG_BACKGROUND_INFO_LEVELSET                   1726
+#define IMG_BACKGROUND_SETUP                           1727
+#define IMG_BACKGROUND_DOOR                            1728
+#define IMG_TITLESCREEN_INITIAL_1                      1729
+#define IMG_TITLESCREEN_INITIAL_2                      1730
+#define IMG_TITLESCREEN_INITIAL_3                      1731
+#define IMG_TITLESCREEN_INITIAL_4                      1732
+#define IMG_TITLESCREEN_INITIAL_5                      1733
+#define IMG_TITLESCREEN_1                              1734
+#define IMG_TITLESCREEN_2                              1735
+#define IMG_TITLESCREEN_3                              1736
+#define IMG_TITLESCREEN_4                              1737
+#define IMG_TITLESCREEN_5                              1738
 
-#define NUM_IMAGE_FILES                                        1738
+#define NUM_IMAGE_FILES                                        1739
 
 #endif /* CONF_GFX_H */
index deea1f84983a704c3986ffd58dbfeda10ead15ca..5e8add2a31620885c21728b482c33e2abd724493 100644 (file)
 #include "conftime.h"
 
 
-char *getProgramVersionString()
+char *getCompileDateString()
+{
+  return COMPILE_DATE_STRING;
+}
+
+char *getProgramReleaseVersionString()
+{
+  static char program_version_string[32];
+
+  sprintf(program_version_string, "%d.%d.%d",
+         PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, PROGRAM_VERSION_PATCH);
+
+  return program_version_string;
+}
+
+char *getProgramFullVersionString()
 {
   static char program_version_string[32];
 
-#ifdef DEBUG
   sprintf(program_version_string, "%d.%d.%d-%d",
          PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, PROGRAM_VERSION_PATCH,
          PROGRAM_VERSION_BUILD);
-#else
-  sprintf(program_version_string, "%d.%d.%d",
-         PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, PROGRAM_VERSION_PATCH);
-#endif
 
   return program_version_string;
 }
 
+char *getProgramVersionString()
+{
+#ifdef DEBUG
+  return getProgramFullVersionString();
+#else
+  return getProgramReleaseVersionString();
+#endif
+}
+
 char *getProgramInitString()
 {
   static char *program_init_string = NULL;
@@ -58,10 +77,10 @@ char *getWindowTitleString()
   if (window_title_string == NULL)
   {
     window_title_string = checked_malloc(strlen(getProgramInitString()) + 1 +
-                                        strlen(COMPILE_DATE_STRING) + 1);
+                                        strlen(getCompileDateString()) + 2 +1);
 
-    sprintf(window_title_string, "%s %s",
-           getProgramInitString(), COMPILE_DATE_STRING);
+    sprintf(window_title_string, "%s [%s]",
+           getProgramInitString(), getCompileDateString());
   }
 
   return window_title_string;
index 326ca2760971adf2845266157c03a69a8caaa00f..ac24bb1fa2ac49366de4ae662ef23db7bdf3746e 100644 (file)
@@ -16,6 +16,9 @@
 
 #include "main.h"
 
+char *getCompileDateString(void);
+char *getProgramReleaseVersionString(void);
+char *getProgramFullVersionString(void);
 char *getProgramVersionString(void);
 char *getProgramInitString(void);
 char *getWindowTitleString(void);
index 190f6d066aa110d476416676e0d08edadd016c53..a7fc3e08838fe06bb91536311f7c31cafb75e4e0 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2007-01-24 22:14]"
+#define COMPILE_DATE_STRING "2007-01-25 03:07"
index 3652cc99beaa7b21ce567dd691abd531f83d0081..bb6e6ede2b2d259978b05380fef26368630f6027 100644 (file)
@@ -10568,13 +10568,30 @@ void ScrollLevel(int dx, int dy)
   int softscroll_offset = (setup.soft_scrolling ? TILEX : 0);
   int x, y;
 
+#if 1
+  BlitBitmap(drawto_field, bitmap_db_field2,
+            FX + TILEX * (dx == -1) - softscroll_offset,
+            FY + TILEY * (dy == -1) - softscroll_offset,
+            SXSIZE - TILEX * (dx != 0) + 2 * softscroll_offset,
+            SYSIZE - TILEY * (dy != 0) + 2 * softscroll_offset,
+            FX + TILEX * (dx == 1) - softscroll_offset,
+            FY + TILEY * (dy == 1) - softscroll_offset);
+  BlitBitmap(bitmap_db_field2, drawto_field,
+            FX + TILEX * (dx == 1) - softscroll_offset,
+            FY + TILEY * (dy == 1) - softscroll_offset,
+            SXSIZE - TILEX * (dx != 0) + 2 * softscroll_offset,
+            SYSIZE - TILEY * (dy != 0) + 2 * softscroll_offset,
+            FX + TILEX * (dx == 1) - softscroll_offset,
+            FY + TILEY * (dy == 1) - softscroll_offset);
+#else
   BlitBitmap(drawto_field, drawto_field,
             FX + TILEX * (dx == -1) - softscroll_offset,
             FY + TILEY * (dy == -1) - softscroll_offset,
-            SXSIZE - TILEX * (dx!=0) + 2 * softscroll_offset,
-            SYSIZE - TILEY * (dy!=0) + 2 * softscroll_offset,
+            SXSIZE - TILEX * (dx != 0) + 2 * softscroll_offset,
+            SYSIZE - TILEY * (dy != 0) + 2 * softscroll_offset,
             FX + TILEX * (dx == 1) - softscroll_offset,
             FY + TILEY * (dy == 1) - softscroll_offset);
+#endif
 
   if (dx)
   {
index 49006fa1f8d547466c514a458bc3f3bc927d7ce0..6487cb0b3c3ec095b14df599b29ce4119132c7bb 100644 (file)
@@ -4718,6 +4718,7 @@ void InitGfx()
   /* create additional image buffers for double-buffering and cross-fading */
   bitmap_db_cross = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH);
   bitmap_db_field = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH);
+  bitmap_db_field2= CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH);
   bitmap_db_panel = CreateBitmap(DXSIZE, DYSIZE, DEFAULT_DEPTH);
   bitmap_db_door  = CreateBitmap(3 * DXSIZE, DYSIZE + VYSIZE, DEFAULT_DEPTH);
 
index d8773420bb4a8b18cf23398364d16f49d178f15e..7ac79f3bbeb2f43ab13376aa12b414a0e21abbe5 100644 (file)
 
 #if defined(MSDOS)
 #define PLATFORM_MSDOS
+#define PLATFORM_STRING "DOS"
 #elif defined(WIN32)
 #define PLATFORM_WIN32
+#define PLATFORM_STRING "Windows"
 #else
 #define PLATFORM_UNIX
+#define PLATFORM_STRING "Unix"
 #endif
 
 
 
 #if defined(linux)
 #define PLATFORM_LINUX
+#undef  PLATFORM_STRING
+#define PLATFORM_STRING "Linux"
 #endif
 
 #if defined(__FreeBSD__)
 #define PLATFORM_FREEBSD
 #define PLATFORM_BSD
+#undef  PLATFORM_STRING
+#define PLATFORM_STRING "FreeBSD"
 #endif
 
 #if defined(__NetBSD__)
 #define PLATFORM_NETBSD
 #define PLATFORM_BSD
+#undef  PLATFORM_STRING
+#define PLATFORM_STRING "NetBSD"
 #endif
 
 #if defined(__bsdi__)
 #define PLATFORM_BSDI
 #define PLATFORM_BSD
+#undef  PLATFORM_STRING
+#define PLATFORM_STRING "BSDI"
 #endif
 
 #if defined(sparc) && defined(sun)
 #define PLATFORM_SUNOS
+#undef  PLATFORM_STRING
+#define PLATFORM_STRING "Solaris"
 #endif
 
 #if defined(__APPLE__) && defined(__MACH__)
 #define PLATFORM_MACOSX
+#undef  PLATFORM_STRING
+#define PLATFORM_STRING "Mac OS X"
 #endif
 
 #if defined(NeXT)
 #define PLATFORM_NEXT
+#undef  PLATFORM_STRING
+#define PLATFORM_STRING "NeXT"
 #endif
 
 /* detecting HP-UX by the following compiler keyword definitions:
 
 #if defined(__hpux__) || defined(__hpux) || defined(hpux)
 #define PLATFORM_HPUX
+#undef  PLATFORM_STRING
+#define PLATFORM_STRING "HP-UX"
 #endif
 
 
 #define NETWORK_AVALIABLE
 #endif
 
-
 #endif /* PLATFORM_H */
index 2e4fb74035a34b80e70c1f96d6cf638e32524c2d..7f0eca2ea7347441434be0de1e6081442c8c565d 100644 (file)
@@ -22,6 +22,7 @@
 
 Bitmap                *bitmap_db_cross;
 Bitmap                *bitmap_db_field;
+Bitmap                *bitmap_db_field2;
 Bitmap                *bitmap_db_panel;
 Bitmap                *bitmap_db_door;
 DrawBuffer            *fieldbuffer;
@@ -5428,6 +5429,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_PROGRAM]                    },
   { "menu.draw_yoffset.INFO[PROGRAM]",
     &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_PROGRAM]                    },
+  { "menu.draw_xoffset.INFO[VERSION]",
+    &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_VERSION]                    },
+  { "menu.draw_yoffset.INFO[VERSION]",
+    &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_VERSION]                    },
   { "menu.draw_xoffset.INFO[LEVELSET]",
     &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_LEVELSET]                   },
   { "menu.draw_yoffset.INFO[LEVELSET]",
index 37742d7884d875498cfe7b62f5a76c94674a76a2..d07b005f3dda4acc05a7b003259329fd9004b0f5 100644 (file)
 #define GFX_SPECIAL_ARG_INFO_MUSIC     3
 #define GFX_SPECIAL_ARG_INFO_CREDITS   4
 #define GFX_SPECIAL_ARG_INFO_PROGRAM   5
-#define GFX_SPECIAL_ARG_INFO_LEVELSET  6
+#define GFX_SPECIAL_ARG_INFO_VERSION   6
+#define GFX_SPECIAL_ARG_INFO_LEVELSET  7
 
-#define NUM_SPECIAL_GFX_INFO_ARGS      7
+#define NUM_SPECIAL_GFX_INFO_ARGS      8
 
 
 /* values for image configuration suffixes */
@@ -2558,6 +2559,7 @@ struct HelpAnimInfo
 
 extern Bitmap                 *bitmap_db_cross;
 extern Bitmap                 *bitmap_db_field;
+extern Bitmap                 *bitmap_db_field2;
 extern Bitmap                 *bitmap_db_panel;
 extern Bitmap                 *bitmap_db_door;
 extern Pixmap                  tile_clipmask[];
index fa44e771c24fd1632412edd15630c186f533aaca..bd5eb569e6954b7698e639910e039fb983d55afa 100644 (file)
@@ -23,6 +23,7 @@
 #include "cartoons.h"
 #include "network.h"
 #include "init.h"
+#include "config.h"
 
 /* screens in the setup menu */
 #define SETUP_MODE_MAIN                        0
 #define INFO_MODE_MUSIC                        3
 #define INFO_MODE_CREDITS              4
 #define INFO_MODE_PROGRAM              5
-#define INFO_MODE_LEVELSET             6
+#define INFO_MODE_VERSION              6
+#define INFO_MODE_LEVELSET             7
 
-#define MAX_INFO_MODES                 7
+#define MAX_INFO_MODES                 8
 
 /* for various menu stuff  */
 #define MENU_SCREEN_START_XPOS         1
@@ -153,6 +155,7 @@ static void HandleInfoScreen_Elements(int);
 static void HandleInfoScreen_Music(int);
 static void HandleInfoScreen_Credits(int);
 static void HandleInfoScreen_Program(int);
+static void HandleInfoScreen_Version(int);
 
 static void MapScreenMenuGadgets(int);
 static void MapScreenTreeGadgets(TreeInfo *);
@@ -809,7 +812,7 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading)
   /* needed if last screen (level choice) changed graphics, sounds or music */
   ReloadCustomArtwork(0);
 
-#ifdef TARGET_SDL
+#if defined(TARGET_SDL)
   SetDrawtoField(DRAW_BACKBUFFER);
 #endif
 
@@ -1506,6 +1509,12 @@ static void execInfoProgram()
   DrawInfoScreen();
 }
 
+static void execInfoVersion()
+{
+  info_mode = INFO_MODE_VERSION;
+  DrawInfoScreen();
+}
+
 static void execInfoLevelSet()
 {
   info_mode = INFO_MODE_LEVELSET;
@@ -1525,6 +1534,7 @@ static struct TokenInfo info_info_main[] =
   { TYPE_ENTER_SCREEN, execInfoMusic,          "Music Info"            },
   { TYPE_ENTER_SCREEN, execInfoCredits,        "Credits"               },
   { TYPE_ENTER_SCREEN, execInfoProgram,        "Program Info"          },
+  { TYPE_ENTER_SCREEN, execInfoVersion,        "Version Info"          },
   { TYPE_ENTER_SCREEN, execInfoLevelSet,       "Level Set Info"        },
   { TYPE_EMPTY,                NULL,                   ""                      },
   { TYPE_LEAVE_MENU,   execExitInfo,           "Exit"                  },
@@ -2451,6 +2461,144 @@ void HandleInfoScreen_Program(int button)
   }
 }
 
+void DrawInfoScreen_Version()
+{
+  int font_header = FONT_TEXT_3;
+  int font_text = FONT_TEXT_2;
+  int xstep = getFontWidth(font_text);
+  int ystep = getFontHeight(font_text);
+  int xstart1 = SX + 2 * xstep;
+  int xstart2 = SX + 18 * xstep;
+  int xstart3 = SX + 28 * xstep;
+  int ystart = 150;
+  int ybottom = SYSIZE - 20;
+#if defined(TARGET_SDL)
+  SDL_version sdl_version_compiled;
+  const SDL_version *sdl_version_linked;
+#endif
+
+  SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_PROGRAM);
+
+  FadeOut(REDRAW_FIELD);
+
+  ClearWindow();
+  DrawHeadline();
+
+  DrawTextSCentered(100, FONT_TEXT_1, "Version Information:");
+
+  DrawTextF(xstart1, ystart, font_header, "Name");
+  DrawTextF(xstart2, ystart, font_text, PROGRAM_TITLE_STRING);
+
+  ystart += ystep;
+  DrawTextF(xstart1, ystart, font_header, "Version");
+  DrawTextF(xstart2, ystart, font_text, getProgramFullVersionString());
+
+  ystart += ystep;
+  DrawTextF(xstart1, ystart, font_header, "Platform");
+  DrawTextF(xstart2, ystart, font_text, PLATFORM_STRING);
+
+  ystart += ystep;
+  DrawTextF(xstart1, ystart, font_header, "Target");
+  DrawTextF(xstart2, ystart, font_text, TARGET_STRING);
+
+  ystart += ystep;
+  DrawTextF(xstart1, ystart, font_header, "Compile time");
+  DrawTextF(xstart2, ystart, font_text, getCompileDateString());
+
+#if defined(TARGET_SDL)
+  ystart += 3 * ystep;
+  DrawTextF(xstart1, ystart, font_header, "Library");
+  DrawTextF(xstart2, ystart, font_header, "compiled");
+  DrawTextF(xstart3, ystart, font_header, "linked");
+
+  SDL_VERSION(&sdl_version_compiled);
+  sdl_version_linked = SDL_Linked_Version();
+
+  ystart += 2 * ystep;
+  DrawTextF(xstart1, ystart, font_text, "SDL");
+  DrawTextF(xstart2, ystart, font_text, "%d.%d.%d",
+           sdl_version_compiled.major,
+           sdl_version_compiled.minor,
+           sdl_version_compiled.patch);
+  DrawTextF(xstart3, ystart, font_text, "%d.%d.%d",
+           sdl_version_linked->major,
+           sdl_version_linked->minor,
+           sdl_version_linked->patch);
+
+  SDL_IMAGE_VERSION(&sdl_version_compiled);
+#if 0
+  sdl_version_linked = IMG_Linked_Version();
+#else
+#endif
+
+  ystart += ystep;
+  DrawTextF(xstart1, ystart, font_text, "SDL_image");
+  DrawTextF(xstart2, ystart, font_text, "%d.%d.%d",
+           sdl_version_compiled.major,
+           sdl_version_compiled.minor,
+           sdl_version_compiled.patch);
+#if 0
+  DrawTextF(xstart3, ystart, font_text, "%d.%d.%d",
+           sdl_version_linked->major,
+           sdl_version_linked->minor,
+           sdl_version_linked->patch);
+#else
+  DrawTextF(xstart3, ystart, font_text, "?.?.?");
+#endif
+
+  SDL_MIXER_VERSION(&sdl_version_compiled);
+  sdl_version_linked = Mix_Linked_Version();
+
+  ystart += ystep;
+  DrawTextF(xstart1, ystart, font_text, "SDL_mixer");
+  DrawTextF(xstart2, ystart, font_text, "%d.%d.%d",
+           sdl_version_compiled.major,
+           sdl_version_compiled.minor,
+           sdl_version_compiled.patch);
+  DrawTextF(xstart3, ystart, font_text, "%d.%d.%d",
+           sdl_version_linked->major,
+           sdl_version_linked->minor,
+           sdl_version_linked->patch);
+
+  ystart += ystep;
+  DrawTextF(xstart1, ystart, font_text, "SDL_net");
+  DrawTextF(xstart2, ystart, font_text, "?.?.?");
+  DrawTextF(xstart3, ystart, font_text, "?.?.?");
+#endif
+
+  DrawTextSCentered(ybottom, FONT_TEXT_4,
+                   "Press any key or button for info menu");
+
+  FadeIn(REDRAW_FIELD);
+}
+
+void HandleInfoScreen_Version(int button)
+{
+  if (button == MB_MENU_LEAVE)
+  {
+    PlaySound(SND_MENU_ITEM_SELECTING);
+
+    info_mode = INFO_MODE_MAIN;
+    DrawInfoScreen();
+
+    return;
+  }
+  else if (button == MB_MENU_CHOICE)
+  {
+    PlaySound(SND_MENU_ITEM_SELECTING);
+
+    FadeSoundsAndMusic();
+    FadeOut(REDRAW_FIELD);
+
+    info_mode = INFO_MODE_MAIN;
+    DrawAndFadeInInfoScreen(REDRAW_FIELD);
+  }
+  else
+  {
+    PlayMenuSoundIfLoop();
+  }
+}
+
 void DrawInfoScreen_LevelSet()
 {
   int ystart = 150;
@@ -2533,6 +2681,8 @@ static void DrawInfoScreenExt(int redraw_mask, boolean do_fading)
     DrawInfoScreen_Credits();
   else if (info_mode == INFO_MODE_PROGRAM)
     DrawInfoScreen_Program();
+  else if (info_mode == INFO_MODE_VERSION)
+    DrawInfoScreen_Version();
   else if (info_mode == INFO_MODE_LEVELSET)
     DrawInfoScreen_LevelSet();
   else
@@ -2569,6 +2719,8 @@ void HandleInfoScreen(int mx, int my, int dx, int dy, int button)
     HandleInfoScreen_Credits(button);
   else if (info_mode == INFO_MODE_PROGRAM)
     HandleInfoScreen_Program(button);
+  else if (info_mode == INFO_MODE_VERSION)
+    HandleInfoScreen_Version(button);
   else if (info_mode == INFO_MODE_LEVELSET)
     HandleInfoScreen_LevelSet(button);
   else