gadgets_initialized = TRUE;
}
+inline void InitElementSmallImagesScaledUp(int graphic)
+{
+ CreateImageWithSmallImages(graphic, graphic_info[graphic].scale_up_factor);
+}
+
void InitElementSmallImages()
{
struct PropertyMapping *property_mapping = getImageListPropertyMapping();
/* initialize normal images from static configuration */
for (i = 0; element_to_graphic[i].element > -1; i++)
- CreateImageWithSmallImages(element_to_graphic[i].graphic);
+ InitElementSmallImagesScaledUp(element_to_graphic[i].graphic);
/* initialize special images from static configuration */
for (i = 0; element_to_special_graphic[i].element > -1; i++)
- CreateImageWithSmallImages(element_to_special_graphic[i].graphic);
+ InitElementSmallImagesScaledUp(element_to_special_graphic[i].graphic);
/* initialize images from dynamic configuration */
for (i = 0; i < num_property_mappings; i++)
if (property_mapping[i].artwork_index < MAX_NUM_ELEMENTS)
- CreateImageWithSmallImages(property_mapping[i].artwork_index);
+ InitElementSmallImagesScaledUp(property_mapping[i].artwork_index);
+
+#if 1
+ /* !!! FIX THIS (CHANGE TO USING NORMAL ELEMENT GRAPHIC DEFINITIONS) !!! */
+ for (i = IMG_EMC_OBJECT; i <= IMG_EMC_TITLE; i++)
+ InitElementSmallImagesScaledUp(i);
+#endif
}
+#if 1
+/* !!! FIX THIS (CHANGE TO USING NORMAL ELEMENT GRAPHIC DEFINITIONS) !!! */
+void SetBitmaps_EM(Bitmap **em_bitmap)
+{
+ em_bitmap[0] = graphic_info[IMG_EMC_OBJECT].bitmap;
+ em_bitmap[1] = graphic_info[IMG_EMC_SCORE].bitmap;
+ em_bitmap[2] = graphic_info[IMG_EMC_SPRITE].bitmap;
+ em_bitmap[3] = graphic_info[IMG_EMC_TITLE].bitmap;
+}
+#endif
+
static int getFontBitmapID(int font_nr)
{
int special = -1;
}
}
+#if 1
+ /* set hardcoded definitions for some runtime elements without graphic */
+ element_info[EL_AMOEBA_TO_DIAMOND].graphic[ACTION_DEFAULT] = IMG_AMOEBA_DEAD;
+#endif
+
#if 1
/* now set all undefined/invalid graphics to -1 to set to default after it */
for (i = 0; i < MAX_NUM_ELEMENTS; i++)
default_action_crumbled = element_info[EL_SB_DEFAULT].crumbled[act];
#if 1
+ /* !!! needed because EL_EMPTY_SPACE treated as IS_SP_ELEMENT !!! */
/* !!! make this better !!! */
if (i == EL_EMPTY_SPACE)
{
graphic_info[graphic].crumbled_like = -1; /* do not use clone element */
graphic_info[graphic].diggable_like = -1; /* do not use clone element */
graphic_info[graphic].border_size = TILEX / 8; /* "CRUMBLED" border size */
+ graphic_info[graphic].scale_up_factor = 1; /* default: no scaling up */
graphic_info[graphic].anim_delay_fixed = 0;
graphic_info[graphic].anim_delay_random = 0;
graphic_info[graphic].post_delay_fixed = 0;
if (parameter[GFX_ARG_BORDER_SIZE] != ARG_UNDEFINED_VALUE)
graphic_info[graphic].border_size = parameter[GFX_ARG_BORDER_SIZE];
+ /* optional zoom factor for scaling up the image to a larger size */
+ if (parameter[GFX_ARG_SCALE_UP] != ARG_UNDEFINED_VALUE)
+ graphic_info[graphic].scale_up_factor = parameter[GFX_ARG_SCALE_UP];
+ if (graphic_info[graphic].scale_up_factor < 1)
+ graphic_info[graphic].scale_up_factor = 1; /* no scaling */
+
/* this is only used for player "boring" and "sleeping" actions */
if (parameter[GFX_ARG_ANIM_DELAY_FIXED] != ARG_UNDEFINED_VALUE)
graphic_info[graphic].anim_delay_fixed =
EL_SP_GRAVITY_PORT_RIGHT,
EL_SP_GRAVITY_PORT_UP,
EL_SP_GRAVITY_PORT_DOWN,
+ EL_SP_GRAVITY_ON_PORT_LEFT,
+ EL_SP_GRAVITY_ON_PORT_RIGHT,
+ EL_SP_GRAVITY_ON_PORT_UP,
+ EL_SP_GRAVITY_ON_PORT_DOWN,
+ EL_SP_GRAVITY_OFF_PORT_LEFT,
+ EL_SP_GRAVITY_OFF_PORT_RIGHT,
+ EL_SP_GRAVITY_OFF_PORT_UP,
+ EL_SP_GRAVITY_OFF_PORT_DOWN,
-1
};
EL_SP_GRAVITY_PORT_RIGHT,
EL_SP_GRAVITY_PORT_UP,
EL_SP_GRAVITY_PORT_DOWN,
+ EL_SP_GRAVITY_ON_PORT_LEFT,
+ EL_SP_GRAVITY_ON_PORT_RIGHT,
+ EL_SP_GRAVITY_ON_PORT_UP,
+ EL_SP_GRAVITY_ON_PORT_DOWN,
+ EL_SP_GRAVITY_OFF_PORT_LEFT,
+ EL_SP_GRAVITY_OFF_PORT_RIGHT,
+ EL_SP_GRAVITY_OFF_PORT_UP,
+ EL_SP_GRAVITY_OFF_PORT_DOWN,
-1
};
EL_SP_GRAVITY_PORT_RIGHT,
EL_SP_GRAVITY_PORT_UP,
EL_SP_GRAVITY_PORT_DOWN,
+ EL_SP_GRAVITY_ON_PORT_LEFT,
+ EL_SP_GRAVITY_ON_PORT_RIGHT,
+ EL_SP_GRAVITY_ON_PORT_UP,
+ EL_SP_GRAVITY_ON_PORT_DOWN,
+ EL_SP_GRAVITY_OFF_PORT_LEFT,
+ EL_SP_GRAVITY_OFF_PORT_RIGHT,
+ EL_SP_GRAVITY_OFF_PORT_UP,
+ EL_SP_GRAVITY_OFF_PORT_DOWN,
-1
};
/* should always be valid */
EL_EMPTY,
+ /* standard classic Supaplex elements */
EL_SP_EMPTY,
EL_SP_ZONK,
EL_SP_BASE,
EL_SP_HARDWARE_BASE_6,
EL_SP_CHIP_TOP,
EL_SP_CHIP_BOTTOM,
+
/* additional elements that appeared in newer Supaplex levels */
EL_INVISIBLE_WALL,
- /* more than one murphy in a level results in an inactive clone */
+
+ /* additional gravity port elements (not switching, but setting gravity) */
+ EL_SP_GRAVITY_ON_PORT_LEFT,
+ EL_SP_GRAVITY_ON_PORT_RIGHT,
+ EL_SP_GRAVITY_ON_PORT_UP,
+ EL_SP_GRAVITY_ON_PORT_DOWN,
+ EL_SP_GRAVITY_OFF_PORT_LEFT,
+ EL_SP_GRAVITY_OFF_PORT_RIGHT,
+ EL_SP_GRAVITY_OFF_PORT_UP,
+ EL_SP_GRAVITY_OFF_PORT_DOWN,
+
+ /* more than one Murphy in a level results in an inactive clone */
EL_SP_MURPHY_CLONE,
- /* runtime elements*/
+
+ /* runtime Supaplex elements */
EL_SP_DISK_RED_ACTIVE,
EL_SP_TERMINAL_ACTIVE,
EL_SP_BUGGY_BASE_ACTIVATING,
EL_SP_HARDWARE_BASE_4,
EL_SP_HARDWARE_BASE_5,
EL_SP_HARDWARE_BASE_6,
+ EL_SP_GRAVITY_ON_PORT_LEFT,
+ EL_SP_GRAVITY_ON_PORT_RIGHT,
+ EL_SP_GRAVITY_ON_PORT_UP,
+ EL_SP_GRAVITY_ON_PORT_DOWN,
+ EL_SP_GRAVITY_OFF_PORT_LEFT,
+ EL_SP_GRAVITY_OFF_PORT_RIGHT,
+ EL_SP_GRAVITY_OFF_PORT_UP,
+ EL_SP_GRAVITY_OFF_PORT_DOWN,
EL_CONVEYOR_BELT_1_SWITCH_LEFT,
EL_CONVEYOR_BELT_1_SWITCH_MIDDLE,
EL_CONVEYOR_BELT_1_SWITCH_RIGHT,
static void InitGlobal()
{
+ int i;
+
+ for (i = 0; i < MAX_NUM_ELEMENTS + 1; i++)
+ {
+ element_info[i].token_name = element_name_info[i].token_name;
+ element_info[i].class_name = element_name_info[i].class_name;
+ element_info[i].editor_description=element_name_info[i].editor_description;
+ }
+
global.autoplay_leveldir = NULL;
+ global.convert_leveldir = NULL;
global.frames_per_second = 0;
global.fps_slowdown = FALSE;
global.autoplay_level_nr = atoi(str_ptr); /* get level_nr value */
}
}
+ else if (strncmp(command, "convert ", 8) == 0)
+ {
+ char *str_copy = getStringCopy(&command[8]);
+ char *str_ptr = strchr(str_copy, ' ');
+
+ global.convert_leveldir = str_copy;
+ global.convert_level_nr = -1;
+
+ if (str_ptr != NULL)
+ {
+ *str_ptr++ = '\0'; /* terminate leveldir string */
+ global.convert_level_nr = atoi(str_ptr); /* get level_nr value */
+ }
+ }
else
{
Error(ERR_EXIT_HELP, "unrecognized command '%s'", command);
AutoPlayTape();
return;
}
+ else if (global.convert_leveldir)
+ {
+ ConvertLevels();
+ return;
+ }
game_status = GAME_MODE_MAIN;
+#if 1
+ em_open_all();
+#endif
+
DrawMainMenu();
InitNetworkServer();
FreeAllMusic();
CloseAudio(); /* called after freeing sounds (needed for SDL) */
+#if 1
+ em_close_all();
+#endif
+
FreeAllImages();
FreeTileClipmasks();