From fd273393196972c3214f805b0a580c91734c98d8 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 20 Feb 2003 01:59:06 +0100 Subject: [PATCH] rnd-20030220-1-src --- src/conf_chr.c | 12 ++++++++++++ src/conf_chr.h | 12 ++++++++++++ src/conf_cus.c | 12 ++++++++++++ src/conf_cus.h | 12 ++++++++++++ src/conf_e2g.c | 12 ++++++++++++ src/conf_esg.c | 12 ++++++++++++ src/conf_gfx.c | 10 +++++++++- src/conf_gfx.h | 12 ++++++++++++ src/conf_snd.h | 12 ++++++++++++ src/conftime.h | 2 +- src/game.c | 22 ++++++++++++++++++++++ src/libgame/gadgets.c | 21 +++++++++++---------- src/libgame/system.c | 2 +- src/main.h | 9 ++++++++- src/screens.c | 7 ++++--- src/tools.c | 10 +++++++++- 16 files changed, 161 insertions(+), 18 deletions(-) diff --git a/src/conf_chr.c b/src/conf_chr.c index 72eda551..52940986 100644 --- a/src/conf_chr.c +++ b/src/conf_chr.c @@ -1,3 +1,15 @@ +/*********************************************************** +* Rocks'n'Diamonds -- McDuffin Strikes Back! * +*----------------------------------------------------------* +* (c) 1995-2002 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * +*----------------------------------------------------------* +* conf_chr.c * +***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ diff --git a/src/conf_chr.h b/src/conf_chr.h index 9063c7c7..4f8abbc1 100644 --- a/src/conf_chr.h +++ b/src/conf_chr.h @@ -1,3 +1,15 @@ +/*********************************************************** +* Rocks'n'Diamonds -- McDuffin Strikes Back! * +*----------------------------------------------------------* +* (c) 1995-2002 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * +*----------------------------------------------------------* +* conf_chr.h * +***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ diff --git a/src/conf_cus.c b/src/conf_cus.c index 33deebce..d0d10b1b 100644 --- a/src/conf_cus.c +++ b/src/conf_cus.c @@ -1,3 +1,15 @@ +/*********************************************************** +* Rocks'n'Diamonds -- McDuffin Strikes Back! * +*----------------------------------------------------------* +* (c) 1995-2002 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * +*----------------------------------------------------------* +* conf_cus.c * +***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ diff --git a/src/conf_cus.h b/src/conf_cus.h index 3fa751d6..425334be 100644 --- a/src/conf_cus.h +++ b/src/conf_cus.h @@ -1,3 +1,15 @@ +/*********************************************************** +* Rocks'n'Diamonds -- McDuffin Strikes Back! * +*----------------------------------------------------------* +* (c) 1995-2002 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * +*----------------------------------------------------------* +* conf_cus.h * +***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ diff --git a/src/conf_e2g.c b/src/conf_e2g.c index 81a18fce..c659b598 100644 --- a/src/conf_e2g.c +++ b/src/conf_e2g.c @@ -1,3 +1,15 @@ +/*********************************************************** +* Rocks'n'Diamonds -- McDuffin Strikes Back! * +*----------------------------------------------------------* +* (c) 1995-2002 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * +*----------------------------------------------------------* +* conf_e2g.c * +***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ diff --git a/src/conf_esg.c b/src/conf_esg.c index bd63c25a..83ddda90 100644 --- a/src/conf_esg.c +++ b/src/conf_esg.c @@ -1,3 +1,15 @@ +/*********************************************************** +* Rocks'n'Diamonds -- McDuffin Strikes Back! * +*----------------------------------------------------------* +* (c) 1995-2002 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * +*----------------------------------------------------------* +* conf_esg.c * +***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 8496c637..f71a2b2c 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -2194,24 +2194,32 @@ struct ConfigInfo image_config[] = { "player1.moving.right.xpos", "4" }, { "player1.moving.right.ypos", "1" }, { "player1.moving.right.frames", "4" }, - { "player1.moving.right.delay", "4" }, { "player1.moving.right.start_frame", "1" }, + { "player1.moving.right.delay", "4" }, { "player1.digging.down", "RocksHeroes.pcx" }, { "player1.digging.down.xpos", "0" }, { "player1.digging.down.ypos", "0" }, { "player1.digging.down.frames", "4" }, + { "player1.digging.down.start_frame", "1" }, + { "player1.digging.down.delay", "4" }, { "player1.digging.up", "RocksHeroes.pcx" }, { "player1.digging.up.xpos", "4" }, { "player1.digging.up.ypos", "0" }, { "player1.digging.up.frames", "4" }, + { "player1.digging.up.start_frame", "1" }, + { "player1.digging.up.delay", "4" }, { "player1.digging.left", "RocksHeroes.pcx" }, { "player1.digging.left.xpos", "0" }, { "player1.digging.left.ypos", "1" }, { "player1.digging.left.frames", "4" }, + { "player1.digging.left.start_frame", "1" }, + { "player1.digging.left.delay", "4" }, { "player1.digging.right", "RocksHeroes.pcx" }, { "player1.digging.right.xpos", "4" }, { "player1.digging.right.ypos", "1" }, { "player1.digging.right.frames", "4" }, + { "player1.digging.right.start_frame", "1" }, + { "player1.digging.right.delay", "4" }, { "player1.pushing.down", "RocksHeroes.pcx" }, { "player1.pushing.down.xpos", "0" }, { "player1.pushing.down.ypos", "0" }, diff --git a/src/conf_gfx.h b/src/conf_gfx.h index cd81afd0..65c3c846 100644 --- a/src/conf_gfx.h +++ b/src/conf_gfx.h @@ -1,3 +1,15 @@ +/*********************************************************** +* Rocks'n'Diamonds -- McDuffin Strikes Back! * +*----------------------------------------------------------* +* (c) 1995-2002 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * +*----------------------------------------------------------* +* conf_gfx.h * +***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ diff --git a/src/conf_snd.h b/src/conf_snd.h index d5104cb3..60ea119f 100644 --- a/src/conf_snd.h +++ b/src/conf_snd.h @@ -1,3 +1,15 @@ +/*********************************************************** +* Rocks'n'Diamonds -- McDuffin Strikes Back! * +*----------------------------------------------------------* +* (c) 1995-2002 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * +*----------------------------------------------------------* +* conf_snd.h * +***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ diff --git a/src/conftime.h b/src/conftime.h index 1e331afe..4f715e14 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-02-18 21:01]" +#define COMPILE_DATE_STRING "[2003-02-20 01:47]" diff --git a/src/game.c b/src/game.c index b36eda0d..629b323f 100644 --- a/src/game.c +++ b/src/game.c @@ -276,6 +276,10 @@ static void InitField(int x, int y, boolean init_game) Feld[x][y] = EL_SP_MURPHY_CLONE; break; } + else + { + stored_player[0].use_murphy_graphic = TRUE; + } Feld[x][y] = EL_PLAYER1; } @@ -641,6 +645,10 @@ void InitGame() player->GfxPos = 0; player->Frame = 0; + player->GfxAction = ACTION_DEFAULT; + + player->use_murphy_graphic = FALSE; + player->actual_frame_counter = 0; player->frame_reset_delay = 0; @@ -648,6 +656,9 @@ void InitGame() player->last_move_dir = MV_NO_MOVING; player->is_moving = FALSE; + player->is_moving = FALSE; + player->is_waiting = FALSE; + player->move_delay = game.initial_move_delay; player->move_delay_value = game.initial_move_delay_value; @@ -2920,6 +2931,10 @@ void StartMoving(int x, int y) started_moving = TRUE; Store[x][y] = EL_ACID; +#if 0 + /* !!! TEST !!! better use "_FALLING" etc. !!! */ + GfxAction[x][y+1] = ACTION_ACTIVE; +#endif } else if (CAN_SMASH(element) && Feld[x][y+1] == EL_BLOCKED && JustStopped[x][y]) @@ -5781,6 +5796,8 @@ int DigField(struct PlayerInfo *player, dy == +1 ? MV_DOWN : MV_NO_MOVING); int element; + player->is_digging = FALSE; + if (player->MovPos == 0) player->Pushing = FALSE; @@ -6459,6 +6476,9 @@ int DigField(struct PlayerInfo *player, player->push_delay = 0; + if (Feld[x][y] != element) /* really digged something */ + player->is_digging = TRUE; + return MF_MOVING; } @@ -6479,6 +6499,7 @@ boolean SnapField(struct PlayerInfo *player, int dx, int dy) player->Pushing = FALSE; player->snapped = FALSE; + player->is_digging = FALSE; return FALSE; } @@ -6494,6 +6515,7 @@ boolean SnapField(struct PlayerInfo *player, int dx, int dy) return FALSE; player->snapped = TRUE; + player->is_digging = FALSE; DrawLevelField(x, y); BackToFront(); diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index 2405c137..66a8e2b3 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -138,28 +138,29 @@ static void DrawGadget(struct GadgetInfo *gi, boolean pressed, boolean direct) int font_type = gi->text.font_type; int font_width = getFontWidth(font_type); int border = gi->border.size; + strcpy(text, gi->text.value); strcat(text, " "); /* left part of gadget */ - BlitBitmap(gd->bitmap, drawto, - gd->x, gd->y, border, gi->height, gi->x, gi->y); + BlitBitmapOnBackground(gd->bitmap, drawto, + gd->x, gd->y, border, gi->height, gi->x, gi->y); /* middle part of gadget */ for (i=0; i<=gi->text.size; i++) - BlitBitmap(gd->bitmap, drawto, - gd->x + border, gd->y, font_width, gi->height, - gi->x + border + i * font_width, gi->y); + BlitBitmapOnBackground(gd->bitmap, drawto, + gd->x + border, gd->y, font_width, gi->height, + gi->x + border + i * font_width, gi->y); /* right part of gadget */ - BlitBitmap(gd->bitmap, drawto, - gd->x + gi->border.width - border, gd->y, - border, gi->height, gi->x + gi->width - border, gi->y); + BlitBitmapOnBackground(gd->bitmap, drawto, + gd->x + gi->border.width -border, gd->y, border, + gi->height, gi->x + gi->width - border, gi->y); /* gadget text value */ DrawTextExt(drawto, gi->x + border, gi->y + border, text, - font_type, FONT_OPAQUE); + font_type, FONT_MASKED); cursor_letter = gi->text.value[gi->text.cursor_position]; cursor_string[0] = '~'; @@ -171,7 +172,7 @@ static void DrawGadget(struct GadgetInfo *gi, boolean pressed, boolean direct) DrawTextExt(drawto, gi->x + border + gi->text.cursor_position * font_width, gi->y + border, cursor_string, - font_type, FONT_OPAQUE); + font_type, FONT_MASKED); } break; diff --git a/src/libgame/system.c b/src/libgame/system.c index 119bf479..201d0131 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -571,7 +571,7 @@ inline void BlitBitmapOnBackground(Bitmap *src_bitmap, Bitmap *dst_bitmap, int width, int height, int dst_x, int dst_y) { - if (DrawingOnBackground(src_x, src_y)) + if (DrawingOnBackground(dst_x, dst_y)) { /* draw background */ BlitBitmap(gfx.background_bitmap, dst_bitmap, dst_x, dst_y, width, height, diff --git a/src/main.h b/src/main.h index 856d4d14..7664426e 100644 --- a/src/main.h +++ b/src/main.h @@ -894,13 +894,20 @@ struct PlayerInfo int MovDir, MovPos, GfxPos; int Frame; + int GfxAction; + + boolean use_murphy_graphic; + boolean Pushing; boolean Switching; boolean LevelSolved, GameOver; boolean snapped; int last_move_dir; - int is_moving; + boolean is_moving; + + boolean is_digging; + boolean is_waiting; unsigned long move_delay; int move_delay_value; diff --git a/src/screens.c b/src/screens.c index 097eb44e..4c17a8b5 100644 --- a/src/screens.c +++ b/src/screens.c @@ -72,7 +72,8 @@ static struct GadgetInfo *screen_gadget[NUM_SCREEN_GADGETS]; static int setup_mode = SETUP_MODE_MAIN; #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) -static Bitmap *scrollbar_bitmap[4]; +#define NUM_SCROLLBAR_BITMAPS 2 +static Bitmap *scrollbar_bitmap[NUM_SCROLLBAR_BITMAPS]; #endif @@ -3061,7 +3062,7 @@ void CreateScreenGadgets() #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) int i; - for (i=0; i<2; i++) + for (i=0; i < NUM_SCROLLBAR_BITMAPS; i++) { scrollbar_bitmap[i] = CreateBitmap(TILEX, TILEY, DEFAULT_DEPTH); @@ -3088,7 +3089,7 @@ void FreeScreenGadgets() int i; #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) - for (i=0; i<4; i++) + for (i=0; i < NUM_SCROLLBAR_BITMAPS; i++) { /* prevent freeing clip mask and GC twice */ scrollbar_bitmap[i]->clip_mask = None; diff --git a/src/tools.c b/src/tools.c index 8ed2e29b..6cf2d9e6 100644 --- a/src/tools.c +++ b/src/tools.c @@ -609,7 +609,7 @@ void DrawPlayer(struct PlayerInfo *player) /* draw player himself */ - if (game.emulation == EMU_SUPAPLEX) + if (player->use_murphy_graphic) { static int last_dir = MV_LEFT; int action = (player->programmed_action ? player->programmed_action : @@ -666,19 +666,27 @@ void DrawPlayer(struct PlayerInfo *player) { if (player->MovDir == MV_LEFT) graphic = (player->Pushing ? IMG_PLAYER1_PUSHING_LEFT : + player->is_digging ? IMG_PLAYER1_DIGGING_LEFT : player->is_moving ? IMG_PLAYER1_MOVING_LEFT : + player->snapped ? IMG_PLAYER1_SNAPPING_LEFT : IMG_PLAYER1_LEFT); else if (player->MovDir == MV_RIGHT) graphic = (player->Pushing ? IMG_PLAYER1_PUSHING_RIGHT : + player->is_digging ? IMG_PLAYER1_DIGGING_RIGHT : player->is_moving ? IMG_PLAYER1_MOVING_RIGHT : + player->snapped ? IMG_PLAYER1_SNAPPING_RIGHT : IMG_PLAYER1_RIGHT); else if (player->MovDir == MV_UP) graphic = (player->Pushing ? IMG_PLAYER1_PUSHING_UP : + player->is_digging ? IMG_PLAYER1_DIGGING_UP : player->is_moving ? IMG_PLAYER1_MOVING_UP : + player->snapped ? IMG_PLAYER1_SNAPPING_UP : IMG_PLAYER1_UP); else /* MV_DOWN || MV_NO_MOVING */ graphic = (player->Pushing ? IMG_PLAYER1_PUSHING_DOWN : + player->is_digging ? IMG_PLAYER1_DIGGING_DOWN : player->is_moving ? IMG_PLAYER1_MOVING_DOWN : + player->snapped ? IMG_PLAYER1_SNAPPING_DOWN : IMG_PLAYER1_DOWN); graphic = PLAYER_NR_GFX(graphic, player->index_nr); -- 2.34.1