From: Holger Schemel Date: Tue, 21 Feb 2017 07:52:12 +0000 (+0100) Subject: fixed pacman graphics for Mirror Magic game engine X-Git-Tag: 4.1.0.0~199 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=8b8ea53b13db11272139e2bd2fa62877ff0d32ec;p=rocksndiamonds.git fixed pacman graphics for Mirror Magic game engine --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 06ca3e06..6cdb6fe0 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -5064,27 +5064,35 @@ struct ConfigInfo image_config[] = { "mm_pacman.right", "RocksMM.png" }, { "mm_pacman.right.xpos", "0" }, { "mm_pacman.right.ypos", "4" }, - { "mm_pacman.right.frames", "2" }, - { "mm_pacman.right.delay", "4" }, - { "mm_pacman.right.offset", "128" }, + { "mm_pacman.right.frames", "1" }, { "mm_pacman.up", "RocksMM.png" }, { "mm_pacman.up.xpos", "1" }, { "mm_pacman.up.ypos", "4" }, - { "mm_pacman.up.frames", "2" }, - { "mm_pacman.up.delay", "4" }, - { "mm_pacman.up.offset", "128" }, + { "mm_pacman.up.frames", "1" }, { "mm_pacman.left", "RocksMM.png" }, { "mm_pacman.left.xpos", "2" }, { "mm_pacman.left.ypos", "4" }, - { "mm_pacman.left.frames", "2" }, - { "mm_pacman.left.delay", "4" }, - { "mm_pacman.left.offset", "128" }, + { "mm_pacman.left.frames", "1" }, { "mm_pacman.down", "RocksMM.png" }, { "mm_pacman.down.xpos", "3" }, { "mm_pacman.down.ypos", "4" }, - { "mm_pacman.down.frames", "2" }, - { "mm_pacman.down.delay", "4" }, - { "mm_pacman.down.offset", "128" }, + { "mm_pacman.down.frames", "1" }, + { "mm_pacman.eating.right", "RocksMM.png" }, + { "mm_pacman.eating.right.xpos", "4" }, + { "mm_pacman.eating.right.ypos", "4" }, + { "mm_pacman.eating.right.frames", "1" }, + { "mm_pacman.eating.up", "RocksMM.png" }, + { "mm_pacman.eating.up.xpos", "5" }, + { "mm_pacman.eating.up.ypos", "4" }, + { "mm_pacman.eating.up.frames", "1" }, + { "mm_pacman.eating.left", "RocksMM.png" }, + { "mm_pacman.eating.left.xpos", "6" }, + { "mm_pacman.eating.left.ypos", "4" }, + { "mm_pacman.eating.left.frames", "1" }, + { "mm_pacman.eating.down", "RocksMM.png" }, + { "mm_pacman.eating.down.xpos", "7" }, + { "mm_pacman.eating.down.ypos", "4" }, + { "mm_pacman.eating.down.frames", "1" }, { "mm_mask_mcduffin.right", "RocksMM.png" }, { "mm_mask_mcduffin.right.xpos", "8" }, diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index 4f4af5f8..61138717 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -3312,7 +3312,7 @@ static void GameActions_MM_Ext(byte action[MAX_PLAYERS], boolean warp_mode) Feld[ELX][ELY] = 0; Feld[x][y] = element; - DrawGraphic_MM(ELX, ELY, -1); + DrawGraphic_MM(ELX, ELY, IMG_EMPTY); DrawField_MM(x, y); if (element == EL_BLOCK_STONE && Box[ELX][ELY]) @@ -3368,7 +3368,7 @@ void MovePacMen() { static int p = -1; int mx, my, ox, oy, nx, ny; - int g, element; + int element; int l; if (++p >= game_mm.num_pacman) @@ -3415,30 +3415,26 @@ void MovePacMen() game_mm.pacman[p].x = nx; game_mm.pacman[p].y = ny; - g = Feld[nx][ny] - EL_PACMAN_RIGHT; + DrawGraphic_MM(ox, oy, IMG_EMPTY); if (element != EL_EMPTY) { + int graphic = el2gfx(Feld[nx][ny]); + Bitmap *bitmap; + int src_x, src_y; int i; + getGraphicSource(graphic, 0, &bitmap, &src_x, &src_y); + CT = Counter(); ox = SX + ox * TILEX; oy = SY + oy * TILEY; for(i=1; i<33; i+=2) - { -#if 1 - // !!! temporary fix to compile -- change to game graphics !!! - BlitBitmap(drawto, window, - SX + g * TILEX, SY + 4 * TILEY, TILEX, TILEY, - ox + i * mx, oy + i * my); -#else - BlitBitmap(pix[PIX_BACK], window, - SX + g * TILEX, SY + 4 * TILEY, TILEX, TILEY, + BlitBitmap(bitmap, window, + src_x, src_y, TILEX, TILEY, ox + i * mx, oy + i * my); -#endif - } Ct = Ct + Counter() - CT; } DrawField_MM(nx, ny); diff --git a/src/game_mm/mm_tools.c b/src/game_mm/mm_tools.c index dbe6ab21..e037aac9 100644 --- a/src/game_mm/mm_tools.c +++ b/src/game_mm/mm_tools.c @@ -271,7 +271,7 @@ void DrawScreenElementExt_MM(int x, int y, int dx, int dy, int element, if (element == EL_PACMAN) { - graphic += 4 * !phase2; + graphic = (phase2 ? IMG_MM_PACMAN_RIGHT : IMG_MM_PACMAN_EATING_RIGHT); if (dir == MV_UP) graphic += 1; diff --git a/src/main.c b/src/main.c index c2e2338d..f766a5de 100644 --- a/src/main.c +++ b/src/main.c @@ -6641,6 +6641,26 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "mm_amoeba_wall", "-", }, + { + "mm_pacman.eating.right", + "mm_pacman", + "pac man (eating right)" + }, + { + "mm_pacman.eating.up", + "mm_pacman", + "pac man (eating up)" + }, + { + "mm_pacman.eating.left", + "mm_pacman", + "pac man (eating left)" + }, + { + "mm_pacman.eating.down", + "mm_pacman", + "pac man (eating down)" + }, /* ----------------------------------------------------------------------- */ /* "unreal" (and therefore not drawable) runtime elements */ diff --git a/src/main.h b/src/main.h index 845f4712..b535fed9 100644 --- a/src/main.h +++ b/src/main.h @@ -1934,8 +1934,12 @@ #define EL_MM_GRAY_BALL_OPENING (EL_FIRST_RUNTIME_REAL + 74) #define EL_MM_ICE_WALL_SHRINKING (EL_FIRST_RUNTIME_REAL + 75) #define EL_MM_AMOEBA_WALL_GROWING (EL_FIRST_RUNTIME_REAL + 76) +#define EL_MM_PACMAN_EATING_RIGHT (EL_FIRST_RUNTIME_REAL + 77) +#define EL_MM_PACMAN_EATING_UP (EL_FIRST_RUNTIME_REAL + 78) +#define EL_MM_PACMAN_EATING_LEFT (EL_FIRST_RUNTIME_REAL + 79) +#define EL_MM_PACMAN_EATING_DOWN (EL_FIRST_RUNTIME_REAL + 80) -#define NUM_DRAWABLE_ELEMENTS (EL_FIRST_RUNTIME_REAL + 77) +#define NUM_DRAWABLE_ELEMENTS (EL_FIRST_RUNTIME_REAL + 81) #define EL_MM_RUNTIME_START EL_MM_EXIT_OPENING #define EL_MM_RUNTIME_END EL_MM_AMOEBA_WALL_GROWING