X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=d19831759e264f2419d09ad36316986eefa617ae;hb=123c5a87fa9cf6d9759ed7911d3544f05afdd11c;hp=cf7193f87cafe33d5009ae32ac232b784fbb3bb0;hpb=f926e522aef77158e0011ae5ad2cf8805509d6d1;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index cf7193f8..d1983175 100644 --- a/src/game.c +++ b/src/game.c @@ -2221,17 +2221,25 @@ void UpdateGameControlValues() local_player->LevelSolved_CountingTime : level.game_engine_type == GAME_ENGINE_TYPE_EM ? level.native_em_level->lev->time : + level.game_engine_type == GAME_ENGINE_TYPE_SP ? + level.native_sp_level->game_sp->time_played : level.time == 0 ? TimePlayed : TimeLeft); int score = (local_player->LevelSolved ? local_player->LevelSolved_CountingScore : level.game_engine_type == GAME_ENGINE_TYPE_EM ? level.native_em_level->lev->score : + level.game_engine_type == GAME_ENGINE_TYPE_SP ? + level.native_sp_level->game_sp->score : local_player->score); int gems = (level.game_engine_type == GAME_ENGINE_TYPE_EM ? level.native_em_level->lev->required : + level.game_engine_type == GAME_ENGINE_TYPE_SP ? + level.native_sp_level->game_sp->infotrons_still_needed : local_player->gems_still_needed); int exit_closed = (level.game_engine_type == GAME_ENGINE_TYPE_EM ? level.native_em_level->lev->required > 0 : + level.game_engine_type == GAME_ENGINE_TYPE_SP ? + level.native_sp_level->game_sp->infotrons_still_needed > 0 : local_player->gems_still_needed > 0 || local_player->sokobanfields_still_needed > 0 || local_player->lights_still_needed > 0); @@ -2253,6 +2261,10 @@ void UpdateGameControlValues() { for (i = 0; i < MAX_PLAYERS; i++) { + /* only one player in Supaplex game engine */ + if (level.game_engine_type == GAME_ENGINE_TYPE_SP && i > 0) + break; + for (k = 0; k < MAX_NUM_KEYS; k++) { if (level.game_engine_type == GAME_ENGINE_TYPE_EM) @@ -2269,6 +2281,9 @@ void UpdateGameControlValues() if (level.game_engine_type == GAME_ENGINE_TYPE_EM) game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value += level.native_em_level->ply[i]->dynamite; + else if (level.game_engine_type == GAME_ENGINE_TYPE_SP) + game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value += + level.native_sp_level->game_sp->red_disk_count; else game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value += stored_player[i].inventory_size; @@ -2301,6 +2316,9 @@ void UpdateGameControlValues() if (level.game_engine_type == GAME_ENGINE_TYPE_EM) game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value += level.native_em_level->ply[player_nr]->dynamite; + else if (level.game_engine_type == GAME_ENGINE_TYPE_SP) + game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value += + level.native_sp_level->game_sp->red_disk_count; else game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value += stored_player[player_nr].inventory_size; @@ -16422,8 +16440,8 @@ struct EngineSnapshotInfo int choice_pos[NUM_GROUP_ELEMENTS]; /* runtime values for belt position animations */ - int belt_graphic[4 * NUM_BELT_PARTS]; - int belt_anim_mode[4 * NUM_BELT_PARTS]; + int belt_graphic[4][NUM_BELT_PARTS]; + int belt_anim_mode[4][NUM_BELT_PARTS]; }; static struct EngineSnapshotInfo engine_snapshot_rnd; @@ -16463,8 +16481,8 @@ static void SaveEngineSnapshotValues_RND() int graphic = el2img(element); int anim_mode = graphic_info[graphic].anim_mode; - engine_snapshot_rnd.belt_graphic[i * 4 + j] = graphic; - engine_snapshot_rnd.belt_anim_mode[i * 4 + j] = anim_mode; + engine_snapshot_rnd.belt_graphic[i][j] = graphic; + engine_snapshot_rnd.belt_anim_mode[i][j] = anim_mode; } } } @@ -16492,8 +16510,8 @@ static void LoadEngineSnapshotValues_RND() { for (j = 0; j < NUM_BELT_PARTS; j++) { - int graphic = engine_snapshot_rnd.belt_graphic[i * 4 + j]; - int anim_mode = engine_snapshot_rnd.belt_anim_mode[i * 4 + j]; + int graphic = engine_snapshot_rnd.belt_graphic[i][j]; + int anim_mode = engine_snapshot_rnd.belt_anim_mode[i][j]; graphic_info[graphic].anim_mode = anim_mode; }