From: Holger Schemel Date: Fri, 7 Sep 2007 20:26:52 +0000 (+0200) Subject: rnd-20070907-3-src X-Git-Tag: 3.2.4^2~5 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=54c9be6adf735b3844d65f82621d877f80b1ab0d;p=rocksndiamonds.git rnd-20070907-3-src * added optimization to only calculate element count for panel display if really needed (that is, if element count values defined on panel) --- diff --git a/ChangeLog b/ChangeLog index 971e771f..732a7814 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2007-09-07 * fixed (experimental only) redrawing of every tile per frame (even if unneeded) for the extended (R'n'D based) EMC graphics engine + * added optimization to only calculate element count for panel display + if really needed (that is, if element count values defined on panel) 2007-09-03 * fixed bug with displaying background for title messages on info screen diff --git a/src/conftime.h b/src/conftime.h index 567075b8..0b77a2a7 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2007-09-07 21:55" +#define COMPILE_DATE_STRING "2007-09-07 22:25" diff --git a/src/game.c b/src/game.c index fe18b07d..3bc5abd6 100644 --- a/src/game.c +++ b/src/game.c @@ -2111,8 +2111,17 @@ void InitGameControlValues() void UpdatePlayfieldElementCount() { + boolean use_element_count = FALSE; int i, j, x, y; + /* first check if it is needed at all to calculate playfield element count */ + for (i = GAME_PANEL_ELEMENT_COUNT_1; i <= GAME_PANEL_ELEMENT_COUNT_8; i++) + if (!PANEL_DEACTIVATED(game_panel_controls[i].pos)) + use_element_count = TRUE; + + if (!use_element_count) + return; + for (i = 0; i < MAX_NUM_ELEMENTS; i++) element_info[i].element_count = 0; @@ -2342,8 +2351,7 @@ void UpdateGameControlValues() for (i = 0; i < NUM_PANEL_ELEMENTS; i++) game_panel_controls[GAME_PANEL_ELEMENT_COUNT_1 + i].value = (IS_VALID_ELEMENT(game.panel.element_count[i].id) ? - element_info[game.panel.element_count[i].id].element_count : - EL_UNDEFINED); + element_info[game.panel.element_count[i].id].element_count : 0); for (i = 0; i < NUM_PANEL_CE_SCORE; i++) game_panel_controls[GAME_PANEL_CE_SCORE_1 + i].value =