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
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
SRC_DIR = src
MAKE_CMD = $(MAKE) -C $(SRC_DIR)
-DEFAULT_TARGET = x11
-# DEFAULT_TARGET = sdl
+# DEFAULT_TARGET = x11
+DEFAULT_TARGET = sdl
# -----------------------------------------------------------------------------
#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
}
#include "main.h"
+char *getProgramVersionString(void);
+char *getProgramInitString(void);
char *getWindowTitleString(void);
#endif /* CONFIG_H */
-#define COMPILE_DATE_STRING "[2003-10-19 18:46]"
+#define COMPILE_DATE_STRING "[2003-11-02 13:42]"
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
}
/* 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
leveldir_current->sort_priority, filename);
#endif
-#if 1
+#if 0
printf("\n::: Use latest game engine version for this level.\n");
#endif
/* 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++)
{
}
/* 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++)
{
}
}
- /* 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;
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);
{
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 :
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 :
/* 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 */
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;
#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
#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;
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;
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];
#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
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;
#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; i<MAX_PLAYERS; i++)
{
player->is_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);
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);
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];
}
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);
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];
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 */
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;
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;
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)
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;
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)
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);
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))
#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 */
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) &&
/* ---------- 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) &&
/* "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()
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);
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)
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)
/* 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 */
#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"
** 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
#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
int emulation;
int initial_move_delay;
int initial_move_delay_value;
+ int initial_push_delay_value;
/* variable within running game */
int yamyam_content_nr;
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()
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 = "<press key>";
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;
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,