X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=64cbcc25962907eaa5090d9caf8758dbc37ee8da;hb=b180608242f0190c6c8b31772e4dcfce2e9af47c;hp=a2797839332a92db3510b692b4ddb87f35dae408;hpb=42ab1555a4ae65badec13e8ef32bf5ff71c34568;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index a2797839..64cbcc25 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1750,7 +1750,7 @@ void DrawLevelElementAnimationIfNeeded(int x, int y, int element) static int getPlayerGraphic(struct PlayerInfo *player, int move_dir) { - if (player->use_murphy_graphic) + if (player->use_murphy) { /* this works only because currently only one player can be "murphy" ... */ static int last_horizontal_dir = MV_LEFT; @@ -1769,7 +1769,7 @@ static int getPlayerGraphic(struct PlayerInfo *player, int move_dir) return graphic; } else - return el_act_dir2img(player->element_nr, player->GfxAction, move_dir); + return el_act_dir2img(player->artwork_element, player->GfxAction,move_dir); } static boolean equalGraphics(int graphic1, int graphic2) @@ -5392,6 +5392,24 @@ int map_element_EM_to_RND(int element_em) #endif +int map_direction_RND_to_EM(int direction) +{ + return (direction == MV_UP ? 0 : + direction == MV_RIGHT ? 1 : + direction == MV_DOWN ? 2 : + direction == MV_LEFT ? 3 : + -1); +} + +int map_direction_EM_to_RND(int direction) +{ + return (direction == 0 ? MV_UP : + direction == 1 ? MV_RIGHT : + direction == 2 ? MV_DOWN : + direction == 3 ? MV_LEFT : + MV_NONE); +} + int get_next_element(int element) { switch(element)