#if USE_DELAYED_GFX_REDRAW
#define TEST_DrawLevelField(x, y) \
GfxRedraw[x][y] |= GFX_REDRAW_TILE
-#define TEST_DrawLevelFieldCrumbledSand(x, y) \
+#define TEST_DrawLevelFieldCrumbled(x, y) \
GfxRedraw[x][y] |= GFX_REDRAW_TILE_CRUMBLED
-#define TEST_DrawLevelFieldCrumbledSandNeighbours(x, y) \
+#define TEST_DrawLevelFieldCrumbledNeighbours(x, y) \
GfxRedraw[x][y] |= GFX_REDRAW_TILE_CRUMBLED_NEIGHBOURS
#define TEST_DrawTwinkleOnField(x, y) \
GfxRedraw[x][y] |= GFX_REDRAW_TILE_TWINKLED
#else
#define TEST_DrawLevelField(x, y) \
DrawLevelField(x, y)
-#define TEST_DrawLevelFieldCrumbledSand(x, y) \
- DrawLevelFieldCrumbledSand(x, y)
-#define TEST_DrawLevelFieldCrumbledSandNeighbours(x, y) \
- DrawLevelFieldCrumbledSandNeighbours(x, y)
+#define TEST_DrawLevelFieldCrumbled(x, y) \
+ DrawLevelFieldCrumbled(x, y)
+#define TEST_DrawLevelFieldCrumbledNeighbours(x, y) \
+ DrawLevelFieldCrumbledNeighbours(x, y)
#define TEST_DrawTwinkleOnField(x, y) \
DrawTwinkleOnField(x, y)
#endif
TestIfElementTouchesCustomElement(x, y);
if (GFX_CRUMBLED(element))
- TEST_DrawLevelFieldCrumbledSandNeighbours(x, y);
+ TEST_DrawLevelFieldCrumbledNeighbours(x, y);
if (IS_PLAYER(x, y) && !PLAYERINFO(x, y)->present)
StorePlayer[x][y] = 0;
int frame = getGraphicAnimationFrame(graphic, GfxFrame[x][y]);
if (phase == delay)
- TEST_DrawLevelFieldCrumbledSand(x, y);
+ TEST_DrawLevelFieldCrumbled(x, y);
if (IS_WALKABLE_OVER(Back[x][y]) && Back[x][y] != EL_EMPTY)
{
/* uncrumble neighbour fields, if needed */
if (element == EL_INVISIBLE_SAND)
- TEST_DrawLevelFieldCrumbledSandNeighbours(x, y);
+ TEST_DrawLevelFieldCrumbledNeighbours(x, y);
}
else if (element == EL_INVISIBLE_STEELWALL_ACTIVE ||
element == EL_INVISIBLE_WALL_ACTIVE ||
/* re-crumble neighbour fields, if needed */
if (element == EL_INVISIBLE_SAND)
- TEST_DrawLevelFieldCrumbledSandNeighbours(x, y);
+ TEST_DrawLevelFieldCrumbledNeighbours(x, y);
}
}
}
/* uncrumble neighbour fields, if needed */
if (element == EL_INVISIBLE_SAND)
- TEST_DrawLevelFieldCrumbledSandNeighbours(x, y);
+ TEST_DrawLevelFieldCrumbledNeighbours(x, y);
}
else if (element == EL_INVISIBLE_STEELWALL_ACTIVE ||
element == EL_INVISIBLE_WALL_ACTIVE ||
/* re-crumble neighbour fields, if needed */
if (element == EL_INVISIBLE_SAND)
- TEST_DrawLevelFieldCrumbledSandNeighbours(x, y);
+ TEST_DrawLevelFieldCrumbledNeighbours(x, y);
}
}
}
if (IN_SCR_FIELD(sx, sy))
{
- TEST_DrawLevelFieldCrumbledSand(xx, yy);
+ TEST_DrawLevelFieldCrumbled(xx, yy);
DrawGraphic(sx, sy, flame_graphic, frame);
}
}
{
Feld[x][y] = EL_SAND;
- TEST_DrawLevelFieldCrumbledSandNeighbours(x, y);
+ TEST_DrawLevelFieldCrumbledNeighbours(x, y);
}
else if (element == EL_QUICKSAND_FILLING)
{
InitField(x, y, FALSE);
if (GFX_CRUMBLED(Feld[x][y]))
- TEST_DrawLevelFieldCrumbledSandNeighbours(x, y);
+ TEST_DrawLevelFieldCrumbledNeighbours(x, y);
if (ELEM_IS_PLAYER(move_leave_element))
RelocatePlayer(x, y, move_leave_element);
/* if new animation frame was drawn, correct crumbled sand border */
if (IS_NEW_FRAME(GfxFrame[x][y], graphic))
- TEST_DrawLevelFieldCrumbledSand(x, y);
+ TEST_DrawLevelFieldCrumbled(x, y);
}
static int getSpecialActionElement(int element, int number, int base_element)
TEST_DrawLevelField(x, y);
if (GFX_CRUMBLED(new_element))
- TEST_DrawLevelFieldCrumbledSandNeighbours(x, y);
+ TEST_DrawLevelFieldCrumbledNeighbours(x, y);
}
#if 1
DrawLevelField(x, y);
if (GfxRedraw[x][y] & GFX_REDRAW_TILE_CRUMBLED)
- DrawLevelFieldCrumbledSand(x, y);
+ DrawLevelFieldCrumbled(x, y);
if (GfxRedraw[x][y] & GFX_REDRAW_TILE_CRUMBLED_NEIGHBOURS)
- DrawLevelFieldCrumbledSandNeighbours(x, y);
+ DrawLevelFieldCrumbledNeighbours(x, y);
if (GfxRedraw[x][y] & GFX_REDRAW_TILE_TWINKLED)
DrawTwinkleOnField(x, y);
}
}
+void PlayLevelSound_SP(int xx, int yy, int element_sp, int action_sp)
+{
+ int element = map_element_SP_to_RND(element_sp);
+ int action = map_action_SP_to_RND(action_sp);
+ int offset = (setup.sp_show_border_elements ? 0 : 1);
+ int x = xx - offset;
+ int y = yy - offset;
+
+#if 0
+ printf("::: %d -> %d\n", element_sp, action_sp);
+#endif
+
+ PlayLevelSoundElementAction(x, y, element, action);
+}
+
#if 0
void ChangeTime(int value)
{
int choice_pos[NUM_GROUP_ELEMENTS];
/* runtime values for belt position animations */
- int belt_graphic[4 * NUM_BELT_PARTS];
- int belt_anim_mode[4 * NUM_BELT_PARTS];
+ int belt_graphic[4][NUM_BELT_PARTS];
+ int belt_anim_mode[4][NUM_BELT_PARTS];
};
static struct EngineSnapshotInfo engine_snapshot_rnd;
int graphic = el2img(element);
int anim_mode = graphic_info[graphic].anim_mode;
- engine_snapshot_rnd.belt_graphic[i * 4 + j] = graphic;
- engine_snapshot_rnd.belt_anim_mode[i * 4 + j] = anim_mode;
+ engine_snapshot_rnd.belt_graphic[i][j] = graphic;
+ engine_snapshot_rnd.belt_anim_mode[i][j] = anim_mode;
}
}
}
{
for (j = 0; j < NUM_BELT_PARTS; j++)
{
- int graphic = engine_snapshot_rnd.belt_graphic[i * 4 + j];
- int anim_mode = engine_snapshot_rnd.belt_anim_mode[i * 4 + j];
+ int graphic = engine_snapshot_rnd.belt_graphic[i][j];
+ int anim_mode = engine_snapshot_rnd.belt_anim_mode[i][j];
graphic_info[graphic].anim_mode = anim_mode;
}
RedrawGadget(game_gadget[i]);
}
-static void HandleGameButtons(struct GadgetInfo *gi)
+static void HandleGameButtonsExt(int id)
{
- int id = gi->custom_id;
-
if (game_status != GAME_MODE_PLAYING)
return;
if (setup.sound_music)
{
setup.sound_music = FALSE;
+
FadeMusic();
}
else if (audio.music_available)
else if (audio.loops_available)
{
setup.sound = setup.sound_loops = TRUE;
+
SetAudioMode(setup.sound);
}
break;
else if (audio.sound_available)
{
setup.sound = setup.sound_simple = TRUE;
+
SetAudioMode(setup.sound);
}
break;
break;
}
}
+
+static void HandleGameButtons(struct GadgetInfo *gi)
+{
+ HandleGameButtonsExt(gi->custom_id);
+}
+
+void HandleSoundButtonKeys(Key key)
+{
+#if 1
+ if (key == setup.shortcut.sound_simple)
+ ClickOnGadget(game_gadget[SOUND_CTRL_ID_SIMPLE], MB_LEFTBUTTON);
+ else if (key == setup.shortcut.sound_loops)
+ ClickOnGadget(game_gadget[SOUND_CTRL_ID_LOOPS], MB_LEFTBUTTON);
+ else if (key == setup.shortcut.sound_music)
+ ClickOnGadget(game_gadget[SOUND_CTRL_ID_MUSIC], MB_LEFTBUTTON);
+#else
+ if (key == setup.shortcut.sound_simple)
+ HandleGameButtonsExt(SOUND_CTRL_ID_SIMPLE);
+ else if (key == setup.shortcut.sound_loops)
+ HandleGameButtonsExt(SOUND_CTRL_ID_LOOPS);
+ else if (key == setup.shortcut.sound_music)
+ HandleGameButtonsExt(SOUND_CTRL_ID_MUSIC);
+#endif
+}