From: Holger Schemel Date: Sun, 2 Nov 2003 14:53:50 +0000 (+0100) Subject: rnd-20031102-1-src X-Git-Tag: 3.0.7^2~7 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=39af00f43cf5c4cea174d0e90633877df08a2f7c;p=rocksndiamonds.git rnd-20031102-1-src * unavailable setup options now marked as "n/a" instead of "off" --- diff --git a/ChangeLog b/ChangeLog index a9e922ed..ceb85cac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ 2003-10-19 + * unavailable setup options now marked as "n/a" instead of "off" * new boolean directive "latest_engine" for "levelinfo.conf": when set to "true", levels are always played with the latest game engine, which is desired for levels that are imported from other games; all @@ -8,6 +9,7 @@ 2003-10-18 * fixed serious bug in code for delayed element pushing * fixed little bug in animation frame selection for pushed elements + * speed-up of reading config file for verbose output 2003-10-08 * added configuration option for opening and closing Supaplex exit diff --git a/Makefile b/Makefile index f047a807..e981e705 100644 --- a/Makefile +++ b/Makefile @@ -50,8 +50,8 @@ CROSS_PATH_WIN32=/usr/local/cross-tools/i386-mingw32msvc SRC_DIR = src MAKE_CMD = $(MAKE) -C $(SRC_DIR) -DEFAULT_TARGET = x11 -# DEFAULT_TARGET = sdl +# DEFAULT_TARGET = x11 +DEFAULT_TARGET = sdl # ----------------------------------------------------------------------------- diff --git a/src/config.c b/src/config.c index 2d21f408..ec09d329 100644 --- a/src/config.c +++ b/src/config.c @@ -16,15 +16,56 @@ #include "config.h" #include "conftime.h" -/* use timestamp created at compile-time */ -#define PROGRAM_BUILD_STRING PROGRAM_IDENT_STRING " " COMPILE_DATE_STRING + +char *getProgramVersionString() +{ + static char program_version_string[32]; + #ifdef DEBUG -#undef WINDOW_TITLE_STRING -#define WINDOW_TITLE_STRING PROGRAM_TITLE_STRING " " PROGRAM_BUILD_STRING + 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 *getProgramInitString() +{ + static char *program_init_string = NULL; + + if (program_init_string == NULL) + { + program_init_string = checked_malloc(strlen(PROGRAM_TITLE_STRING) + 1 + + strlen(getProgramVersionString()) +1 + + strlen(TARGET_STRING) + 1); + + sprintf(program_init_string, "%s %s %s", + PROGRAM_TITLE_STRING, getProgramVersionString(), TARGET_STRING); + } + + return program_init_string; +} char *getWindowTitleString() { - return WINDOW_TITLE_STRING; +#ifdef DEBUG + static char *window_title_string = NULL; + + if (window_title_string == NULL) + { + window_title_string = checked_malloc(strlen(getProgramInitString()) + 1 + + strlen(COMPILE_DATE_STRING) + 1); + + sprintf(window_title_string, "%s %s", + getProgramInitString(), COMPILE_DATE_STRING); + } + + return window_title_string; +#else + return getProgramInitString(); +#endif } diff --git a/src/config.h b/src/config.h index d9e5d94d..01ea5064 100644 --- a/src/config.h +++ b/src/config.h @@ -16,6 +16,8 @@ #include "main.h" +char *getProgramVersionString(void); +char *getProgramInitString(void); char *getWindowTitleString(void); #endif /* CONFIG_H */ diff --git a/src/conftime.h b/src/conftime.h index 3206d925..ebc81794 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-10-19 18:46]" +#define COMPILE_DATE_STRING "[2003-11-02 13:42]" diff --git a/src/files.c b/src/files.c index 36751f46..dd68c914 100644 --- a/src/files.c +++ b/src/files.c @@ -947,7 +947,7 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) printf("\n::: This level is private or contributed: '%s'\n", filename); #endif -#if 1 +#if 0 printf("\n::: Use the stored game engine version for this level\n"); #endif @@ -972,7 +972,7 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) } /* Default behaviour for EM style gems was "slippery" only in 2.0.1 */ - if (level->game_version == VERSION_IDENT(2,0,1)) + if (level->game_version == VERSION_IDENT(2,0,1,0)) level->em_slippery_gems = TRUE; } else @@ -982,7 +982,7 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) leveldir_current->sort_priority, filename); #endif -#if 1 +#if 0 printf("\n::: Use latest game engine version for this level.\n"); #endif @@ -1023,7 +1023,7 @@ static void LoadLevel_InitElements(struct LevelInfo *level, char *filename) /* map custom element change events that have changed in newer versions (these following values were accidentally changed in version 3.0.1) */ - if (level->game_version <= VERSION_IDENT(3,0,0)) + if (level->game_version <= VERSION_IDENT(3,0,0,0)) { for (i=0; i < NUM_CUSTOM_ELEMENTS; i++) { @@ -1067,7 +1067,7 @@ static void LoadLevel_InitElements(struct LevelInfo *level, char *filename) } /* initialize "can_change" field for old levels with only one change page */ - if (level->game_version <= VERSION_IDENT(3,0,2)) + if (level->game_version <= VERSION_IDENT(3,0,2,0)) { for (i=0; i < NUM_CUSTOM_ELEMENTS; i++) { @@ -1078,8 +1078,9 @@ static void LoadLevel_InitElements(struct LevelInfo *level, char *filename) } } - /* set default push delay values (corrected since version 3.0.7) */ - if (level->game_version < VERSION_IDENT(3,0,7)) +#if 0 + /* set default push delay values (corrected since version 3.0.7-1) */ + if (level->game_version < VERSION_IDENT(3,0,7,1)) { game.default_push_delay_fixed = 2; game.default_push_delay_random = 8; @@ -1100,6 +1101,7 @@ static void LoadLevel_InitElements(struct LevelInfo *level, char *filename) if (element_info[element].push_delay_random == -1) element_info[element].push_delay_random = game.default_push_delay_random; } +#endif /* initialize element properties for level editor etc. */ InitElementPropertiesEngine(level->game_version); @@ -1116,7 +1118,7 @@ static void LoadLevel_InitPlayfield(struct LevelInfo *level, char *filename) { int element = level->field[x][y]; - if (level->game_version <= VERSION_IDENT(2,2,0)) + if (level->game_version <= VERSION_IDENT(2,2,0,0)) { /* map game font elements */ element = (element == EL_CHAR('[') ? EL_CHAR_AUMLAUT : @@ -1125,7 +1127,7 @@ static void LoadLevel_InitPlayfield(struct LevelInfo *level, char *filename) element == EL_CHAR('^') ? EL_CHAR_COPYRIGHT : element); } - if (level->game_version < VERSION_IDENT(3,0,0)) + if (level->game_version < VERSION_IDENT(3,0,0,0)) { /* map Supaplex gravity tube elements */ element = (element == EL_SP_GRAVITY_PORT_LEFT ? EL_SP_PORT_LEFT : diff --git a/src/game.c b/src/game.c index 642b684c..a46368e1 100644 --- a/src/game.c +++ b/src/game.c @@ -800,13 +800,19 @@ static void InitGameEngine() /* dynamically adjust player properties according to game engine version */ game.initial_move_delay = - (game.engine_version <= VERSION_IDENT(2,0,1) ? INITIAL_MOVE_DELAY_ON : + (game.engine_version <= VERSION_IDENT(2,0,1,0) ? INITIAL_MOVE_DELAY_ON : INITIAL_MOVE_DELAY_OFF); /* dynamically adjust player properties according to level information */ game.initial_move_delay_value = (level.double_speed ? MOVE_DELAY_HIGH_SPEED : MOVE_DELAY_NORMAL_SPEED); + /* ---------- initialize player's initial push delay --------------------- */ + + /* dynamically adjust player properties according to game engine version */ + game.initial_push_delay_value = + (game.engine_version < VERSION_IDENT(3,0,7,1) ? 5 : -1); + /* ---------- initialize changing elements ------------------------------- */ /* initialize changing elements information */ @@ -1059,7 +1065,7 @@ void InitGame() player->move_delay_value = game.initial_move_delay_value; player->push_delay = 0; - player->push_delay_value = 5; + player->push_delay_value = game.initial_push_delay_value; player->last_jx = player->last_jy = 0; player->jx = player->jy = 0; @@ -2149,7 +2155,7 @@ void Explode(int ex, int ey, int phase, int mode) #if 0 /* --- This is only really needed (and now handled) in "Impact()". --- */ /* do not explode moving elements that left the explode field in time */ - if (game.engine_version >= RELEASE_IDENT(2,2,0,7) && + if (game.engine_version >= VERSION_IDENT(2,2,0,7) && center_element == EL_EMPTY && (mode == EX_NORMAL || mode == EX_CENTER)) return; #endif @@ -2204,7 +2210,7 @@ void Explode(int ex, int ey, int phase, int mode) #else if ((IS_INDESTRUCTIBLE(element) && - (game.engine_version < VERSION_IDENT(2,2,0) || + (game.engine_version < VERSION_IDENT(2,2,0,0) || (!IS_WALKABLE_OVER(element) && !IS_WALKABLE_UNDER(element)))) || element == EL_FLAMES) continue; @@ -2965,7 +2971,7 @@ void Impact(int x, int y) MovPos[x][y + 1] <= TILEY / 2)); /* do not smash moving elements that left the smashed field in time */ - if (game.engine_version >= RELEASE_IDENT(2,2,0,7) && IS_MOVING(x, y + 1) && + if (game.engine_version >= VERSION_IDENT(2,2,0,7) && IS_MOVING(x, y + 1) && ABS(MovPos[x][y + 1] + getElementMoveStepsize(x, y + 1)) >= TILEX) object_hit = FALSE; @@ -3735,7 +3741,7 @@ static boolean JustBeingPushed(int x, int y) void StartMoving(int x, int y) { - boolean use_spring_bug = (game.engine_version < VERSION_IDENT(2,2,0)); + boolean use_spring_bug = (game.engine_version < VERSION_IDENT(2,2,0,0)); boolean started_moving = FALSE; /* some elements can fall _and_ move */ int element = Feld[x][y]; @@ -3891,16 +3897,16 @@ void StartMoving(int x, int y) #endif } #if 1 - else if ((game.engine_version < RELEASE_IDENT(2,2,0,7) && + else if ((game.engine_version < VERSION_IDENT(2,2,0,7) && CAN_SMASH(element) && WasJustMoving[x][y] && !Pushed[x][y + 1] && (Feld[x][y + 1] == EL_BLOCKED)) || - (game.engine_version >= VERSION_IDENT(3,0,7) && + (game.engine_version >= VERSION_IDENT(3,0,7,0) && CAN_SMASH(element) && WasJustFalling[x][y] && (Feld[x][y + 1] == EL_BLOCKED || IS_PLAYER(x, y + 1)))) #else #if 1 - else if (game.engine_version < RELEASE_IDENT(2,2,0,7) && + else if (game.engine_version < VERSION_IDENT(2,2,0,7) && CAN_SMASH(element) && Feld[x][y + 1] == EL_BLOCKED && WasJustMoving[x][y] && !Pushed[x][y + 1]) #else @@ -5769,9 +5775,18 @@ static boolean CheckTriggeredElementSideChange(int lx, int ly, struct ElementChangeInfo *change = &element_info[element].change_page[j]; if (change->can_change && +#if 1 + change->events & CH_EVENT_BIT(trigger_event) && +#endif change->sides & trigger_side && change->trigger_element == trigger_element) { +#if 0 + if (!(change->events & CH_EVENT_BIT(trigger_event))) + printf("::: !!! %d triggers %d: using wrong page %d [event %d]\n", + trigger_element-EL_CUSTOM_START+1, i+1, j, trigger_event); +#endif + change_element = TRUE; page = j; @@ -6000,7 +6015,7 @@ void GameActions() #endif #if 1 - if (game.engine_version < RELEASE_IDENT(2,2,0,7)) + if (game.engine_version < VERSION_IDENT(2,2,0,7)) { for (i=0; iis_moving = FALSE; } - if (game.engine_version < VERSION_IDENT(3,0,7)) + if (game.engine_version < VERSION_IDENT(3,0,7,0)) { TestIfHeroTouchesBadThing(jx, jy); TestIfPlayerTouchesCustomElement(jx, jy); @@ -6963,7 +6978,7 @@ void ScrollPlayer(struct PlayerInfo *player, int mode) player->LevelSolved = player->GameOver = TRUE; } - if (game.engine_version >= VERSION_IDENT(3,0,7)) + if (game.engine_version >= VERSION_IDENT(3,0,7,0)) { TestIfHeroTouchesBadThing(jx, jy); TestIfPlayerTouchesCustomElement(jx, jy); @@ -7049,7 +7064,7 @@ void TestIfPlayerTouchesCustomElement(int x, int y) if (IS_PLAYER(x, y)) { - if (game.engine_version < VERSION_IDENT(3,0,7)) + if (game.engine_version < VERSION_IDENT(3,0,7,0)) border_element = Feld[xx][yy]; /* may be moving! */ else if (!IS_MOVING(xx, yy) && !IS_BLOCKED(xx, yy)) border_element = Feld[xx][yy]; @@ -7065,7 +7080,7 @@ void TestIfPlayerTouchesCustomElement(int x, int y) } else if (IS_PLAYER(xx, yy)) { - if (game.engine_version >= VERSION_IDENT(3,0,7)) + if (game.engine_version >= VERSION_IDENT(3,0,7,0)) { struct PlayerInfo *player = PLAYERINFO(xx, yy); @@ -7123,7 +7138,7 @@ void TestIfElementTouchesCustomElement(int x, int y) if (!IN_LEV_FIELD(xx, yy)) continue; - if (game.engine_version < VERSION_IDENT(3,0,7)) + if (game.engine_version < VERSION_IDENT(3,0,7,0)) border_element = Feld[xx][yy]; /* may be moving! */ else if (!IS_MOVING(xx, yy) && !IS_BLOCKED(xx, yy)) border_element = Feld[xx][yy]; @@ -7303,7 +7318,7 @@ void TestIfBadThingHitsGoodThing(int bad_x, int bad_y, int bad_move_dir) if (bad_element == EL_ROBOT && player->is_moving) continue; /* robot does not kill player if he is moving */ - if (game.engine_version >= VERSION_IDENT(3,0,7)) + if (game.engine_version >= VERSION_IDENT(3,0,7,0)) { if (player->MovPos != 0 && !(player->MovDir & touch_dir[i])) continue; /* center and border element do not touch */ @@ -7513,7 +7528,7 @@ int DigField(struct PlayerInfo *player, CH_SIDE_BOTTOM, /* moving up */ CH_SIDE_TOP, /* moving down */ }; - boolean use_spring_bug = (game.engine_version < VERSION_IDENT(2,2,0)); + boolean use_spring_bug = (game.engine_version < VERSION_IDENT(2,2,0,0)); int jx = player->jx, jy = player->jy; int dx = x - jx, dy = y - jy; int nextx = x + dx, nexty = y + dy; @@ -7548,7 +7563,7 @@ int DigField(struct PlayerInfo *player, if (IS_TUBE(Feld[jx][jy]) || IS_TUBE(Back[jx][jy])) #else if (IS_TUBE(Feld[jx][jy]) || - (IS_TUBE(Back[jx][jy]) && game.engine_version >= VERSION_IDENT(2,2,0))) + (IS_TUBE(Back[jx][jy]) && game.engine_version >= VERSION_IDENT(2,2,0,0))) #endif { int i = 0; @@ -7583,7 +7598,7 @@ int DigField(struct PlayerInfo *player, element = Feld[x][y]; if (mode == DF_SNAP && !IS_SNAPPABLE(element) && - game.engine_version >= VERSION_IDENT(2,2,0)) + game.engine_version >= VERSION_IDENT(2,2,0,0)) return MF_NO_ACTION; switch (element) @@ -7888,9 +7903,36 @@ int DigField(struct PlayerInfo *player, if (element == EL_SPRING && MovDir[x][y] != MV_NO_MOVING) return MF_NO_ACTION; #endif + +#if 1 + if (game.engine_version >= VERSION_IDENT(3,0,7,1)) + { + if (player->push_delay_value == -1) + player->push_delay_value = GET_NEW_PUSH_DELAY(element); + } + else if (game.engine_version >= VERSION_IDENT(2,2,0,7)) + { + if (!player->is_pushing) + player->push_delay_value = GET_NEW_PUSH_DELAY(element); + } + + /* + if (game.engine_version >= VERSION_IDENT(2,2,0,7) && + (game.engine_version < VERSION_IDENT(3,0,7,1) || + !player_is_pushing)) + player->push_delay_value = GET_NEW_PUSH_DELAY(element); + */ +#else if (!player->is_pushing && - game.engine_version >= RELEASE_IDENT(2,2,0,7)) + game.engine_version >= VERSION_IDENT(2,2,0,7)) player->push_delay_value = GET_NEW_PUSH_DELAY(element); +#endif + +#if 0 + printf("::: push delay: %ld [%d, %d] [%d]\n", + player->push_delay_value, FrameCounter, game.engine_version, + player->is_pushing); +#endif player->is_pushing = TRUE; @@ -7911,12 +7953,16 @@ int DigField(struct PlayerInfo *player, element != EL_SPRING && element != EL_BALLOON) { /* make sure that there is no move delay before next try to push */ - if (game.engine_version >= VERSION_IDENT(3,0,7)) + if (game.engine_version >= VERSION_IDENT(3,0,7,1)) player->move_delay = INITIAL_MOVE_DELAY_OFF; return MF_NO_ACTION; } +#if 0 + printf("::: NOW PUSHING... [%d]\n", FrameCounter); +#endif + if (IS_SB_ELEMENT(element)) { if (element == EL_SOKOBAN_FIELD_FULL) @@ -7963,8 +8009,10 @@ int DigField(struct PlayerInfo *player, Pushed[x][y] = TRUE; Pushed[nextx][nexty] = TRUE; - if (game.engine_version < RELEASE_IDENT(2,2,0,7)) + if (game.engine_version < VERSION_IDENT(2,2,0,7)) player->push_delay_value = GET_NEW_PUSH_DELAY(element); + else + player->push_delay_value = -1; /* get new value later */ CheckTriggeredElementSideChange(x, y, element, dig_side, CE_OTHER_GETS_PUSHED); @@ -8104,7 +8152,7 @@ boolean SnapField(struct PlayerInfo *player, int dx, int dy) dy == -1 ? MV_UP : dy == +1 ? MV_DOWN : MV_NO_MOVING); - if (player->MovPos && game.engine_version >= VERSION_IDENT(2,2,0)) + if (player->MovPos && game.engine_version >= VERSION_IDENT(2,2,0,0)) return FALSE; if (!player->active || !IN_LEV_FIELD(x, y)) diff --git a/src/init.c b/src/init.c index ebc9f2fd..972aea39 100644 --- a/src/init.c +++ b/src/init.c @@ -24,6 +24,7 @@ #include "network.h" #include "netserv.h" #include "cartoons.h" +#include "config.h" #include "conf_e2g.c" /* include auto-generated data structure definitions */ #include "conf_esg.c" /* include auto-generated data structure definitions */ @@ -2839,7 +2840,7 @@ void InitElementPropertiesEngine(int engine_version) SET_PROPERTY(i, EP_WALL, TRUE); /* ---------- SOLID_FOR_PUSHING ---------------------------------------- */ - if (engine_version < VERSION_IDENT(2,2,0)) + if (engine_version < VERSION_IDENT(2,2,0,0)) SET_PROPERTY(i, EP_SOLID_FOR_PUSHING, IS_HISTORIC_SOLID(i)); else SET_PROPERTY(i, EP_SOLID_FOR_PUSHING, (!IS_WALKABLE(i) && @@ -2857,7 +2858,7 @@ void InitElementPropertiesEngine(int engine_version) /* ---------- EXPLOSION_PROOF ------------------------------------------ */ if (i == EL_FLAMES) SET_PROPERTY(i, EP_EXPLOSION_PROOF, TRUE); - else if (engine_version < VERSION_IDENT(2,2,0)) + else if (engine_version < VERSION_IDENT(2,2,0,0)) SET_PROPERTY(i, EP_EXPLOSION_PROOF, IS_INDESTRUCTIBLE(i)); else SET_PROPERTY(i, EP_EXPLOSION_PROOF, (IS_INDESTRUCTIBLE(i) && @@ -2944,8 +2945,33 @@ void InitElementPropertiesEngine(int engine_version) /* "EL_EXPANDABLE_WALL_GROWING" wasn't slippery for EM gems in 2.0.1 */ SET_PROPERTY(EL_EXPANDABLE_WALL_GROWING, EP_EM_SLIPPERY_WALL, (level.em_slippery_gems && - engine_version > VERSION_IDENT(2,0,1))); + engine_version > VERSION_IDENT(2,0,1,0))); } + +#if 1 + /* set default push delay values (corrected since version 3.0.7-1) */ + if (engine_version < VERSION_IDENT(3,0,7,1)) + { + game.default_push_delay_fixed = 2; + game.default_push_delay_random = 8; + } + else + { + game.default_push_delay_fixed = 8; + game.default_push_delay_random = 8; + } + + /* set uninitialized push delay values of custom elements in older levels */ + for (i=0; i < NUM_CUSTOM_ELEMENTS; i++) + { + int element = EL_CUSTOM_START + i; + + if (element_info[element].push_delay_fixed == -1) + element_info[element].push_delay_fixed = game.default_push_delay_fixed; + if (element_info[element].push_delay_random == -1) + element_info[element].push_delay_random = game.default_push_delay_random; + } +#endif } static void InitGlobal() @@ -3256,8 +3282,8 @@ void InitGfx() InitFontGraphicInfo(); - DrawInitText(WINDOW_TITLE_STRING, 20, FC_YELLOW); - DrawInitText(WINDOW_SUBTITLE_STRING, 50, FC_RED); + DrawInitText(getProgramInitString(), 20, FC_YELLOW); + DrawInitText(PROGRAM_COPYRIGHT_STRING, 50, FC_RED); DrawInitText("Loading graphics:", 120, FC_GREEN); diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 84ec3602..a19bcace 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -984,28 +984,26 @@ void putFileChunk(FILE *file, char *chunk_name, int chunk_size, int getFileVersion(FILE *file) { - int version_major, version_minor, version_patch, version_release; + int version_major = fgetc(file); + int version_minor = fgetc(file); + int version_patch = fgetc(file); + int version_build = fgetc(file); - version_major = fgetc(file); - version_minor = fgetc(file); - version_patch = fgetc(file); - version_release = fgetc(file); - - return RELEASE_IDENT(version_major, version_minor, version_patch, - version_release); + return VERSION_IDENT(version_major, version_minor, version_patch, + version_build); } void putFileVersion(FILE *file, int version) { - int version_major = VERSION_MAJOR(version); - int version_minor = VERSION_MINOR(version); - int version_patch = VERSION_PATCH(version); - int version_release = VERSION_RELEASE(version); + int version_major = VERSION_MAJOR(version); + int version_minor = VERSION_MINOR(version); + int version_patch = VERSION_PATCH(version); + int version_build = VERSION_BUILD(version); - fputc(version_major, file); - fputc(version_minor, file); - fputc(version_patch, file); - fputc(version_release, file); + fputc(version_major, file); + fputc(version_minor, file); + fputc(version_patch, file); + fputc(version_build, file); } void ReadUnusedBytesFromFile(FILE *file, unsigned long bytes) diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 2c7dcfd7..16118404 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -1053,7 +1053,7 @@ int getFileVersionFromCookieString(const char *cookie) version_major = ptr_cookie2[0] - '0'; version_minor = ptr_cookie2[2] - '0'; - return VERSION_IDENT(version_major, version_minor, 0); + return VERSION_IDENT(version_major, version_minor, 0, 0); } boolean checkCookieString(const char *cookie, const char *template) diff --git a/src/libgame/system.h b/src/libgame/system.h index 134d6c3e..ae847346 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -269,12 +269,11 @@ /* macros for version handling */ -#define VERSION_IDENT(x,y,z) ((x) * 1000000 + (y) * 10000 + (z) * 100) -#define RELEASE_IDENT(x,y,z,r) (VERSION_IDENT(x,y,z) + (r)) #define VERSION_MAJOR(x) ((x) / 1000000) #define VERSION_MINOR(x) (((x) % 1000000) / 10000) #define VERSION_PATCH(x) (((x) % 10000) / 100) -#define VERSION_RELEASE(x) ((x) % 100) +#define VERSION_BUILD(x) ((x) % 100) +#define VERSION_IDENT(a,b,c,d) ((a) * 1000000 + (b) * 10000 + (c) * 100 + (d)) /* macros for parent/child process identification */ diff --git a/src/main.h b/src/main.h index 7f689c34..da1f3843 100644 --- a/src/main.h +++ b/src/main.h @@ -1029,16 +1029,22 @@ #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 0 #define PROGRAM_VERSION_PATCH 7 -#define PROGRAM_VERSION_RELEASE 0 +#define PROGRAM_VERSION_BUILD 1 + +#if 0 #define PROGRAM_VERSION_STRING "3.0.7" +#endif #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" -#define PROGRAM_RIGHTS_STRING "Copyright ©1995-2003 by" +#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2003 by Holger Schemel" + +#if 0 #define PROGRAM_DOS_PORT_STRING "DOS port done by Guido Schulz" #define PROGRAM_IDENT_STRING PROGRAM_VERSION_STRING " " TARGET_STRING #define WINDOW_TITLE_STRING PROGRAM_TITLE_STRING " " PROGRAM_IDENT_STRING -#define WINDOW_SUBTITLE_STRING PROGRAM_RIGHTS_STRING " " PROGRAM_AUTHOR_STRING +#endif + #define ICON_TITLE_STRING PROGRAM_TITLE_STRING #define COOKIE_PREFIX "ROCKSNDIAMONDS" #define FILENAME_PREFIX "Rocks" @@ -1062,10 +1068,10 @@ ** 1.4 (still in use) ** 2.0 (actual) */ -#define FILE_VERSION_1_0 VERSION_IDENT(1,0,0) -#define FILE_VERSION_1_2 VERSION_IDENT(1,2,0) -#define FILE_VERSION_1_4 VERSION_IDENT(1,4,0) -#define FILE_VERSION_2_0 VERSION_IDENT(2,0,0) +#define FILE_VERSION_1_0 VERSION_IDENT(1,0,0,0) +#define FILE_VERSION_1_2 VERSION_IDENT(1,2,0,0) +#define FILE_VERSION_1_4 VERSION_IDENT(1,4,0,0) +#define FILE_VERSION_2_0 VERSION_IDENT(2,0,0,0) /* file version does not change for every program version, but is changed when new features are introduced that are incompatible with older file @@ -1077,10 +1083,10 @@ #define GAME_VERSION_1_4 FILE_VERSION_1_4 #define GAME_VERSION_2_0 FILE_VERSION_2_0 -#define GAME_VERSION_ACTUAL RELEASE_IDENT(PROGRAM_VERSION_MAJOR, \ +#define GAME_VERSION_ACTUAL VERSION_IDENT(PROGRAM_VERSION_MAJOR, \ PROGRAM_VERSION_MINOR, \ PROGRAM_VERSION_PATCH, \ - PROGRAM_VERSION_RELEASE) + PROGRAM_VERSION_BUILD) /* values for game_emulation */ #define EMU_NONE 0 @@ -1255,6 +1261,7 @@ struct GameInfo int emulation; int initial_move_delay; int initial_move_delay_value; + int initial_push_delay_value; /* variable within running game */ int yamyam_content_nr; diff --git a/src/screens.c b/src/screens.c index aa97ce2f..8e66c8c9 100644 --- a/src/screens.c +++ b/src/screens.c @@ -155,13 +155,13 @@ static void PlaySound_Menu_Continue(int sound) void DrawHeadline() { - int text1_width = getTextWidth(PROGRAM_TITLE_STRING, FONT_TITLE_1); - int text2_width = getTextWidth(WINDOW_SUBTITLE_STRING, FONT_TITLE_2); + int text1_width = getTextWidth(PROGRAM_TITLE_STRING, FONT_TITLE_1); + int text2_width = getTextWidth(PROGRAM_COPYRIGHT_STRING, FONT_TITLE_2); int x1 = SX + (SXSIZE - text1_width) / 2; int x2 = SX + (SXSIZE - text2_width) / 2; - DrawText(x1, SY + 8, PROGRAM_TITLE_STRING, FONT_TITLE_1); - DrawText(x2, SY + 46, WINDOW_SUBTITLE_STRING, FONT_TITLE_2); + DrawText(x1, SY + 8, PROGRAM_TITLE_STRING, FONT_TITLE_1); + DrawText(x2, SY + 46, PROGRAM_COPYRIGHT_STRING, FONT_TITLE_2); } static void ToggleFullscreenIfNeeded() @@ -1929,23 +1929,25 @@ static void drawSetupValue(int pos) int xpos = MENU_SCREEN_VALUE_XPOS; int ypos = MENU_SCREEN_START_YPOS + pos; int font_nr = FONT_VALUE_1; - char *value_string = getSetupValue(setup_info[pos].type & ~TYPE_GHOSTED, - setup_info[pos].value); + int type = setup_info[pos].type; + void *value = setup_info[pos].value; + char *value_string = (!(type & TYPE_GHOSTED) ? getSetupValue(type, value) : + "n/a"); if (value_string == NULL) return; - if (setup_info[pos].type & TYPE_KEY) + if (type & TYPE_KEY) { xpos = 3; - if (setup_info[pos].type & TYPE_QUERY) + if (type & TYPE_QUERY) { value_string = ""; font_nr = FONT_INPUT_1_ACTIVE; } } - else if (setup_info[pos].type & TYPE_STRING) + else if (type & TYPE_STRING) { int max_value_len = (SCR_FIELDX - 2) * 2; @@ -1955,10 +1957,9 @@ static void drawSetupValue(int pos) if (strlen(value_string) > max_value_len) value_string[max_value_len] = '\0'; } - else if (setup_info[pos].type & TYPE_BOOLEAN_STYLE) + else if (type & TYPE_BOOLEAN_STYLE) { - font_nr = (*(boolean *)(setup_info[pos].value) ? FONT_OPTION_ON : - FONT_OPTION_OFF); + font_nr = (*(boolean *)value ? FONT_OPTION_ON : FONT_OPTION_OFF); } DrawText(mSX + xpos * 32, mSY + ypos * 32,