+2005-05-24
+ * fixed bug with moving up despite gravity due to "block last field"
+ * fixed small bug with wrong draw offset when typing name in main menu
+ * when reading user names from "passwd", ignore data after first comma
+ * when creating new "levelinfo.conf", only write some selected entries
+
2005-05-15
* added setup option "skip levels" and possibility to skip levels
-#define COMPILE_DATE_STRING "[2005-05-23 21:29]"
+#define COMPILE_DATE_STRING "[2005-05-25 01:17]"
return (IN_LEV_FIELD(jx, jy + 1) &&
(IS_FREE(jx, jy + 1) ||
+#if USE_NEW_BLOCK_STYLE
+ Feld[jx][jy + 1] == EL_PLAYER_IS_LEAVING ||
+#endif
(Feld[jx][jy + 1] == EL_ACID && player->can_fall_into_acid)) &&
IS_WALKABLE_FROM(Feld[jx][jy], MV_DOWN) &&
!IS_WALKABLE_INSIDE(Feld[jx][jy]));
EL_PENGUIN,
EL_PIG,
EL_DRAGON,
+ EL_PLAYER_IS_LEAVING, /* needed for gravity + "block last field" */
-1
};
char *from_ptr = real_name;
char *to_ptr = real_name_new;
- if (strchr(real_name, 'ß') == NULL) /* name does not contain 'ß' */
- {
- strncpy(real_name_new, real_name, MAX_USERNAME_LEN);
- real_name_new[MAX_USERNAME_LEN] = '\0';
-
- return real_name_new;
- }
-
- /* the user's real name may contain a 'ß' character (german sharp s),
- which has no equivalent in upper case letters (which our fonts use) */
+ /* copy the name string, but not more than MAX_USERNAME_LEN characters */
while (*from_ptr && (long)(to_ptr - real_name_new) < MAX_USERNAME_LEN - 1)
{
- if (*from_ptr != 'ß')
- *to_ptr++ = *from_ptr++;
- else
+ /* the name field read from "passwd" file may also contain additional
+ user information, separated by commas, which will be removed here */
+ if (*from_ptr == ',')
+ break;
+
+ /* the user's real name may contain 'ß' characters (german sharp s),
+ which have no equivalent in upper case letters (used by our fonts) */
+ if (*from_ptr == 'ß')
{
from_ptr++;
*to_ptr++ = 's';
*to_ptr++ = 's';
}
+ else
+ *to_ptr++ = *from_ptr++;
}
*to_ptr = '\0';
IS_ARTWORKCLASS_PRIVATE(n) ? 3 : \
9)
-#define TOKEN_VALUE_POSITION 40
-#define TOKEN_COMMENT_POSITION 60
+#define TOKEN_VALUE_POSITION_SHORT 32
+#define TOKEN_VALUE_POSITION_DEFAULT 40
+#define TOKEN_COMMENT_POSITION_DEFAULT 60
-#define MAX_COOKIE_LEN 256
+#define MAX_COOKIE_LEN 256
+
+static int token_value_position = TOKEN_VALUE_POSITION_DEFAULT;
+static int token_comment_position = TOKEN_COMMENT_POSITION_DEFAULT;
/* ------------------------------------------------------------------------- */
/* start with the token and some spaces to format output line */
sprintf(entry, "%s:", token);
- for (i = strlen(entry); i < TOKEN_VALUE_POSITION; i++)
+ for (i = strlen(entry); i < token_value_position; i++)
strcat(entry, " ");
/* continue with the token's value */
(leveldir_new->basepath == options.level_directory ? FALSE : TRUE);
#endif
+#if 1
+ /* adjust sort priority if user's private level directory was detected */
+ if (leveldir_new->sort_priority == LEVELCLASS_UNDEFINED &&
+ leveldir_new->in_user_dir &&
+ strcmp(leveldir_new->subdir, getLoginName()) == 0)
+ leveldir_new->sort_priority = LEVELCLASS_PRIVATE_START;
+#endif
+
leveldir_new->user_defined =
(leveldir_new->in_user_dir && IS_LEVELCLASS_PRIVATE(leveldir_new));
setString(&level_info->author, getRealName());
level_info->levels = 100;
level_info->first_level = 1;
+#if 0
level_info->sort_priority = LEVELCLASS_PRIVATE_START;
level_info->readonly = FALSE;
setString(&level_info->graphics_set, GFX_CLASSIC_SUBDIR);
setString(&level_info->sounds_set, SND_CLASSIC_SUBDIR);
setString(&level_info->music_set, MUS_CLASSIC_SUBDIR);
+#endif
#else
ldi.name = getStringCopy(getLoginName());
ldi.author = getStringCopy(getRealName());
ldi.music_set = getStringCopy(MUS_CLASSIC_SUBDIR);
#endif
+ token_value_position = TOKEN_VALUE_POSITION_SHORT;
+
fprintf(file, "%s\n\n", getFormattedSetupEntry(TOKEN_STR_FILE_IDENTIFIER,
getCookie("LEVELINFO")));
ldi = *level_info;
for (i = 0; i < NUM_LEVELINFO_TOKENS; i++)
+ {
+#if 1
+ if (i == LEVELINFO_TOKEN_NAME ||
+ i == LEVELINFO_TOKEN_AUTHOR ||
+ i == LEVELINFO_TOKEN_LEVELS ||
+ i == LEVELINFO_TOKEN_FIRST_LEVEL)
+ fprintf(file, "%s\n", getSetupLine(levelinfo_tokens, "", i));
+
+ /* just to make things nicer :) */
+ if (i == LEVELINFO_TOKEN_AUTHOR)
+ fprintf(file, "\n");
+#else
if (i != LEVELINFO_TOKEN_IDENTIFIER &&
i != LEVELINFO_TOKEN_NAME_SORTING &&
i != LEVELINFO_TOKEN_IMPORTED_FROM &&
i != LEVELINFO_TOKEN_FILENAME &&
i != LEVELINFO_TOKEN_FILETYPE)
fprintf(file, "%s\n", getSetupLine(levelinfo_tokens, "", i));
+#endif
+ }
+
+ token_value_position = TOKEN_VALUE_POSITION_DEFAULT;
fclose(file);
{
/* add at least one whitespace */
strcat(line, " ");
- for (i = strlen(line); i < TOKEN_COMMENT_POSITION; i++)
+ for (i = strlen(line); i < token_comment_position; i++)
strcat(line, " ");
strcat(line, "# ");
{
{ "global.num_toons", &global.num_toons },
- { "menu.draw_xoffset", &menu.draw_xoffset_default },
- { "menu.draw_yoffset", &menu.draw_yoffset_default },
+ { "menu.draw_xoffset", &menu.draw_xoffset[GFX_SPECIAL_ARG_DEFAULT]},
+ { "menu.draw_yoffset", &menu.draw_yoffset[GFX_SPECIAL_ARG_DEFAULT]},
{ "menu.draw_xoffset.MAIN", &menu.draw_xoffset[GFX_SPECIAL_ARG_MAIN] },
{ "menu.draw_yoffset.MAIN", &menu.draw_yoffset[GFX_SPECIAL_ARG_MAIN] },
{ "menu.draw_xoffset.LEVELS", &menu.draw_xoffset[GFX_SPECIAL_ARG_LEVELS] },
{ "menu.scrollbar_xoffset", &menu.scrollbar_xoffset },
- { "menu.list_size", &menu.list_size_default },
+ { "menu.list_size", &menu.list_size[GFX_SPECIAL_ARG_DEFAULT] },
{ "menu.list_size.LEVELS", &menu.list_size[GFX_SPECIAL_ARG_LEVELS] },
{ "menu.list_size.SCORES", &menu.list_size[GFX_SPECIAL_ARG_SCORES] },
{ "menu.list_size.INFO", &menu.list_size[GFX_SPECIAL_ARG_INFO] },
struct MenuInfo
{
- int draw_xoffset_default;
- int draw_yoffset_default;
int draw_xoffset[NUM_SPECIAL_GFX_ARGS];
int draw_yoffset[NUM_SPECIAL_GFX_ARGS];
int scrollbar_xoffset;
- int list_size_default;
int list_size[NUM_SPECIAL_GFX_ARGS];
int sound[NUM_SPECIAL_GFX_ARGS];
static int setup_mode = SETUP_MODE_MAIN;
static int info_mode = INFO_MODE_MAIN;
-#define mSX (SX + (game_status >= GAME_MODE_MAIN && \
- game_status <= GAME_MODE_SETUP ? \
- menu.draw_xoffset[game_status] : menu.draw_xoffset_default))
-#define mSY (SY + (game_status >= GAME_MODE_MAIN && \
- game_status <= GAME_MODE_SETUP ? \
- menu.draw_yoffset[game_status] : menu.draw_yoffset_default))
+#define DRAW_OFFSET_MODE(x) (x >= GAME_MODE_MAIN && \
+ x <= GAME_MODE_SETUP ? x : \
+ x == GAME_MODE_PSEUDO_TYPENAME ? \
+ GAME_MODE_MAIN : GAME_MODE_DEFAULT)
+
+#define mSX (SX + menu.draw_xoffset[DRAW_OFFSET_MODE(game_status)])
+#define mSY (SY + menu.draw_yoffset[DRAW_OFFSET_MODE(game_status)])
#define NUM_MENU_ENTRIES_ON_SCREEN (menu.list_size[game_status] > 2 ? \
menu.list_size[game_status] : \