From 4a1cf573aae3a92b4ca910482d425e8b789b32eb Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 19 Mar 2017 15:04:17 +0100 Subject: [PATCH] added graphical panel values for time and health (mainly for MM engine) --- graphics/gfx_classic/Makefile | 1 + graphics/gfx_classic/RocksDoorMM.ilbm | Bin 0 -> 6654 bytes src/conf_gfx.c | 47 ++++ src/game.c | 316 +++++++++++++++++++------- src/game.h | 3 + src/game_mm/export.h | 2 + src/game_mm/mm_game.c | 4 + src/libgame/misc.c | 3 + src/libgame/system.h | 5 + 9 files changed, 300 insertions(+), 81 deletions(-) create mode 100644 graphics/gfx_classic/RocksDoorMM.ilbm diff --git a/graphics/gfx_classic/Makefile b/graphics/gfx_classic/Makefile index 7b89ce59..34b7f0fa 100644 --- a/graphics/gfx_classic/Makefile +++ b/graphics/gfx_classic/Makefile @@ -26,6 +26,7 @@ FILES = RocksBusy.$(EXT) \ RocksDF.$(EXT) \ RocksDoor.$(EXT) \ RocksDoor2.$(EXT) \ + RocksDoorMM.$(EXT) \ RocksEMC.$(EXT) \ RocksElements.$(EXT) \ RocksFontBig.$(EXT) \ diff --git a/graphics/gfx_classic/RocksDoorMM.ilbm b/graphics/gfx_classic/RocksDoorMM.ilbm new file mode 100644 index 0000000000000000000000000000000000000000..a169056e9d4c70b8aa20d9ce3cb787860cc9b185 GIT binary patch literal 6654 zcmd^@O>7&-702J~(p;imcnLUdR)8T&J@rV#2dl8GRcs+>0U0R@_|Ss^3ND164CiDD z{@878kUkjkHM-b$qkwy^9dl(BQ4a!?L(v=vOH>&^DcVLfHZ`e;+R6XT?vg8sl+&L2 z0b?l+XXgKY``&!K=l4JO`6Z%}H$R=daOuLOpUe=^JM>3-AAc!J0-r)~`{JedeujpR z=f;g2_wV0dTwHweLiCL26$YV=PyS&Q4Vssh zW_|oHj|QD_Y1Tb6LbE@lD`)81EZvyL5Ta-fhG5POjB_u1F!Kw%Z#fn7YfdYqobKP=7F*8)sXRHP2UL9npz0Y&QIU;R6GgF76kbdvK;<+FippcEP=G3n zDCUW#Vc+02g3Xixs~aWW3#+x_A$3;KFTkZ&}ajF>MvCGBs0le!@AJ5Q}1s1jn&9w;6M{vW*7;n-T z*b@ggvJ?kbS&H$BzP+5_T{XpnKHhuQrkUW~%ZK?0j}MStIu^0*Ql<~~qBR;MU^lnL zb{}kDj{-|Z^OWx_9MA|Q$`+>I7GH; zNk9kpa6o%D0M@e+gPFcP=fwdnt%{0G@p{XBNaGa|gH-`mD)4$64)&2;UkGEcGQb`; z;+57O*rUJ_8w{4%z(sQS9?2k3G`2?u_9tH>+8$-FJrCX@17^PUwi30@4rK)Pm4`c| z@Ez_qQCr!Onb4_s-5sel_eeOAL^F~&NF{u)LwerK@$gM#3bhHgxK0oH$Qx>na66d7NYkBOBCu~Iy(}<#@*f~-DtMZ)VfMheItUR;R8%#Ma%&OA};NP+9^6DU~qKk>W}ic@In%`a4Q3VBoh4T)o_r9{8SqMS{^u%-tc zXbK0Kd8KK&`!wDCnyNX)Xc_fY2_EP7J|sv!QWZQ{29z9xbe8js;RB~nO>JWY$NB_dWVlK(#tL7<9euF(mI0iht zg|-rO0ql~t#2uONN7(gP$)g^$)ef%zy^MAt+4e@W!|hXQld5lO`Ri3^HI%B7F@jy} zR_F@XI}+lr1K%~6Mi4rd-d=?9*r$&c}|HE`lv5Be0@zchAgm$ICc8qG$RvKD89cMeoO z(to%3DRJsnvdJ`cv&5-emQRe48ZGAp%^}k(S@o7#^zzw)KanN)cygBrX}6{~eMH{E zMKDDpBq!UUe1vTBaf_^A&E4K)G!D_;{-$AH{$Rq5E*B4>+`I%I=#AHv6U$z|~~=G2l{v`IT&!Hsj@25!Kd--ts%b zgO9g7IU29Qg|KYB?yte2T@09*V!*_d0z^6UX#!aCOXgf3@cM+Cg9p|AsOr^Lr3Z)u z8fOYF5S%As>*0#mhSSu(D0j=&LZ4}9*Oc8?4>tSi%;bRydlnDQ69Us|j~{iOT%Qo; zSPl=)69dKVOXBA?>60{;=l`o|`kL5@z~sY~FxY70!C}%t^?Y9PqYjgyT~pLI5u{AG zBz>9vKA?03W>SfviV;|iI%PoNWFEsIY*iV`FTTVfJOGTOQ3X`c4K{EBx5^CVteuZe z;Gtbk%0!SdG4Qg|@ftt6&1;Op%Jg z`AwvPObB%gCx)C4p=?2I#h-jNMrF&Np^_?F{=zD8)j}$%kFz0NWkXI>s2o!HoRg@2 z@zaFeD773U5myylD)<9SlV$XbvOl=+@ZgTPC~4sLLQ<6MoBlLil<=wWKRX>O2*t<# zm**OTa|WD=qKN=%w+_5MPg)8R_o0Q7Bee{Yiemx^TU>E8RBbWELFk1L^H629;9aL* zWgM0ftyl&{2Fu8Bzf4?QL^@Gzk>T2cm$x1-@2IfgQsdVUODc<2R6*Qfs@@{+RTI%F xPgN7V?G9EGda9b>BBY_jdixGyC?fQ*zh?&25E-r^lsL0-rO@P;`R^_vz6Ey>!bAW7 literal 0 HcmV?d00001 diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 02b7b78a..782cbc6a 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -6088,6 +6088,32 @@ struct ConfigInfo image_config[] = { "menu.scrollbar.active.ypos", "10" }, { "menu.scrollbar.active.frames", "1" }, + { "gfx.game.panel.time_anim", "RocksDoorMM.png" }, + { "gfx.game.panel.time_anim.x", "5" }, + { "gfx.game.panel.time_anim.y", "0" }, + { "gfx.game.panel.time_anim.width", "90" }, + { "gfx.game.panel.time_anim.height", "35" }, + { "gfx.game.panel.time_anim.frames", "1" }, + { "gfx.game.panel.time_anim.active", "RocksDoorMM.png" }, + { "gfx.game.panel.time_anim.active.x", "105" }, + { "gfx.game.panel.time_anim.active.y", "0" }, + { "gfx.game.panel.time_anim.active.width", "90" }, + { "gfx.game.panel.time_anim.active.height", "35" }, + { "gfx.game.panel.time_anim.active.frames", "1" }, + + { "gfx.game.panel.health_anim", "RocksDoorMM.png" }, + { "gfx.game.panel.health_anim.x", "5" }, + { "gfx.game.panel.health_anim.y", "35" }, + { "gfx.game.panel.health_anim.width", "90" }, + { "gfx.game.panel.health_anim.height", "35" }, + { "gfx.game.panel.health_anim.frames", "1" }, + { "gfx.game.panel.health_anim.active", "RocksDoorMM.png" }, + { "gfx.game.panel.health_anim.active.x", "105" }, + { "gfx.game.panel.health_anim.active.y", "35" }, + { "gfx.game.panel.health_anim.active.width", "90" }, + { "gfx.game.panel.health_anim.active.height", "35" }, + { "gfx.game.panel.health_anim.active.frames", "1" }, + { "gfx.game.button.stop", "RocksDoor.png" }, { "gfx.game.button.stop.x", "305" }, { "gfx.game.button.stop.y", "185" }, @@ -8328,6 +8354,27 @@ struct ConfigInfo image_config[] = { "game.panel.time_ss.draw_masked", "true" }, { "game.panel.time_ss.draw_order", "0" }, + { "game.panel.time_anim.x", "5" }, + { "game.panel.time_anim.y", "72" }, + { "game.panel.time_anim.direction", "right" }, + { "game.panel.time_anim.class", "mm_engine_only" }, + + { "game.panel.health.x", "-1" }, + { "game.panel.health.y", "-1" }, + { "game.panel.health.align", "center" }, + { "game.panel.health.valign", "top" }, + { "game.panel.health.digits", "-1" }, + { "game.panel.health.font", "font.text_2" }, + { "game.panel.health.font_narrow", "font.text_1" }, + { "game.panel.health.draw_masked", "true" }, + { "game.panel.health.draw_order", "0" }, + + { "game.panel.health_anim.x", "5" }, + { "game.panel.health_anim.y", "107" }, + { "game.panel.health_anim.direction", "right" }, + { "game.panel.health_anim.class", "mm_engine_only" }, + { "game.panel.health_anim.style", "reverse" }, + { "game.panel.frame.x", "-1" }, { "game.panel.frame.y", "-1" }, { "game.panel.frame.align", "left" }, diff --git a/src/game.c b/src/game.c index 5391ce91..b8383b11 100644 --- a/src/game.c +++ b/src/game.c @@ -122,87 +122,90 @@ #define GAME_PANEL_TIME_HH 32 #define GAME_PANEL_TIME_MM 33 #define GAME_PANEL_TIME_SS 34 -#define GAME_PANEL_FRAME 35 -#define GAME_PANEL_SHIELD_NORMAL 36 -#define GAME_PANEL_SHIELD_NORMAL_TIME 37 -#define GAME_PANEL_SHIELD_DEADLY 38 -#define GAME_PANEL_SHIELD_DEADLY_TIME 39 -#define GAME_PANEL_EXIT 40 -#define GAME_PANEL_EMC_MAGIC_BALL 41 -#define GAME_PANEL_EMC_MAGIC_BALL_SWITCH 42 -#define GAME_PANEL_LIGHT_SWITCH 43 -#define GAME_PANEL_LIGHT_SWITCH_TIME 44 -#define GAME_PANEL_TIMEGATE_SWITCH 45 -#define GAME_PANEL_TIMEGATE_SWITCH_TIME 46 -#define GAME_PANEL_SWITCHGATE_SWITCH 47 -#define GAME_PANEL_EMC_LENSES 48 -#define GAME_PANEL_EMC_LENSES_TIME 49 -#define GAME_PANEL_EMC_MAGNIFIER 50 -#define GAME_PANEL_EMC_MAGNIFIER_TIME 51 -#define GAME_PANEL_BALLOON_SWITCH 52 -#define GAME_PANEL_DYNABOMB_NUMBER 53 -#define GAME_PANEL_DYNABOMB_SIZE 54 -#define GAME_PANEL_DYNABOMB_POWER 55 -#define GAME_PANEL_PENGUINS 56 -#define GAME_PANEL_SOKOBAN_OBJECTS 57 -#define GAME_PANEL_SOKOBAN_FIELDS 58 -#define GAME_PANEL_ROBOT_WHEEL 59 -#define GAME_PANEL_CONVEYOR_BELT_1 60 -#define GAME_PANEL_CONVEYOR_BELT_2 61 -#define GAME_PANEL_CONVEYOR_BELT_3 62 -#define GAME_PANEL_CONVEYOR_BELT_4 63 -#define GAME_PANEL_CONVEYOR_BELT_1_SWITCH 64 -#define GAME_PANEL_CONVEYOR_BELT_2_SWITCH 65 -#define GAME_PANEL_CONVEYOR_BELT_3_SWITCH 66 -#define GAME_PANEL_CONVEYOR_BELT_4_SWITCH 67 -#define GAME_PANEL_MAGIC_WALL 68 -#define GAME_PANEL_MAGIC_WALL_TIME 69 -#define GAME_PANEL_GRAVITY_STATE 70 -#define GAME_PANEL_GRAPHIC_1 71 -#define GAME_PANEL_GRAPHIC_2 72 -#define GAME_PANEL_GRAPHIC_3 73 -#define GAME_PANEL_GRAPHIC_4 74 -#define GAME_PANEL_GRAPHIC_5 75 -#define GAME_PANEL_GRAPHIC_6 76 -#define GAME_PANEL_GRAPHIC_7 77 -#define GAME_PANEL_GRAPHIC_8 78 -#define GAME_PANEL_ELEMENT_1 79 -#define GAME_PANEL_ELEMENT_2 80 -#define GAME_PANEL_ELEMENT_3 81 -#define GAME_PANEL_ELEMENT_4 82 -#define GAME_PANEL_ELEMENT_5 83 -#define GAME_PANEL_ELEMENT_6 84 -#define GAME_PANEL_ELEMENT_7 85 -#define GAME_PANEL_ELEMENT_8 86 -#define GAME_PANEL_ELEMENT_COUNT_1 87 -#define GAME_PANEL_ELEMENT_COUNT_2 88 -#define GAME_PANEL_ELEMENT_COUNT_3 89 -#define GAME_PANEL_ELEMENT_COUNT_4 90 -#define GAME_PANEL_ELEMENT_COUNT_5 91 -#define GAME_PANEL_ELEMENT_COUNT_6 92 -#define GAME_PANEL_ELEMENT_COUNT_7 93 -#define GAME_PANEL_ELEMENT_COUNT_8 94 -#define GAME_PANEL_CE_SCORE_1 95 -#define GAME_PANEL_CE_SCORE_2 96 -#define GAME_PANEL_CE_SCORE_3 97 -#define GAME_PANEL_CE_SCORE_4 98 -#define GAME_PANEL_CE_SCORE_5 99 -#define GAME_PANEL_CE_SCORE_6 100 -#define GAME_PANEL_CE_SCORE_7 101 -#define GAME_PANEL_CE_SCORE_8 102 -#define GAME_PANEL_CE_SCORE_1_ELEMENT 103 -#define GAME_PANEL_CE_SCORE_2_ELEMENT 104 -#define GAME_PANEL_CE_SCORE_3_ELEMENT 105 -#define GAME_PANEL_CE_SCORE_4_ELEMENT 106 -#define GAME_PANEL_CE_SCORE_5_ELEMENT 107 -#define GAME_PANEL_CE_SCORE_6_ELEMENT 108 -#define GAME_PANEL_CE_SCORE_7_ELEMENT 109 -#define GAME_PANEL_CE_SCORE_8_ELEMENT 110 -#define GAME_PANEL_PLAYER_NAME 111 -#define GAME_PANEL_LEVEL_NAME 112 -#define GAME_PANEL_LEVEL_AUTHOR 113 - -#define NUM_GAME_PANEL_CONTROLS 114 +#define GAME_PANEL_TIME_ANIM 35 +#define GAME_PANEL_HEALTH 36 +#define GAME_PANEL_HEALTH_ANIM 37 +#define GAME_PANEL_FRAME 38 +#define GAME_PANEL_SHIELD_NORMAL 39 +#define GAME_PANEL_SHIELD_NORMAL_TIME 40 +#define GAME_PANEL_SHIELD_DEADLY 41 +#define GAME_PANEL_SHIELD_DEADLY_TIME 42 +#define GAME_PANEL_EXIT 43 +#define GAME_PANEL_EMC_MAGIC_BALL 44 +#define GAME_PANEL_EMC_MAGIC_BALL_SWITCH 45 +#define GAME_PANEL_LIGHT_SWITCH 46 +#define GAME_PANEL_LIGHT_SWITCH_TIME 47 +#define GAME_PANEL_TIMEGATE_SWITCH 48 +#define GAME_PANEL_TIMEGATE_SWITCH_TIME 49 +#define GAME_PANEL_SWITCHGATE_SWITCH 50 +#define GAME_PANEL_EMC_LENSES 51 +#define GAME_PANEL_EMC_LENSES_TIME 52 +#define GAME_PANEL_EMC_MAGNIFIER 53 +#define GAME_PANEL_EMC_MAGNIFIER_TIME 54 +#define GAME_PANEL_BALLOON_SWITCH 55 +#define GAME_PANEL_DYNABOMB_NUMBER 56 +#define GAME_PANEL_DYNABOMB_SIZE 57 +#define GAME_PANEL_DYNABOMB_POWER 58 +#define GAME_PANEL_PENGUINS 59 +#define GAME_PANEL_SOKOBAN_OBJECTS 60 +#define GAME_PANEL_SOKOBAN_FIELDS 61 +#define GAME_PANEL_ROBOT_WHEEL 62 +#define GAME_PANEL_CONVEYOR_BELT_1 63 +#define GAME_PANEL_CONVEYOR_BELT_2 64 +#define GAME_PANEL_CONVEYOR_BELT_3 65 +#define GAME_PANEL_CONVEYOR_BELT_4 66 +#define GAME_PANEL_CONVEYOR_BELT_1_SWITCH 67 +#define GAME_PANEL_CONVEYOR_BELT_2_SWITCH 68 +#define GAME_PANEL_CONVEYOR_BELT_3_SWITCH 69 +#define GAME_PANEL_CONVEYOR_BELT_4_SWITCH 70 +#define GAME_PANEL_MAGIC_WALL 71 +#define GAME_PANEL_MAGIC_WALL_TIME 72 +#define GAME_PANEL_GRAVITY_STATE 73 +#define GAME_PANEL_GRAPHIC_1 74 +#define GAME_PANEL_GRAPHIC_2 75 +#define GAME_PANEL_GRAPHIC_3 76 +#define GAME_PANEL_GRAPHIC_4 77 +#define GAME_PANEL_GRAPHIC_5 78 +#define GAME_PANEL_GRAPHIC_6 79 +#define GAME_PANEL_GRAPHIC_7 80 +#define GAME_PANEL_GRAPHIC_8 81 +#define GAME_PANEL_ELEMENT_1 82 +#define GAME_PANEL_ELEMENT_2 83 +#define GAME_PANEL_ELEMENT_3 84 +#define GAME_PANEL_ELEMENT_4 85 +#define GAME_PANEL_ELEMENT_5 86 +#define GAME_PANEL_ELEMENT_6 87 +#define GAME_PANEL_ELEMENT_7 88 +#define GAME_PANEL_ELEMENT_8 89 +#define GAME_PANEL_ELEMENT_COUNT_1 90 +#define GAME_PANEL_ELEMENT_COUNT_2 91 +#define GAME_PANEL_ELEMENT_COUNT_3 92 +#define GAME_PANEL_ELEMENT_COUNT_4 93 +#define GAME_PANEL_ELEMENT_COUNT_5 94 +#define GAME_PANEL_ELEMENT_COUNT_6 95 +#define GAME_PANEL_ELEMENT_COUNT_7 96 +#define GAME_PANEL_ELEMENT_COUNT_8 97 +#define GAME_PANEL_CE_SCORE_1 98 +#define GAME_PANEL_CE_SCORE_2 99 +#define GAME_PANEL_CE_SCORE_3 100 +#define GAME_PANEL_CE_SCORE_4 101 +#define GAME_PANEL_CE_SCORE_5 102 +#define GAME_PANEL_CE_SCORE_6 103 +#define GAME_PANEL_CE_SCORE_7 104 +#define GAME_PANEL_CE_SCORE_8 105 +#define GAME_PANEL_CE_SCORE_1_ELEMENT 106 +#define GAME_PANEL_CE_SCORE_2_ELEMENT 107 +#define GAME_PANEL_CE_SCORE_3_ELEMENT 108 +#define GAME_PANEL_CE_SCORE_4_ELEMENT 109 +#define GAME_PANEL_CE_SCORE_5_ELEMENT 110 +#define GAME_PANEL_CE_SCORE_6_ELEMENT 111 +#define GAME_PANEL_CE_SCORE_7_ELEMENT 112 +#define GAME_PANEL_CE_SCORE_8_ELEMENT 113 +#define GAME_PANEL_PLAYER_NAME 114 +#define GAME_PANEL_LEVEL_NAME 115 +#define GAME_PANEL_LEVEL_AUTHOR 116 + +#define NUM_GAME_PANEL_CONTROLS 117 struct GamePanelOrderInfo { @@ -219,6 +222,8 @@ struct GamePanelControlInfo struct TextPosInfo *pos; int type; + int graphic, graphic_active; + int value, last_value; int frame, last_frame; int gfx_frame; @@ -402,6 +407,27 @@ static struct GamePanelControlInfo game_panel_controls[] = &game.panel.time_ss, TYPE_INTEGER, }, + { + GAME_PANEL_TIME_ANIM, + &game.panel.time_anim, + TYPE_GRAPHIC, + + IMG_GFX_GAME_PANEL_TIME_ANIM, + IMG_GFX_GAME_PANEL_TIME_ANIM_ACTIVE + }, + { + GAME_PANEL_HEALTH, + &game.panel.health, + TYPE_INTEGER, + }, + { + GAME_PANEL_HEALTH_ANIM, + &game.panel.health_anim, + TYPE_GRAPHIC, + + IMG_GFX_GAME_PANEL_HEALTH_ANIM, + IMG_GFX_GAME_PANEL_HEALTH_ANIM_ACTIVE + }, { GAME_PANEL_FRAME, &game.panel.frame, @@ -2179,6 +2205,8 @@ void UpdateGameControlValues() local_player->gems_still_needed > 0 || local_player->sokobanfields_still_needed > 0 || local_player->lights_still_needed > 0); + int health = (level.game_engine_type == GAME_ENGINE_TYPE_MM ? + MIN(MAX(0, 100 - game_mm.laser_overload_value), 100) : 100); UpdatePlayfieldElementCount(); @@ -2269,6 +2297,14 @@ void UpdateGameControlValues() game_panel_controls[GAME_PANEL_TIME_MM].value = (time / 60) % 60; game_panel_controls[GAME_PANEL_TIME_SS].value = time % 60; + if (game.no_time_limit) + game_panel_controls[GAME_PANEL_TIME_ANIM].value = 100; + else + game_panel_controls[GAME_PANEL_TIME_ANIM].value = time * 100 / level.time; + + game_panel_controls[GAME_PANEL_HEALTH].value = health; + game_panel_controls[GAME_PANEL_HEALTH_ANIM].value = health; + game_panel_controls[GAME_PANEL_FRAME].value = FrameCounter; game_panel_controls[GAME_PANEL_SHIELD_NORMAL].value = @@ -2421,6 +2457,36 @@ void UpdateGameControlValues() gpc->frame = getGraphicAnimationFrame(el2panelimg(gpc->value), gpc->gfx_frame); + if (ANIM_MODE(graphic) == ANIM_RANDOM) + gfx.anim_random_frame = last_anim_random_frame; + } + } + else if (gpc->type == TYPE_GRAPHIC) + { + if (gpc->graphic != IMG_UNDEFINED) + { + int last_anim_random_frame = gfx.anim_random_frame; + int graphic = gpc->graphic; + + if (gpc->value != gpc->last_value) + { + gpc->gfx_frame = 0; + gpc->gfx_random = INIT_GFX_RANDOM(); + } + else + { + gpc->gfx_frame++; + + if (ANIM_MODE(graphic) == ANIM_RANDOM && + IS_NEXT_FRAME(gpc->gfx_frame, graphic)) + gpc->gfx_random = INIT_GFX_RANDOM(); + } + + if (ANIM_MODE(graphic) == ANIM_RANDOM) + gfx.anim_random_frame = gpc->gfx_random; + + gpc->frame = getGraphicAnimationFrame(graphic, gpc->gfx_frame); + if (ANIM_MODE(graphic) == ANIM_RANDOM) gfx.anim_random_frame = last_anim_random_frame; } @@ -2544,6 +2610,94 @@ void DisplayGameControlValues() dst_x, dst_y); } } + else if (type == TYPE_GRAPHIC) + { + int graphic = gpc->graphic; + int graphic_active = gpc->graphic_active; + Bitmap *src_bitmap; + int src_x, src_y; + int width, height; + int dst_x = PANEL_XPOS(pos); + int dst_y = PANEL_YPOS(pos); + boolean skip = (pos->class == get_hash_from_key("mm_engine_only") && + level.game_engine_type != GAME_ENGINE_TYPE_MM); + + if (graphic != IMG_UNDEFINED && !skip) + { + if (pos->style == STYLE_REVERSE) + value = 100 - value; + + getGraphicSource(graphic_active, frame, &src_bitmap, &src_x, &src_y); + + if (pos->direction & MV_HORIZONTAL) + { + width = graphic_info[graphic_active].width * value / 100; + height = graphic_info[graphic_active].height; + + if (pos->direction == MV_LEFT) + { + src_x += graphic_info[graphic_active].width - width; + dst_x += graphic_info[graphic_active].width - width; + } + } + else + { + width = graphic_info[graphic_active].width; + height = graphic_info[graphic_active].height * value / 100; + + if (pos->direction == MV_UP) + { + src_y += graphic_info[graphic_active].height - height; + dst_y += graphic_info[graphic_active].height - height; + } + } + + if (draw_masked) + BlitBitmapMasked(src_bitmap, drawto, src_x, src_y, width, height, + dst_x, dst_y); + else + BlitBitmap(src_bitmap, drawto, src_x, src_y, width, height, + dst_x, dst_y); + + getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y); + + if (pos->direction & MV_HORIZONTAL) + { + if (pos->direction == MV_RIGHT) + { + src_x += width; + dst_x += width; + } + else + { + dst_x = PANEL_XPOS(pos); + } + + width = graphic_info[graphic].width - width; + } + else + { + if (pos->direction == MV_DOWN) + { + src_y += height; + dst_y += height; + } + else + { + dst_y = PANEL_YPOS(pos); + } + + height = graphic_info[graphic].height - height; + } + + if (draw_masked) + BlitBitmapMasked(src_bitmap, drawto, src_x, src_y, width, height, + dst_x, dst_y); + else + BlitBitmap(src_bitmap, drawto, src_x, src_y, width, height, + dst_x, dst_y); + } + } else if (type == TYPE_STRING) { boolean active = (value != 0); diff --git a/src/game.h b/src/game.h index 65e0375a..5d5e887d 100644 --- a/src/game.h +++ b/src/game.h @@ -57,6 +57,9 @@ struct GamePanelInfo struct TextPosInfo time_hh; struct TextPosInfo time_mm; struct TextPosInfo time_ss; + struct TextPosInfo time_anim; + struct TextPosInfo health; + struct TextPosInfo health_anim; struct TextPosInfo frame; struct TextPosInfo shield_normal; struct TextPosInfo shield_normal_time; diff --git a/src/game_mm/export.h b/src/game_mm/export.h index 07417cee..2c7ccea1 100644 --- a/src/game_mm/export.h +++ b/src/game_mm/export.h @@ -145,6 +145,8 @@ struct GameInfo_MM boolean cheat_no_overload; boolean cheat_no_explosion; + + int laser_overload_value; }; struct LevelInfo_MM diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index 97dc986b..0502660b 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -307,6 +307,8 @@ void InitGameEngine_MM() game_mm.game_over = FALSE; game_mm.game_over_cause = 0; + game_mm.laser_overload_value = 0; + /* set global laser control values (must be set before "InitLaser()") */ laser.start_edge.x = 0; laser.start_edge.y = 0; @@ -2922,6 +2924,8 @@ static void GameActions_MM_Ext(byte action[MAX_PLAYERS], boolean warp_mode) laser.overload_value = 0; } + game_mm.laser_overload_value = laser.overload_value; + if (laser.overload_value < MAX_LASER_OVERLOAD - 8) { int color_up = 0xFF * laser.overload_value / MAX_LASER_OVERLOAD; diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 3e7719e1..72e4f051 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -2922,6 +2922,9 @@ int get_parameter_value(char *value_raw, char *suffix, int type) if (string_has_parameter(value, "inner_corners")) result |= STYLE_INNER_CORNERS; + + if (string_has_parameter(value, "reverse")) + result |= STYLE_REVERSE; } else if (strEqual(suffix, ".fade_mode")) { diff --git a/src/libgame/system.h b/src/libgame/system.h index 2fd5e97b..2ca0021f 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -321,6 +321,7 @@ #define STYLE_NONE 0 #define STYLE_ACCURATE_BORDERS (1 << 0) #define STYLE_INNER_CORNERS (1 << 1) +#define STYLE_REVERSE (1 << 2) #define STYLE_DEFAULT STYLE_NONE @@ -1415,6 +1416,10 @@ struct TextPosInfo boolean draw_player; /* special case for network player buttons */ int sort_priority; /* also used for suffix ".draw_order" */ int id; + + int direction; /* needed for panel time/health graphics */ + int class; /* needed for panel time/health graphics */ + int style; /* needed for panel time/health graphics */ }; struct LevelStats -- 2.34.1