/* values for toon definition */
-#if 0
-#define NUM_TOONS 18
-#else
-#define NUM_TOONS 6
-#endif
+#define MAX_NUM_TOONS 20
-#define DWARF_XSIZE 40
-#define DWARF_YSIZE 48
-#define DWARF_X 2
-#define DWARF_Y 72
-#define DWARF2_Y 186
-#define DWARF_FRAMES 8
-#define DWARF_DELAY 5
-#define DWARF_STEPSIZE 4
-#define JUMPER_XSIZE 48
-#define JUMPER_YSIZE 56
-#define JUMPER_X 2
-#define JUMPER_Y 125
-#define JUMPER_FRAMES 8
-#define JUMPER_DELAY 5
-#define JUMPER_STEPSIZE 4
-#define CLOWN_XSIZE 80
-#define CLOWN_YSIZE 110
-#define CLOWN_X 327
-#define CLOWN_Y 10
-#define CLOWN_FRAMES 1
-#define CLOWN_DELAY 5
-#define CLOWN_STEPSIZE 4
-#define BIRD_XSIZE 32
-#define BIRD_YSIZE 30
-#define BIRD1_X 2
-#define BIRD1_Y 2
-#define BIRD2_X 2
-#define BIRD2_Y 37
-#define BIRD_FRAMES 8
-#define BIRD_DELAY 2
-#define BIRD_STEPSIZE 4
-
-struct ToonInfo toons[NUM_TOONS] =
-{
-#if 0
- {
- IMG_GLOBAL_TOONS,
- DWARF_XSIZE, DWARF_YSIZE,
- DWARF_X, DWARF_Y,
- DWARF_FRAMES,
- DWARF_DELAY,
- DWARF_STEPSIZE,
- ANIM_LOOP,
- ANIMDIR_RIGHT,
- ANIMPOS_DOWN
- },
- {
- IMG_GLOBAL_TOONS,
- DWARF_XSIZE, DWARF_YSIZE,
- DWARF_X, DWARF2_Y,
- DWARF_FRAMES,
- DWARF_DELAY,
- DWARF_STEPSIZE,
- ANIM_LOOP,
- ANIMDIR_LEFT,
- ANIMPOS_DOWN
- },
- {
- IMG_GLOBAL_TOONS,
- JUMPER_XSIZE, JUMPER_YSIZE,
- JUMPER_X, JUMPER_Y,
- JUMPER_FRAMES,
- JUMPER_DELAY,
- JUMPER_STEPSIZE,
- ANIM_LOOP,
- ANIMDIR_RIGHT,
- ANIMPOS_DOWN
- },
- {
- IMG_GLOBAL_TOONS,
- CLOWN_XSIZE, CLOWN_YSIZE,
- CLOWN_X, CLOWN_Y,
- CLOWN_FRAMES,
- CLOWN_DELAY,
- CLOWN_STEPSIZE,
- ANIM_LOOP,
- ANIMDIR_UP,
- ANIMPOS_ANY
- },
- {
- IMG_GLOBAL_TOONS,
- BIRD_XSIZE, BIRD_YSIZE,
- BIRD1_X, BIRD1_Y,
- BIRD_FRAMES,
- BIRD_DELAY,
- BIRD_STEPSIZE,
- ANIM_PINGPONG,
- ANIMDIR_RIGHT,
- ANIMPOS_UPPER
- },
- {
- IMG_GLOBAL_TOONS,
- BIRD_XSIZE, BIRD_YSIZE,
- BIRD2_X, BIRD2_Y,
- BIRD_FRAMES,
- BIRD_DELAY,
- BIRD_STEPSIZE,
- ANIM_PINGPONG,
- ANIMDIR_LEFT,
- ANIMPOS_UPPER
- },
-#else
- {
- IMG_TOON_1,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_RIGHT,
- ANIMPOS_DOWN
- },
- {
- IMG_TOON_2,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_LEFT,
- ANIMPOS_DOWN
- },
- {
- IMG_TOON_3,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_RIGHT,
- ANIMPOS_DOWN
- },
- {
- IMG_TOON_4,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_UP,
- ANIMPOS_ANY
- },
- {
- IMG_TOON_5,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_RIGHT,
- ANIMPOS_UPPER
- },
- {
- IMG_TOON_6,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_LEFT,
- ANIMPOS_UPPER
- },
-#endif
-
-#if 0
- {
- IMG_PLAYER1_MOVING_LEFT,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_LEFT,
- ANIMPOS_DOWN
- },
- {
- IMG_PLAYER1_MOVING_RIGHT,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_RIGHT,
- ANIMPOS_DOWN
- },
- {
- IMG_PENGUIN_MOVING_LEFT,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_LEFT,
- ANIMPOS_DOWN
- },
- {
- IMG_PENGUIN_MOVING_RIGHT,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_RIGHT,
- ANIMPOS_DOWN
- },
- {
- IMG_MOLE_MOVING_LEFT,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_LEFT,
- ANIMPOS_DOWN
- },
- {
- IMG_MOLE_MOVING_RIGHT,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_RIGHT,
- ANIMPOS_DOWN
- },
- {
- IMG_PIG_MOVING_LEFT,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_LEFT,
- ANIMPOS_DOWN
- },
- {
- IMG_PIG_MOVING_RIGHT,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_RIGHT,
- ANIMPOS_DOWN
- },
- {
- IMG_DRAGON_MOVING_LEFT,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_LEFT,
- ANIMPOS_DOWN
- },
- {
- IMG_DRAGON_MOVING_RIGHT,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_RIGHT,
- ANIMPOS_DOWN
- },
- {
- IMG_SATELLITE_MOVING,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_LEFT,
- ANIMPOS_ANY
- },
- {
- IMG_SATELLITE_MOVING,
- -1, -1,
- -1, -1,
- -1,
- -1,
- -1,
- -1,
- ANIMDIR_RIGHT,
- ANIMPOS_ANY
- },
-#endif
-
-};
+static struct ToonInfo toons[MAX_NUM_TOONS];
static void PrepareBackbuffer()
{
void InitToons()
{
+ int num_toons = MAX_NUM_TOONS;
int i;
- for (i=0; i<NUM_TOONS; i++)
+ if (global.num_toons > 0 && global.num_toons < MAX_NUM_TOONS)
+ num_toons = global.num_toons;
+
+ for (i=0; i < num_toons; i++)
{
- int graphic = toons[i].graphic;
+ int graphic = IMG_TOON_1 + i;
+ struct FileInfo *image = getImageListEntry(graphic);
toons[i].bitmap = graphic_info[graphic].bitmap;
toons[i].step_offset = graphic_info[graphic].step_offset;
toons[i].step_delay = graphic_info[graphic].step_delay;
+
+ toons[i].direction = image->parameter[GFX_ARG_DIRECTION];
+ toons[i].position = image->parameter[GFX_ARG_POSITION];
}
InitToonScreen(bitmap_db_door,
BackToFront, PrepareBackbuffer, ToonNeedsRedraw,
- toons, NUM_TOONS,
+ toons, num_toons,
REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,
GAME_FRAME_DELAY);
}
{ ".global_sync", "false", TYPE_BOOLEAN },
{ ".step_offset", "4", TYPE_INTEGER },
{ ".step_delay", "1", TYPE_INTEGER },
+ { ".direction", ARG_UNDEFINED, TYPE_STRING },
+ { ".position", ARG_UNDEFINED, TYPE_STRING },
{ ".name", ARG_UNDEFINED, TYPE_STRING },
{ NULL, NULL, 0 }
/* images not associated to game elements (used for menu screens etc.) */
/* keyword to stop parser: "NO_MORE_ELEMENT_IMAGES" <-- do not change! */
- { "global.border", "RocksScreen.pcx" },
- { "global.door", "RocksDoor.pcx" },
- { "global.toons", "RocksToons.pcx" },
-
{ "toon_1", "RocksToons.pcx" },
{ "toon_1.x", "2" },
{ "toon_1.y", "72" },
{ "toon_1.delay", "1" },
{ "toon_1.step_offset", "4" },
{ "toon_1.step_delay", "5" },
+ { "toon_1.direction", "right" },
+ { "toon_1.position", "bottom" },
{ "toon_2", "RocksToons.pcx" },
{ "toon_2.x", "2" },
{ "toon_2.delay", "1" },
{ "toon_2.step_offset", "4" },
{ "toon_2.step_delay", "5" },
+ { "toon_2.direction", "left" },
+ { "toon_2.position", "bottom" },
{ "toon_3", "RocksToons.pcx" },
{ "toon_3.x", "2" },
{ "toon_3.delay", "1" },
{ "toon_3.step_offset", "4" },
{ "toon_3.step_delay", "5" },
+ { "toon_3.direction", "right" },
+ { "toon_3.position", "bottom" },
{ "toon_4", "RocksToons.pcx" },
{ "toon_4.x", "327" },
{ "toon_4.delay", "1" },
{ "toon_4.step_offset", "1" },
{ "toon_4.step_delay", "1" },
+ { "toon_4.direction", "up" },
+ { "toon_4.position", "any" },
{ "toon_5", "RocksToons.pcx" },
{ "toon_5.x", "2" },
{ "toon_5.mode_pingpong2", "true" },
{ "toon_5.step_offset", "2" },
{ "toon_5.step_delay", "1" },
+ { "toon_5.direction", "right" },
+ { "toon_5.position", "upper" },
{ "toon_6", "RocksToons.pcx" },
{ "toon_6.x", "2" },
{ "toon_6.mode_pingpong2", "true" },
{ "toon_6.step_offset", "2" },
{ "toon_6.step_delay", "1" },
+ { "toon_6.direction", "left" },
+ { "toon_6.position", "upper" },
+
+ { "toon_7", "RocksHeroes.pcx" },
+ { "toon_7.xpos", "0" },
+ { "toon_7.ypos", "1" },
+ { "toon_7.frames", "4" },
+ { "toon_7.delay", "4" },
+ { "toon_7.direction", "left" },
+ { "toon_7.position", "bottom" },
+
+ { "toon_8", "RocksHeroes.pcx" },
+ { "toon_8.xpos", "4" },
+ { "toon_8.ypos", "1" },
+ { "toon_8.frames", "4" },
+ { "toon_8.delay", "4" },
+ { "toon_8.direction", "right" },
+ { "toon_8.position", "bottom" },
+
+ { "toon_9", "RocksHeroes.pcx" },
+ { "toon_9.xpos", "8" },
+ { "toon_9.ypos", "7" },
+ { "toon_9.frames", "4" },
+ { "toon_9.delay", "2" },
+ { "toon_9.direction", "left" },
+ { "toon_9.position", "bottom" },
+
+ { "toon_10", "RocksHeroes.pcx" },
+ { "toon_10.xpos", "12" },
+ { "toon_10.ypos", "7" },
+ { "toon_10.frames", "4" },
+ { "toon_10.delay", "2" },
+ { "toon_10.direction", "right" },
+ { "toon_10.position", "bottom" },
+
+ { "toon_11", "RocksHeroes.pcx" },
+ { "toon_11.xpos", "8" },
+ { "toon_11.ypos", "5" },
+ { "toon_11.frames", "4" },
+ { "toon_11.delay", "2" },
+ { "toon_11.direction", "left" },
+ { "toon_11.position", "bottom" },
+
+ { "toon_12", "RocksHeroes.pcx" },
+ { "toon_12.xpos", "12" },
+ { "toon_12.ypos", "5" },
+ { "toon_12.frames", "4" },
+ { "toon_12.delay", "2" },
+ { "toon_12.direction", "right" },
+ { "toon_12.position", "bottom" },
+
+ { "toon_13", "RocksHeroes.pcx" },
+ { "toon_13.xpos", "8" },
+ { "toon_13.ypos", "1" },
+ { "toon_13.frames", "4" },
+ { "toon_13.delay", "2" },
+ { "toon_13.direction", "left" },
+ { "toon_13.position", "bottom" },
+
+ { "toon_14", "RocksHeroes.pcx" },
+ { "toon_14.xpos", "12" },
+ { "toon_14.ypos", "1" },
+ { "toon_14.frames", "4" },
+ { "toon_14.delay", "2" },
+ { "toon_14.direction", "right" },
+ { "toon_14.position", "bottom" },
+
+ { "toon_15", "RocksHeroes.pcx" },
+ { "toon_15.xpos", "8" },
+ { "toon_15.ypos", "3" },
+ { "toon_15.frames", "4" },
+ { "toon_15.delay", "2" },
+ { "toon_15.direction", "left" },
+ { "toon_15.position", "bottom" },
+
+ { "toon_16", "RocksHeroes.pcx" },
+ { "toon_16.xpos", "12" },
+ { "toon_16.ypos", "3" },
+ { "toon_16.frames", "4" },
+ { "toon_16.delay", "2" },
+ { "toon_16.direction", "right" },
+ { "toon_16.position", "bottom" },
+
+ { "toon_17", "RocksHeroes.pcx" },
+ { "toon_17.xpos", "8" },
+ { "toon_17.ypos", "9" },
+ { "toon_17.frames", "8" },
+ { "toon_17.delay", "2" },
+ { "toon_17.direction", "left" },
+ { "toon_17.position", "any" },
+
+ { "toon_18", "RocksHeroes.pcx" },
+ { "toon_18.xpos", "8" },
+ { "toon_18.ypos", "9" },
+ { "toon_18.frames", "8" },
+ { "toon_18.delay", "2" },
+ { "toon_18.direction", "right" },
+ { "toon_18.position", "any" },
+
+ { "toon_19", "RocksElements.pcx" },
+ { "toon_19.xpos", "8" },
+ { "toon_19.ypos", "0" },
+ { "toon_19.frames", "2" },
+ { "toon_19.delay", "4" },
+ { "toon_19.direction", "down" },
+ { "toon_19.position", "any" },
+
+ { "toon_20", "RocksElements.pcx" },
+ { "toon_20.xpos", "10" },
+ { "toon_20.ypos", "0" },
+ { "toon_20.frames", "2" },
+ { "toon_20.delay", "4" },
+ { "toon_20.direction", "down" },
+ { "toon_20.position", "any" },
+
+ { "global.num_toons", "20" },
+
+ { "global.border", "RocksScreen.pcx" },
+ { "global.door", "RocksDoor.pcx" },
+
+ { "menu.main.hide_static_text", "false" },
{ "font.big", "RocksFontBig.pcx" },
{ "font.medium", "RocksFontMedium.pcx" },
#define IMG_CUSTOM_126 764
#define IMG_CUSTOM_127 765
#define IMG_CUSTOM_128 766
-#define IMG_GLOBAL_BORDER 767
-#define IMG_GLOBAL_DOOR 768
-#define IMG_GLOBAL_TOONS 769
-#define IMG_TOON_1 770
-#define IMG_TOON_2 771
-#define IMG_TOON_3 772
-#define IMG_TOON_4 773
-#define IMG_TOON_5 774
-#define IMG_TOON_6 775
-#define IMG_FONT_BIG 776
-#define IMG_FONT_MEDIUM 777
-#define IMG_FONT_SMALL 778
-#define IMG_FONT_EM 779
-#define IMG_BACKGROUND_DEFAULT 780
-#define IMG_BACKGROUND_DOOR 781
-#define IMG_BACKGROUND_MAIN 782
-#define IMG_BACKGROUND_LEVEL_SERIES 783
-#define IMG_BACKGROUND_HALL_OF_FAME 784
-#define IMG_BACKGROUND_EDITOR_SETTINGS_LEVEL 785
-#define IMG_BACKGROUND_EDITOR_SETTINGS_ELEMENT 786
-#define IMG_BACKGROUND_INFO 787
-#define IMG_BACKGROUND_SETUP 788
-#define IMG_INFO_FONT_EM_1 789
-#define IMG_INFO_FONT_EM_2 790
-#define IMG_INFO_FONT_EM_3 791
-#define IMG_INFO_FONT_EM_4 792
-#define IMG_INFO_FONT_EM_5 793
+#define IMG_TOON_1 767
+#define IMG_TOON_2 768
+#define IMG_TOON_3 769
+#define IMG_TOON_4 770
+#define IMG_TOON_5 771
+#define IMG_TOON_6 772
+#define IMG_TOON_7 773
+#define IMG_TOON_8 774
+#define IMG_TOON_9 775
+#define IMG_TOON_10 776
+#define IMG_TOON_11 777
+#define IMG_TOON_12 778
+#define IMG_TOON_13 779
+#define IMG_TOON_14 780
+#define IMG_TOON_15 781
+#define IMG_TOON_16 782
+#define IMG_TOON_17 783
+#define IMG_TOON_18 784
+#define IMG_TOON_19 785
+#define IMG_TOON_20 786
+#define IMG_GLOBAL_BORDER 787
+#define IMG_GLOBAL_DOOR 788
+#define IMG_FONT_BIG 789
+#define IMG_FONT_MEDIUM 790
+#define IMG_FONT_SMALL 791
+#define IMG_FONT_EM 792
+#define IMG_BACKGROUND_DEFAULT 793
+#define IMG_BACKGROUND_DOOR 794
+#define IMG_BACKGROUND_MAIN 795
+#define IMG_BACKGROUND_LEVEL_SERIES 796
+#define IMG_BACKGROUND_HALL_OF_FAME 797
+#define IMG_BACKGROUND_EDITOR_SETTINGS_LEVEL 798
+#define IMG_BACKGROUND_EDITOR_SETTINGS_ELEMENT 799
+#define IMG_BACKGROUND_INFO 800
+#define IMG_BACKGROUND_SETUP 801
+#define IMG_INFO_FONT_EM_1 802
+#define IMG_INFO_FONT_EM_2 803
+#define IMG_INFO_FONT_EM_3 804
+#define IMG_INFO_FONT_EM_4 805
+#define IMG_INFO_FONT_EM_5 806
-#define NUM_IMAGE_FILES 794
+#define NUM_IMAGE_FILES 807
#endif /* CONF_GFX_H */
-#define COMPILE_DATE_STRING "[2003-02-09 21:58]"
+#define COMPILE_DATE_STRING "[2003-02-10 02:41]"
#define GADGET_ID_CUSTOM_INDESTRUCTIBLE 78
#define GADGET_ID_CUSTOM_CAN_FALL 79
#define GADGET_ID_CUSTOM_CAN_SMASH 80
-#define GADGET_ID_CUSTOM_SLIPPERY 81
+#define GADGET_ID_CUSTOM_PUSHABLE 81
+#define GADGET_ID_CUSTOM_SLIPPERY 82
/* gadgets for buttons in element list */
-#define GADGET_ID_ELEMENTLIST_FIRST 82
+#define GADGET_ID_ELEMENTLIST_FIRST 83
#define GADGET_ID_ELEMENTLIST_LAST (GADGET_ID_ELEMENTLIST_FIRST + \
ED_NUM_ELEMENTLIST_BUTTONS - 1)
#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 5
#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 6
#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 7
-#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 8
+#define ED_CHECKBUTTON_ID_CUSTOM_PUSHABLE 8
+#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 9
-#define ED_NUM_CHECKBUTTONS 9
+#define ED_NUM_CHECKBUTTONS 10
#define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_DOUBLE_SPEED
#define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED
boolean indestructible;
boolean can_fall;
boolean can_smash;
+ boolean pushable;
boolean slippery;
} custom_element_properties[NUM_CUSTOM_ELEMENTS];
},
{
ED_SETTINGS_XPOS, ED_COUNTER_YPOS(7),
+ GADGET_ID_CUSTOM_PUSHABLE,
+ &custom_element_properties[0].pushable,
+ "pushable", "element can be pushed"
+ },
+ {
+ ED_SETTINGS_XPOS, ED_COUNTER_YPOS(8),
GADGET_ID_CUSTOM_SLIPPERY,
&custom_element_properties[0].slippery,
"slippery", "other elements can fall down from it"
custom_element_properties[i].can_smash =
((properties & EP_BIT_CAN_SMASH) != 0 ? TRUE : FALSE);
+ custom_element_properties[i].pushable =
+ ((properties & EP_BIT_PUSHABLE) != 0 ? TRUE : FALSE);
+
custom_element_properties[i].slippery =
((properties & EP_BIT_SLIPPERY) != 0 ? TRUE : FALSE);
}
else
Properties1[element] &= ~EP_BIT_CAN_SMASH;
+ if (custom_element_properties[i].pushable)
+ Properties1[element] |= EP_BIT_PUSHABLE;
+ else
+ Properties1[element] &= ~EP_BIT_PUSHABLE;
+
if (custom_element_properties[i].slippery)
Properties1[element] |= EP_BIT_SLIPPERY;
else
GDI_CHECKED, *checkbutton_info[i].value, GDI_END);
MapCheckbuttonGadget(i);
+ /* draw checkbutton gadget */
+ i = ED_CHECKBUTTON_ID_CUSTOM_PUSHABLE;
+ x = checkbutton_info[i].x + xoffset_right2;
+ y = checkbutton_info[i].y + yoffset_right2;
+
+ checkbutton_info[i].value = &custom_element_properties[nr].pushable;
+
+ DrawTextF(x, y, font_color, checkbutton_info[i].text);
+ ModifyGadget(level_editor_gadget[checkbutton_info[i].gadget_id],
+ GDI_CHECKED, *checkbutton_info[i].value, GDI_END);
+ MapCheckbuttonGadget(i);
+
/* draw checkbutton gadget */
i = ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY;
x = checkbutton_info[i].x + xoffset_right2;
struct SetupFileList *setup_file_list;
char *value;
+ /* !!! CHANGE THIS !!! (redundant initialization) !!! */
gfx.menu_main_hide_static_text = FALSE;
+ global.num_toons = 20;
if ((setup_file_list = loadSetupFileList(filename)) == NULL)
return;
value = getTokenValue(setup_file_list, "menu.main.hide_static_text");
-
if (value != NULL)
gfx.menu_main_hide_static_text = get_boolean_from_string(value);
+ value = getTokenValue(setup_file_list, "global.num_toons");
+ if (value != NULL)
+ global.num_toons = get_integer_from_string(value);
+
freeSetupFileList(setup_file_list);
}
case EL_SPRING:
if (mode == DF_SNAP)
return MF_NO_ACTION;
+
/* no "break" -- fall through to next case */
+
/* the following elements can be pushed by "snapping" */
case EL_BD_ROCK:
if (dy)
player->push_delay = FrameCounter;
#if 0
if (!FrameReached(&player->push_delay, player->push_delay_value) &&
- !tape.playing && element != EL_SPRING)
+ !tape.playing &&
+ element != EL_SPRING)
return MF_NO_ACTION;
#else
if (!FrameReached(&player->push_delay, player->push_delay_value) &&
break;
default:
+ if (IS_PUSHABLE(element))
+ {
+ if (mode == DF_SNAP)
+ return MF_NO_ACTION;
+
+ if (CAN_FALL(element) && dy)
+ return MF_NO_ACTION;
+
+ player->Pushing = TRUE;
+
+ if (!IN_LEV_FIELD(x+dx, y+dy) || !IS_FREE(x+dx, y+dy))
+ return MF_NO_ACTION;
+
+ if (dx && real_dy)
+ {
+ if (IN_LEV_FIELD(jx, jy+real_dy) && !IS_SOLID(Feld[jx][jy+real_dy]))
+ return MF_NO_ACTION;
+ }
+ else if (dy && real_dx)
+ {
+ if (IN_LEV_FIELD(jx+real_dx, jy) && !IS_SOLID(Feld[jx+real_dx][jy]))
+ return MF_NO_ACTION;
+ }
+
+ if (player->push_delay == 0)
+ player->push_delay = FrameCounter;
+
+ if (!FrameReached(&player->push_delay, player->push_delay_value) &&
+ !(tape.playing && tape.file_version < FILE_VERSION_2_0))
+ return MF_NO_ACTION;
+
+ RemoveField(x, y);
+ Feld[x + dx][y + dy] = element;
+
+ player->push_delay_value = 2 + RND(8);
+
+ DrawLevelField(x + dx, y + dy);
+ PlaySoundLevelElementAction(x, y, element, ACTION_PUSHING);
+
+ break;
+ }
+
return MF_NO_ACTION;
}
static char *direction_suffix[NUM_DIRECTIONS + 1];
static char *special_suffix[NUM_SPECIAL_GFX_ARGS + 1];
static char *dummy[1] = { NULL };
+ static char *ignore_image_tokens[] =
+ {
+ "name",
+ "sort_priority",
+ "menu.main.hide_static_text",
+ "global.num_toons",
+ NULL
+ };
int i;
for (i=0; i<MAX_NUM_ELEMENTS + 1; i++)
special_suffix[i] = special_suffix_info[i].suffix;
InitImageList(image_config, NUM_IMAGE_FILES, image_config_suffix,
- element_prefix, action_suffix,direction_suffix,special_suffix);
+ element_prefix, action_suffix,direction_suffix, special_suffix,
+ ignore_image_tokens);
InitSoundList(sound_config, NUM_SOUND_FILES, sound_config_suffix,
- sound_class_prefix, action_suffix, dummy, dummy);
+ sound_class_prefix, action_suffix, dummy, dummy, dummy);
}
void InitLevelArtworkInfo()
static void InitImages()
{
ReloadCustomImages();
- ReinitializeGraphics();
LoadCustomElementDescriptions();
LoadSpecialMenuDesignSettings();
+
+ ReinitializeGraphics();
}
static void InitSound()
ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE);
- ReloadCustomImages();
- ReinitializeGraphics();
-
- LoadCustomElementDescriptions();
- LoadSpecialMenuDesignSettings();
+ InitImages();
FreeTileClipmasks();
InitTileClipmasks();
}
}
-#if 1
+#if 0
#if DEBUG
if (options.verbose)
{
void InitImageList(struct ConfigInfo *config_list, int num_file_list_entries,
struct ConfigInfo *config_suffix_list,
- char **base_prefixes,
- char **ext1_suffixes,
- char **ext2_suffixes,
- char **ext3_suffixes)
+ char **base_prefixes, char **ext1_suffixes,
+ char **ext2_suffixes, char **ext3_suffixes,
+ char **ignore_tokens)
{
int i;
for (i=0; ext3_suffixes[i] != NULL; i++)
image_info->num_ext3_suffixes++;
+ image_info->num_ignore_tokens = 0;
+ for (i=0; ignore_tokens[i] != NULL; i++)
+ image_info->num_ignore_tokens++;
+
image_info->base_prefixes = base_prefixes;
image_info->ext1_suffixes = ext1_suffixes;
image_info->ext2_suffixes = ext2_suffixes;
image_info->ext3_suffixes = ext3_suffixes;
+ image_info->ignore_tokens = ignore_tokens;
image_info->num_property_mapping_entries = 0;
int getImageListPropertyMappingSize();
struct PropertyMapping *getImageListPropertyMapping();
void InitImageList(struct ConfigInfo *, int, struct ConfigInfo *,
- char **, char **, char **, char **);
+ char **, char **, char **, char **, char **);
void ReloadCustomImages();
void CreateImageWithSmallImages(int);
}
}
+ /* the following tokens are no file definitions, but other config tokens */
+ if (strcmp(config_list[i].token, "global.num_toons") == 0 ||
+ strcmp(config_list[i].token, "menu.main.hide_static_text") == 0)
+ is_file_entry = FALSE;
+
if (is_file_entry)
{
if (i > 0)
char **ext1_suffixes = artwork_info->ext1_suffixes;
char **ext2_suffixes = artwork_info->ext2_suffixes;
char **ext3_suffixes = artwork_info->ext3_suffixes;
+ char **ignore_tokens = artwork_info->ignore_tokens;
int num_file_list_entries = artwork_info->num_file_list_entries;
int num_suffix_list_entries = artwork_info->num_suffix_list_entries;
int num_base_prefixes = artwork_info->num_base_prefixes;
int num_ext1_suffixes = artwork_info->num_ext1_suffixes;
int num_ext2_suffixes = artwork_info->num_ext2_suffixes;
int num_ext3_suffixes = artwork_info->num_ext3_suffixes;
+ int num_ignore_tokens = artwork_info->num_ignore_tokens;
char *filename = getCustomArtworkConfigFilename(artwork_info->type);
struct SetupFileList *setup_file_list;
struct SetupFileList *extra_file_list = NULL;
for (i=0; i<num_file_list_entries; i++)
read_token_parameters(setup_file_list, suffix_list, &file_list[i]);
- /* set all known tokens to "known" keyword */
- setTokenValue(setup_file_list, "name", known_token_value);
- setTokenValue(setup_file_list, "sort_priority", known_token_value);
+ /* set all tokens that can be ignored here to "known" keyword */
+ for (i=0; i < num_ignore_tokens; i++)
+ setTokenValue(setup_file_list, ignore_tokens[i], known_token_value);
/* copy all unknown config file tokens to extra config list */
for (list = setup_file_list; list != NULL; list = list->next)
void InitSoundList(struct ConfigInfo *config_list, int num_file_list_entries,
struct ConfigInfo *config_suffix_list,
- char **base_prefixes,
- char **ext1_suffixes,
- char **ext2_suffixes,
- char **ext3_suffixes)
+ char **base_prefixes, char **ext1_suffixes,
+ char **ext2_suffixes, char **ext3_suffixes,
+ char **ignore_tokens)
{
int i;
for (i=0; ext3_suffixes[i] != NULL; i++)
sound_info->num_ext3_suffixes++;
+ sound_info->num_ignore_tokens = 0;
+ for (i=0; ignore_tokens[i] != NULL; i++)
+ sound_info->num_ignore_tokens++;
+
sound_info->base_prefixes = base_prefixes;
sound_info->ext1_suffixes = ext1_suffixes;
sound_info->ext2_suffixes = ext2_suffixes;
sound_info->ext3_suffixes = ext3_suffixes;
+ sound_info->ignore_tokens = ignore_tokens;
sound_info->num_property_mapping_entries = 0;
int getSoundListPropertyMappingSize();
struct PropertyMapping *getSoundListPropertyMapping();
void InitSoundList(struct ConfigInfo *, int, struct ConfigInfo *,
- char **, char **, char **, char **);
+ char **, char **, char **, char **, char **);
void InitReloadCustomSounds(char *);
void InitReloadCustomMusic(char *);
void FreeAllSounds(void);
int num_file_list_entries;
int num_dynamic_file_list_entries;
-
struct FileInfo *file_list; /* static artwork file array */
struct FileInfo *dynamic_file_list; /* dynamic artwrk file array */
int num_suffix_list_entries;
-
struct ConfigInfo *suffix_list; /* parameter suffixes array */
int num_base_prefixes;
int num_ext1_suffixes;
int num_ext2_suffixes;
int num_ext3_suffixes;
-
char **base_prefixes; /* base token prefixes array */
char **ext1_suffixes; /* property suffixes array 1 */
char **ext2_suffixes; /* property suffixes array 2 */
char **ext3_suffixes; /* property suffixes array 3 */
- int num_property_mapping_entries;
+ int num_ignore_tokens;
+ char **ignore_tokens; /* file tokens to be ignored */
+ int num_property_mapping_entries;
struct PropertyMapping *property_mapping; /* mapping token -> artwork */
int sizeof_artwork_list_entry;
/* toon animation functions */
/* ========================================================================= */
+static int get_toon_direction(char *direction_raw)
+{
+ static char *direction = NULL;
+
+ setString(&direction, getStringToLower(direction_raw));
+
+ return (strcmp(direction, "left") == 0 ? MV_LEFT :
+ strcmp(direction, "right") == 0 ? MV_RIGHT :
+ strcmp(direction, "up") == 0 ? MV_UP :
+ strcmp(direction, "down") == 0 ? MV_DOWN : MV_NO_MOVING);
+}
+
void InitToonScreen(Bitmap *save_buffer,
void (*update_function)(void),
void (*prepare_backbuffer_function)(void),
struct ToonInfo *anim = &screen_info.toons[toon_nr];
Bitmap *anim_bitmap = screen_info.toons[toon_nr].bitmap;
GC anim_clip_gc = anim_bitmap->stored_clip_gc;
+ int direction = get_toon_direction(anim->direction);
if (restart)
{
- horiz_move = (anim->direction & (ANIMDIR_LEFT | ANIMDIR_RIGHT));
- vert_move = (anim->direction & (ANIMDIR_UP | ANIMDIR_DOWN));
+ horiz_move = (direction & (MV_LEFT | MV_RIGHT));
+ vert_move = (direction & (MV_UP | MV_DOWN));
anim_delay_value = anim->step_delay * screen_info.frame_delay_value;
frame = getAnimationFrame(anim->anim_frames, anim->anim_delay,
if (horiz_move)
{
- if (anim->position == ANIMPOS_UP)
+ int pos_bottom = screen_info.height - anim->height;
+
+ if (strcmp(anim->position, "top") == 0)
pos_y = 0;
- else if (anim->position == ANIMPOS_DOWN)
- pos_y = screen_info.height - anim->height;
- else if (anim->position == ANIMPOS_UPPER)
- pos_y = SimpleRND((screen_info.height - anim->height) / 2);
+ else if (strcmp(anim->position, "bottom") == 0)
+ pos_y = pos_bottom;
+ else if (strcmp(anim->position, "upper") == 0)
+ pos_y = SimpleRND(pos_bottom / 2);
+ else if (strcmp(anim->position, "lower") == 0)
+ pos_y = pos_bottom / 2 + SimpleRND(pos_bottom / 2);
else
- pos_y = SimpleRND(screen_info.height - anim->height);
+ pos_y = SimpleRND(pos_bottom);
- if (anim->direction == ANIMDIR_RIGHT)
+ if (direction == MV_RIGHT)
{
delta_x = anim->step_offset;
pos_x = -anim->width + delta_x;
delta_x = -anim->step_offset;
pos_x = screen_info.width + delta_x;
}
+
delta_y = 0;
}
else
{
- if (anim->position == ANIMPOS_LEFT)
+ int pos_right = screen_info.width - anim->width;
+
+ if (strcmp(anim->position, "left") == 0)
pos_x = 0;
- else if (anim->position == ANIMPOS_RIGHT)
- pos_x = screen_info.width - anim->width;
+ else if (strcmp(anim->position, "right") == 0)
+ pos_x = pos_right;
else
- pos_x = SimpleRND(screen_info.width - anim->width);
+ pos_x = SimpleRND(pos_right);
- if (anim->direction == ANIMDIR_DOWN)
+ if (direction == MV_DOWN)
{
delta_y = anim->step_offset;
pos_y = -anim->height + delta_y;
delta_y = -anim->step_offset;
pos_y = screen_info.width + delta_y;
}
+
delta_x = 0;
}
}
#define ANIM_REVERSE (1 << 4)
#define ANIM_RANDOM (1 << 5)
+#if 0
/* values for toon animation direction */
#define ANIMDIR_LEFT 1
#define ANIMDIR_RIGHT 2
#define ANIMPOS_UP 4
#define ANIMPOS_DOWN 8
#define ANIMPOS_UPPER 16
+#endif
struct ToonScreenInfo
struct ToonInfo
{
+#if 0
int graphic;
int width, height;
int src_x, src_y;
int anim_start_frame;
Bitmap *bitmap; /* dynamically initialized */
-#if 0
+ char *direction_str;
+ char *position_str;
+
+#else
+
Bitmap *bitmap;
int src_x, src_y;
int width, height;
int anim_mode;
int step_offset;
int step_delay;
+ char *direction;
+ char *position;
#endif
};
#define GFX_ARG_GLOBAL_SYNC 19
#define GFX_ARG_STEP_OFFSET 20
#define GFX_ARG_STEP_DELAY 21
+#define GFX_ARG_DIRECTION 22
+#define GFX_ARG_POSITION 23
+#define GFX_ARG_NAME 24
-#define NUM_GFX_ARGS 22
+#define NUM_GFX_ARGS 25
/* values for sound configuration suffixes */
char *autoplay_leveldir;
int autoplay_level_nr;
+ int num_toons;
+
float frames_per_second;
boolean fps_slowdown;
int fps_slowdown_factor;