-void DrawGameValue_Level(int value)
-{
- struct TextPosInfo *pos = &game.panel.level_number;
- int chars1 = 2;
- int chars2 = 3;
- int chars = pos->size;
- int font1_nr = pos->font;
- int font2_nr = pos->font_alt;
- int font_nr = font1_nr;
- boolean use_dynamic_chars = (chars == -1 ? TRUE : FALSE);
-
-#if 1
- return; /* !!! USE NEW STUFF !!! */
-#endif
-
- if (PANEL_DEACTIVATED(pos))
- return;
-
- if (use_dynamic_chars) /* use dynamic number of chars */
- {
- chars = (level_nr < 100 ? chars1 : chars2);
- font_nr = (level_nr < 100 ? font1_nr : font2_nr);
- }
-
- pos->width = chars * getFontWidth(font_nr);
-
- DrawText(PANEL_XPOS(pos), PANEL_YPOS(pos), int2str(value, chars), font_nr);
-}
-
-void DrawGameValue_Keys(int key[MAX_NUM_KEYS])
-{
- int i;
-
-#if 1
- return; /* !!! USE NEW STUFF !!! */
-#endif
-
- for (i = 0; i < MAX_NUM_KEYS; i++)
- {
- struct TextPosInfo *pos = &game.panel.key[i];
- int src_x = DOOR_GFX_PAGEX5 + 18 + (i % 4) * MINI_TILEX;
- int src_y = DOOR_GFX_PAGEY1 + 123;
- int dst_x = PANEL_XPOS(pos);
- int dst_y = PANEL_YPOS(pos);
-
- int element = (i >= STD_NUM_KEYS ? EL_EMC_KEY_5 - 4 :
- level.game_engine_type == GAME_ENGINE_TYPE_EM ? EL_EM_KEY_1 :
- EL_KEY_1) + i;
- int graphic = el2edimg(element);
-
- if (PANEL_DEACTIVATED(pos))
- continue;
-
-#if 0
- /* masked blit with tiles from half-size scaled bitmap does not work yet
- (no mask bitmap created for these sizes after loading and scaling) --
- solution: load without creating mask, scale, then create final mask */
-
- BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto, src_x, src_y,
- MINI_TILEX, MINI_TILEY, dst_x, dst_y);
-
- if (key[i])
- {
- Bitmap *src_bitmap;
- int src_x, src_y;
-
- getMiniGraphicSource(graphic, &src_bitmap, &src_x, &src_y);
-
- SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc,
- dst_x - src_x, dst_y - src_y);
- BlitBitmapMasked(src_bitmap, drawto, src_x, src_y, MINI_TILEX, MINI_TILEY,
- dst_x, dst_y);
- }
-#else
- if (key[i])
- DrawMiniGraphicExt(drawto, dst_x, dst_y, graphic);
- else
- BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto, src_x, src_y,
- MINI_TILEX, MINI_TILEY, dst_x, dst_y);
-#endif
- }
-}
-
-void DrawAllGameValues(int emeralds, int dynamite, int score, int time,
- int key_bits)
-{
- int key[MAX_NUM_KEYS];
- int i;
-
- /* prevent EM engine from updating time/score values parallel to GameWon() */
- if (level.game_engine_type == GAME_ENGINE_TYPE_EM &&
- local_player->LevelSolved)
- return;
-
- for (i = 0; i < MAX_NUM_KEYS; i++)
- key[i] = key_bits & (1 << i);
-
- DrawGameValue_Level(level_nr);
-
- DrawGameValue_Emeralds(emeralds);
- DrawGameValue_Dynamite(dynamite);
- DrawGameValue_Score(score);
- DrawGameValue_Time(time);
-
- DrawGameValue_Keys(key);
-}
-
-void UpdateGameDoorValues()
-{
- UpdateGameControlValues();
-}
-
-void DrawGameDoorValues()
-{
- DisplayGameControlValues();
-}
-
-void DrawGameDoorValues_OLD()
-{
- int time_value = (game.no_time_limit ? TimePlayed : TimeLeft);
- int dynamite_value = 0;
- int score_value = (local_player->LevelSolved ? local_player->score_final :
- local_player->score);
- int gems_value = local_player->gems_still_needed;
- int key_bits = 0;
- int i, j;
-
- if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
- {
- DrawGameDoorValues_EM();
-
- return;
- }
-
- if (game.centered_player_nr == -1)
- {
- for (i = 0; i < MAX_PLAYERS; i++)
- {
- for (j = 0; j < MAX_NUM_KEYS; j++)
- if (stored_player[i].key[j])
- key_bits |= (1 << j);
-
- dynamite_value += stored_player[i].inventory_size;
- }
- }
- else
- {
- int player_nr = game.centered_player_nr;
-
- for (i = 0; i < MAX_NUM_KEYS; i++)
- if (stored_player[player_nr].key[i])
- key_bits |= (1 << i);
-
- dynamite_value = stored_player[player_nr].inventory_size;
- }
-
- DrawAllGameValues(gems_value, dynamite_value, score_value, time_value,
- key_bits);
-}
-
-
-/*
- =============================================================================
- InitGameEngine()
- -----------------------------------------------------------------------------
- initialize game engine due to level / tape version number
- =============================================================================
-*/
-
-static void InitGameEngine()
-{
- int i, j, k, l, x, y;
-
- /* set game engine from tape file when re-playing, else from level file */
- game.engine_version = (tape.playing ? tape.engine_version :
- level.game_version);
-
- /* set single or multi-player game mode (needed for re-playing tapes) */
- game.team_mode = setup.team_mode;
-
- if (tape.playing)
- {
- int num_players = 0;
-
- for (i = 0; i < MAX_PLAYERS; i++)
- if (tape.player_participates[i])
- num_players++;
-
- /* multi-player tapes contain input data for more than one player */
- game.team_mode = (num_players > 1);
- }
-
- /* ---------------------------------------------------------------------- */
- /* set flags for bugs and changes according to active game engine version */
- /* ---------------------------------------------------------------------- */
-
- /*
- Summary of bugfix/change:
- Fixed handling for custom elements that change when pushed by the player.
-
- Fixed/changed in version:
- 3.1.0