/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
if (graphic_info[graphic].anim_frames < MIN_NUM_CHARS_PER_FONT)
{
graphic_info[graphic].anim_frames = DEFAULT_NUM_CHARS_PER_FONT;
- graphic_info[graphic].anim_frames_per_line= DEFAULT_NUM_CHARS_PER_LINE;
+ graphic_info[graphic].anim_frames_per_line = DEFAULT_NUM_CHARS_PER_LINE;
}
/* copy font relevant information from graphics information */
return FALSE;
}
-#if 1
static void resolve_group_element(int group_element, int recursion_depth)
{
static int group_nr;
}
}
}
-#endif
void InitElementPropertiesStatic()
{
EL_EXPANDABLE_WALL_VERTICAL,
EL_EXPANDABLE_WALL_ANY,
EL_EXPANDABLE_WALL_GROWING,
+ EL_BD_EXPANDABLE_WALL,
EL_BD_WALL,
EL_SP_CHIP_SINGLE,
EL_SP_CHIP_LEFT,
EL_EXPANDABLE_WALL_HORIZONTAL,
EL_EXPANDABLE_WALL_VERTICAL,
EL_EXPANDABLE_WALL_ANY,
+ EL_BD_EXPANDABLE_WALL,
EL_BD_WALL,
EL_WALL_SLIPPERY,
EL_EXIT_CLOSED,
EL_INTERNAL_CASCADE_CHARS_ACTIVE,
EL_INTERNAL_CASCADE_CE_ACTIVE,
EL_INTERNAL_CASCADE_GE_ACTIVE,
+ EL_INTERNAL_CASCADE_REF_ACTIVE,
EL_INTERNAL_CASCADE_USER_ACTIVE,
- EL_INTERNAL_CASCADE_GENERIC_ACTIVE,
EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE,
-1
EL_INTERNAL_CASCADE_CHARS,
EL_INTERNAL_CASCADE_CE,
EL_INTERNAL_CASCADE_GE,
+ EL_INTERNAL_CASCADE_REF,
EL_INTERNAL_CASCADE_USER,
- EL_INTERNAL_CASCADE_GENERIC,
EL_INTERNAL_CASCADE_DYNAMIC,
-1
property (which means that conditional property changes must be set to
a reliable default value before) */
-#if 1
/* ---------- recursively resolve group elements ------------------------- */
for (i = 0; i < MAX_NUM_ELEMENTS; i++)
for (i = 0; i < NUM_GROUP_ELEMENTS; i++)
resolve_group_element(EL_GROUP_START + i, 0);
-#endif
/* set all special, combined or engine dependent element properties */
for (i = 0; i < MAX_NUM_ELEMENTS; i++)
engine_version > VERSION_IDENT(2,0,1,0)));
}
-#if 0
- /* 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;
- }
-#endif
-
-#if 0
- /* 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
-
-#if 0
- /* set some other uninitialized values of custom elements in older levels */
- if (engine_version < VERSION_IDENT(3,1,0,0))
- {
- for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
- {
- int element = EL_CUSTOM_START + i;
-
- element_info[element].access_direction = MV_ALL_DIRECTIONS;
-
- element_info[element].explosion_delay = 17;
- element_info[element].ignition_delay = 8;
- }
- }
-#endif
-
-#if 0
- /* set element properties that were handled incorrectly in older levels */
- if (engine_version < VERSION_IDENT(3,1,0,0))
- {
- SET_PROPERTY(EL_SP_SNIKSNAK, EP_DONT_COLLIDE_WITH, FALSE);
- SET_PROPERTY(EL_SP_ELECTRON, EP_DONT_COLLIDE_WITH, FALSE);
- }
-#endif
-
/* this is needed because some graphics depend on element properties */
if (game_status == GAME_MODE_PLAYING)
InitElementGraphicInfo();
{
int i;
-#if 0
- /* 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;
- }
-#endif
-
-#if 0
- /* 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
-
-#if 1
/* set some other uninitialized values of custom elements in older levels */
if (engine_version < VERSION_IDENT(3,1,0,0))
{
element_info[element].ignition_delay = 8;
}
}
-#endif
}
static void InitGlobal()
global.convert_level_nr = atoi(str_ptr); /* get level_nr value */
}
}
+
+#if DEBUG
+#if defined(TARGET_SDL)
+ else if (strEqual(command, "SDL_ListModes"))
+ {
+ SDL_Rect **modes;
+ int i;
+
+ SDL_Init(SDL_INIT_VIDEO);
+
+ /* get available fullscreen/hardware modes */
+ modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_HWSURFACE);
+
+ /* check if there are any modes available */
+ if (modes == NULL)
+ {
+ printf("No modes available!\n");
+
+ exit(-1);
+ }
+
+ /* check if our resolution is restricted */
+ if (modes == (SDL_Rect **)-1)
+ {
+ printf("All resolutions available.\n");
+ }
+ else
+ {
+ printf("Available Modes:\n");
+
+ for(i = 0; modes[i]; i++)
+ printf(" %d x %d\n", modes[i]->w, modes[i]->h);
+ }
+
+ exit(0);
+ }
+#endif
+#endif
+
else
{
Error(ERR_EXIT_HELP, "unrecognized command '%s'", command);
{
char *filename_font_initial = NULL;
Bitmap *bitmap_font_initial = NULL;
+ int font_height;
int i, j;
/* determine settings for initial font (for displaying startup messages) */
Error(ERR_EXIT, "cannot get filename for '%s'", CONFIG_TOKEN_FONT_INITIAL);
/* create additional image buffers for double-buffering and cross-fading */
- bitmap_db_title = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH);
+ bitmap_db_cross = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH);
bitmap_db_field = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH);
+ bitmap_db_panel = CreateBitmap(DXSIZE, DYSIZE, DEFAULT_DEPTH);
bitmap_db_door = CreateBitmap(3 * DXSIZE, DYSIZE + VYSIZE, DEFAULT_DEPTH);
/* initialize screen properties */
InitFontGraphicInfo();
+ font_height = getFontHeight(FC_RED);
+
DrawInitText(getProgramInitString(), 20, FC_YELLOW);
DrawInitText(PROGRAM_COPYRIGHT_STRING, 50, FC_RED);
+ DrawInitText(PROGRAM_WEBSITE_STRING, WIN_YSIZE - 20 - font_height, FC_RED);
DrawInitText("Loading graphics:", 120, FC_GREEN);
}
if (redraw_screen)
{
-#if 1
RedrawBackground();
-#else
- InitGfxBackground();
-#endif
/* force redraw of (open or closed) door graphics */
SetDoorState(DOOR_OPEN_ALL);
InitGfxBackground();
+#if 1
+ em_open_all();
+#endif
+
if (global.autoplay_leveldir)
{
AutoPlayTape();
game_status = GAME_MODE_MAIN;
-#if 1
- em_open_all();
-#endif
-
DrawMainMenu();
InitNetworkServer();
CloseVideoDisplay();
ClosePlatformDependentStuff();
+ if (exit_value != 0)
+ NotifyUserAboutErrorFile();
+
exit(exit_value);
}