From: Holger Schemel Date: Thu, 25 Jan 2007 02:13:06 +0000 (+0100) Subject: rnd-20070125-1-src X-Git-Tag: 3.2.4^2~102 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=dff0e0c8702770fe23992f07964ebe9ed54e9f7c;p=rocksndiamonds.git rnd-20070125-1-src --- diff --git a/src/Makefile b/src/Makefile index 5c273676..ee0da818 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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) diff --git a/src/conf_gfx.c b/src/conf_gfx.c index d21f22ec..333a8426 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -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" }, diff --git a/src/conf_gfx.h b/src/conf_gfx.h index 4ed38dbb..04787c51 100644 --- a/src/conf_gfx.h +++ b/src/conf_gfx.h @@ -1743,20 +1743,21 @@ #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 */ diff --git a/src/config.c b/src/config.c index deea1f84..5e8add2a 100644 --- a/src/config.c +++ b/src/config.c @@ -17,22 +17,41 @@ #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; diff --git a/src/config.h b/src/config.h index 326ca276..ac24bb1f 100644 --- a/src/config.h +++ b/src/config.h @@ -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); diff --git a/src/conftime.h b/src/conftime.h index 190f6d06..a7fc3e08 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2007-01-24 22:14]" +#define COMPILE_DATE_STRING "2007-01-25 03:07" diff --git a/src/game.c b/src/game.c index 3652cc99..bb6e6ede 100644 --- a/src/game.c +++ b/src/game.c @@ -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) { diff --git a/src/init.c b/src/init.c index 49006fa1..6487cb0b 100644 --- a/src/init.c +++ b/src/init.c @@ -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); diff --git a/src/libgame/platform.h b/src/libgame/platform.h index d8773420..7ac79f3b 100644 --- a/src/libgame/platform.h +++ b/src/libgame/platform.h @@ -20,10 +20,13 @@ #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 @@ -54,33 +57,47 @@ #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: @@ -91,6 +108,8 @@ #if defined(__hpux__) || defined(__hpux) || defined(hpux) #define PLATFORM_HPUX +#undef PLATFORM_STRING +#define PLATFORM_STRING "HP-UX" #endif @@ -102,5 +121,4 @@ #define NETWORK_AVALIABLE #endif - #endif /* PLATFORM_H */ diff --git a/src/main.c b/src/main.c index 2e4fb740..7f0eca2e 100644 --- a/src/main.c +++ b/src/main.c @@ -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]", diff --git a/src/main.h b/src/main.h index 37742d78..d07b005f 100644 --- a/src/main.h +++ b/src/main.h @@ -1718,9 +1718,10 @@ #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[]; diff --git a/src/screens.c b/src/screens.c index fa44e771..bd5eb569 100644 --- a/src/screens.c +++ b/src/screens.c @@ -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 @@ -54,9 +55,10 @@ #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