From: Holger Schemel Date: Sun, 7 Feb 2010 15:12:37 +0000 (+0100) Subject: rnd-20100207-2-src X-Git-Tag: 3.3.0.0^2~41 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=be1c10e7863850eba871b2c0da9d635313b2bc01;p=rocksndiamonds.git rnd-20100207-2-src --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 8720cb69..b5d32eab 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -6362,6 +6362,7 @@ struct ConfigInfo image_config[] = { "game.forced_scroll_delay_value", "-1" }, { "game.use_native_emc_graphics_engine", "false" }, + { "game.use_native_sp_graphics_engine", "true" }, { "game.use_masked_pushing", "false" }, { "[player].boring_delay_fixed", "1000" }, diff --git a/src/conf_var.c b/src/conf_var.c index dc35009e..a965464d 100644 --- a/src/conf_var.c +++ b/src/conf_var.c @@ -5012,6 +5012,10 @@ struct TokenIntPtrInfo image_config_vars[] = "game.use_native_emc_graphics_engine", &game.use_native_emc_graphics_engine }, + { + "game.use_native_sp_graphics_engine", + &game.use_native_sp_graphics_engine + }, { "game.use_masked_pushing", &game.use_masked_pushing diff --git a/src/conftime.h b/src/conftime.h index dd9f022d..22c49103 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2010-02-07 00:45" +#define COMPILE_DATE_STRING "2010-02-07 16:03" diff --git a/src/engines.h b/src/engines.h index c844d300..02d6119f 100644 --- a/src/engines.h +++ b/src/engines.h @@ -47,6 +47,7 @@ void getGraphicSourcePlayerExt_EM(struct GraphicInfo_EM *, int, int, int); extern void SetBitmaps_SP(Bitmap **); void getGraphicSource_SP(struct GraphicInfo_SP *, int, int, int, int); +int getGraphicInfo_Delay(int); #endif /* ENGINES_H */ diff --git a/src/game.h b/src/game.h index e6b3f396..f6c93315 100644 --- a/src/game.h +++ b/src/game.h @@ -117,6 +117,7 @@ struct GameInfo /* values for graphics engine customization */ boolean use_native_emc_graphics_engine; + boolean use_native_sp_graphics_engine; boolean use_masked_pushing; int forced_scroll_delay_value; int scroll_delay_value; diff --git a/src/game_sp/BugsTerminals.c b/src/game_sp/BugsTerminals.c index 91b60de2..191ce52e 100644 --- a/src/game_sp/BugsTerminals.c +++ b/src/game_sp/BugsTerminals.c @@ -100,9 +100,19 @@ int subAnimateTerminals(int si) int bl, al, X, Y; #endif +#if 1 + int lx = GetX(si); + int ly = GetY(si); + int graphic; +#endif + if (LowByte(PlayField16[si]) != fiTerminal) return subAnimateTerminals; + /* use native frame handling (undo frame incrementation in main loop) */ + if (game.use_native_sp_graphics_engine) + GfxFrame[lx][ly]--; + bl = HighByte(PlayField16[si]); if ((bl & 0x80) == 0x80) bl = (bl | 0xFF00); @@ -111,7 +121,13 @@ int subAnimateTerminals(int si) if (bl <= 0) { MovHighByte(&PlayField16[si], bl); + +#if 1 + if (game.use_native_sp_graphics_engine) + return subAnimateTerminals; +#else return subAnimateTerminals; +#endif } bl = -(subGetRandomNumber() & TerminalMaxCycles); // generate new random number @@ -126,15 +142,20 @@ int subAnimateTerminals(int si) bl = 8; } +#if 1 + graphic = (bl < 8 ? IMG_SP_TERMINAL : IMG_SP_TERMINAL_ACTIVE); + + if (game.use_native_sp_graphics_engine) + GfxFrame[lx][ly] += getGraphicInfo_Delay(graphic); +#endif + TerminalState[si] = bl; // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ al = aniTerminal + bl; X = GetStretchX(si); Y = GetStretchY(si); #if 1 - StretchedSprites.BltImg(X, Y, - bl < 8 ? IMG_SP_TERMINAL : IMG_SP_TERMINAL_ACTIVE, - FrameCounter); + StretchedSprites.BltImg(X, Y, graphic, GfxFrame[lx][ly]); #else StretchedSprites.BltEx(X, Y, al); #endif diff --git a/src/game_sp/main.c b/src/game_sp/main.c index fb46ec87..6282d507 100644 --- a/src/game_sp/main.c +++ b/src/game_sp/main.c @@ -6,13 +6,22 @@ struct GameInfo_SP game_sp_info; struct LevelInfo_SP native_sp_level; +int GfxFrame[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT]; + + void InitGameEngine_SP() { + int x, y; + game_sp_info.LevelSolved = FALSE; game_sp_info.GameOver = FALSE; menBorder.Checked = setup.sp_show_border_elements; + for (x = 0; x < SP_MAX_PLAYFIELD_WIDTH; x++) + for (y = 0; y < SP_MAX_PLAYFIELD_HEIGHT; y++) + GfxFrame[x][y] = 0; + InitScrollPlayfield(); #if 0 @@ -51,8 +60,13 @@ void RedrawPlayfield_SP(boolean force_redraw) void GameActions_SP(byte action[MAX_PLAYERS], boolean warp_mode) { byte single_player_action = action[0]; + int x, y; subMainGameLoop_Main(single_player_action, warp_mode); RedrawPlayfield_SP(FALSE); + + for (x = 0; x < SP_MAX_PLAYFIELD_WIDTH; x++) + for (y = 0; y < SP_MAX_PLAYFIELD_HEIGHT; y++) + GfxFrame[x][y]++; } diff --git a/src/game_sp/main_sp.h b/src/game_sp/main_sp.h index a83734cb..8aa3f7fc 100644 --- a/src/game_sp/main_sp.h +++ b/src/game_sp/main_sp.h @@ -70,6 +70,8 @@ extern Bitmap *screenBitmap; extern Bitmap *sp_objects; +extern int GfxFrame[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT]; + /* ------------------------------------------------------------------------- */ /* exported functions */ diff --git a/src/tools.c b/src/tools.c index 18c5ca28..b4f9fc4a 100644 --- a/src/tools.c +++ b/src/tools.c @@ -7749,6 +7749,11 @@ void getGraphicSource_SP(struct GraphicInfo_SP *g_sp, getGraphicSource(graphic, frame, &g_sp->bitmap, &g_sp->src_x, &g_sp->src_y); } +int getGraphicInfo_Delay(int graphic) +{ + return graphic_info[graphic].anim_delay; +} + void PlayMenuSoundExt(int sound) { if (sound == SND_UNDEFINED)