X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_mm%2Fmm_game.c;h=7ab1c98a3b8be997de2b995266bf14a0bf4df134;hb=f2eecd728fdcc81a8e78876ac79acae29311140f;hp=a15772850bacab0182ca5581a28cf2a9fb28eff8;hpb=343ecd1bed93fa862903ff981ede342825f14401;p=rocksndiamonds.git diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index a1577285..7ab1c98a 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -111,10 +111,10 @@ static int hold_x = -1, hold_y = -1; static int pacman_nr = -1; // various game engine delay counters -static unsigned int rotate_delay = 0; -static unsigned int pacman_delay = 0; -static unsigned int energy_delay = 0; -static unsigned int overload_delay = 0; +static DelayCounter rotate_delay = { AUTO_ROTATE_DELAY }; +static DelayCounter pacman_delay = { PACMAN_MOVE_DELAY }; +static DelayCounter energy_delay = { ENERGY_DELAY }; +static DelayCounter overload_delay = { 0 }; // element masks for scanning pixels of MM elements static const char mm_masks[10][16][16 + 1] = @@ -411,6 +411,20 @@ static void CheckExitMM(void) PlayLevelSound_MM(exit_x, exit_y, exit_element, MM_ACTION_OPENING); } +static void SetLaserColor(int brightness) +{ + int color_min = 0x00; + int color_max = brightness; // (0x00 <= brightness <= 0xFF) + int color_up = color_max * laser.overload_value / MAX_LASER_OVERLOAD; + int color_down = color_max - color_up; + + pen_ray = + GetPixelFromRGB(window, + (native_mm_level.laser_red ? color_max : color_up), + (native_mm_level.laser_green ? color_down : color_min), + (native_mm_level.laser_blue ? color_down : color_min)); +} + static void InitMovDir_MM(int x, int y) { int element = Tile[x][y]; @@ -436,7 +450,7 @@ static void InitMovDir_MM(int x, int y) } } -static void InitField(int x, int y, boolean init_game) +static void InitField(int x, int y) { int element = Tile[x][y]; @@ -537,7 +551,6 @@ static void InitCycleElements_RotateSingleStep(void) Tile[x][y] = next_element; - DrawField_MM(x, y); game_mm.cycle[i].steps -= step; } } @@ -574,10 +587,7 @@ static void InitLaser(void) AddLaserEdge(LX, LY); // set laser starting edge - pen_ray = GetPixelFromRGB(window, - native_mm_level.laser_red * 0xFF, - native_mm_level.laser_green * 0xFF, - native_mm_level.laser_blue * 0xFF); + SetLaserColor(0xFF); } void InitGameEngine_MM(void) @@ -637,10 +647,10 @@ void InitGameEngine_MM(void) CT = Ct = 0; - rotate_delay = 0; - pacman_delay = 0; - energy_delay = 0; - overload_delay = 0; + rotate_delay.count = 0; + pacman_delay.count = 0; + energy_delay.count = 0; + overload_delay.count = 0; ClickElement(-1, -1, -1); @@ -656,7 +666,7 @@ void InitGameEngine_MM(void) Frame[x][y] = 0; Stop[x][y] = FALSE; - InitField(x, y, TRUE); + InitField(x, y); } } @@ -691,6 +701,11 @@ void InitGameActions_MM(void) cycle_steps_done++; } + AdvanceFrameCounter(); + AdvanceGfxFrame(); + + DrawLevel_MM(); + BackToFront(); ColorCycling(); @@ -708,6 +723,48 @@ void InitGameActions_MM(void) SetTileCursorXY(laser.start_edge.x, laser.start_edge.y); SetTileCursorActive(TRUE); + + ResetFrameCounter(&energy_delay); +} + +static void FadeOutLaser(void) +{ + int i; + + for (i = 15; i >= 0; i--) + { + SetLaserColor(0x11 * i); + + DrawLaser(0, DL_LASER_ENABLED); + + BackToFront(); + Delay_WithScreenUpdates(50); + } + + DrawLaser(0, DL_LASER_DISABLED); + + StopSound_MM(SND_MM_GAME_HEALTH_CHARGING); +} + +static void GameOver_MM(int game_over_cause) +{ + // do not handle game over if request dialog is already active + if (game.request_active) + return; + + game_mm.game_over = TRUE; + game_mm.game_over_cause = game_over_cause; + + if (setup.ask_on_game_over) + game.restart_game_message = (game_over_cause == GAME_OVER_BOMB ? + "Bomb killed Mc Duffin! Play it again?" : + game_over_cause == GAME_OVER_NO_ENERGY ? + "Out of magic energy! Play it again?" : + game_over_cause == GAME_OVER_OVERLOADED ? + "Magic spell hit Mc Duffin! Play it again?" : + NULL); + + SetTileCursorActive(FALSE); } void AddLaserEdge(int lx, int ly) @@ -945,7 +1002,7 @@ void ScanLaser(void) if (element == EL_EMPTY) { - if (!HitOnlyAnEdge(element, hit_mask)) + if (!HitOnlyAnEdge(hit_mask)) break; } else if (element == EL_FUSE_ON) @@ -1315,7 +1372,7 @@ void DrawLaser_MM(void) boolean HitElement(int element, int hit_mask) { - if (HitOnlyAnEdge(element, hit_mask)) + if (HitOnlyAnEdge(hit_mask)) return FALSE; if (IS_MOVING(ELX, ELY) || IS_BLOCKED(ELX, ELY)) @@ -1459,14 +1516,14 @@ boolean HitElement(int element, int hit_mask) LX += step_size * XS; LY += step_size * YS; -#if 0 // draw sparkles on mirror - if ((IS_MIRROR(element) || IS_MIRROR_FIXED(element)) && + if ((IS_MIRROR(element) || + IS_MIRROR_FIXED(element) || + element == EL_PRISM) && current_angle != laser.current_angle) { - MoveSprite(vp, &Pfeil[2], 4 + 16 * ELX, 5 + 16 * ELY + 1); + MovDelay[ELX][ELY] = 11; // start animation } -#endif if ((!IS_POLAR(element) && !IS_POLAR_CROSS(element)) && current_angle != laser.current_angle) @@ -1638,7 +1695,7 @@ boolean HitElement(int element, int hit_mask) return TRUE; } -boolean HitOnlyAnEdge(int element, int hit_mask) +boolean HitOnlyAnEdge(int hit_mask) { // check if the laser hit only the edge of an element and, if so, go on @@ -1697,7 +1754,7 @@ boolean HitOnlyAnEdge(int element, int hit_mask) boolean HitPolarizer(int element, int hit_mask) { - if (HitOnlyAnEdge(element, hit_mask)) + if (HitOnlyAnEdge(hit_mask)) return FALSE; if (IS_DF_GRID(element)) @@ -1895,7 +1952,7 @@ boolean HitBlock(int element, int hit_mask) boolean HitLaserSource(int element, int hit_mask) { - if (HitOnlyAnEdge(element, hit_mask)) + if (HitOnlyAnEdge(hit_mask)) return FALSE; PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING); @@ -1907,7 +1964,7 @@ boolean HitLaserSource(int element, int hit_mask) boolean HitLaserDestination(int element, int hit_mask) { - if (HitOnlyAnEdge(element, hit_mask)) + if (HitOnlyAnEdge(hit_mask)) return FALSE; if (element != EL_EXIT_OPEN && @@ -2143,7 +2200,7 @@ boolean HitReflectingWalls(int element, int hit_mask) } } - if (!HitOnlyAnEdge(element, hit_mask)) + if (!HitOnlyAnEdge(hit_mask)) { laser.overloaded = TRUE; @@ -2155,7 +2212,7 @@ boolean HitReflectingWalls(int element, int hit_mask) boolean HitAbsorbingWalls(int element, int hit_mask) { - if (HitOnlyAnEdge(element, hit_mask)) + if (HitOnlyAnEdge(hit_mask)) return FALSE; if (ABS(XS) == 4 && @@ -2398,6 +2455,36 @@ static void GrowAmoeba(int x, int y) } } +static void DrawFieldAnimated_MM(int x, int y) +{ + int element = Tile[x][y]; + + if (IS_BLOCKED(x, y)) + return; + + DrawField_MM(x, y); + + if (IS_MIRROR(element) || + IS_MIRROR_FIXED(element) || + element == EL_PRISM) + { + if (MovDelay[x][y] != 0) // wait some time before next frame + { + MovDelay[x][y]--; + + if (MovDelay[x][y] != 0) + { + int graphic = IMG_TWINKLE_WHITE; + int frame = getGraphicAnimationFrame(graphic, 10 - MovDelay[x][y]); + + DrawGraphicThruMask_MM(SCREENX(x), SCREENY(y), graphic, frame); + } + } + } + + laser.redraw = TRUE; +} + static void Explode_MM(int x, int y, int phase, int mode) { int num_phase = 9, delay = 2; @@ -2452,10 +2539,7 @@ static void Explode_MM(int x, int y, int phase, int mode) Bang_MM(laser.start_edge.x, laser.start_edge.y); Store[x][y] = EL_EMPTY; - game_mm.game_over = TRUE; - game_mm.game_over_cause = GAME_OVER_BOMB; - - SetTileCursorActive(FALSE); + GameOver_MM(GAME_OVER_DELAYED); laser.overloaded = FALSE; } @@ -2463,14 +2547,14 @@ static void Explode_MM(int x, int y, int phase, int mode) { Store[x][y] = EL_EMPTY; - game.restart_game_message = "Bomb killed Mc Duffin! Play it again?"; + GameOver_MM(GAME_OVER_BOMB); } Tile[x][y] = Store[x][y]; Store[x][y] = Store2[x][y] = 0; MovDir[x][y] = MovPos[x][y] = MovDelay[x][y] = 0; - InitField(x, y, FALSE); + InitField(x, y); DrawField_MM(x, y); } else if (!(phase % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) @@ -2709,8 +2793,7 @@ static void ContinueMoving_MM(int x, int y) boolean ClickElement(int x, int y, int button) { - static unsigned int click_delay = 0; - static int click_delay_value = CLICK_DELAY; + static DelayCounter click_delay = { CLICK_DELAY }; static boolean new_button = TRUE; boolean element_clicked = FALSE; int element; @@ -2718,8 +2801,8 @@ boolean ClickElement(int x, int y, int button) if (button == -1) { // initialize static variables - click_delay = 0; - click_delay_value = CLICK_DELAY; + click_delay.count = 0; + click_delay.value = CLICK_DELAY; new_button = TRUE; return FALSE; @@ -2732,7 +2815,7 @@ boolean ClickElement(int x, int y, int button) if (button == MB_RELEASED) { new_button = TRUE; - click_delay_value = CLICK_DELAY; + click_delay.value = CLICK_DELAY; // release eventually hold auto-rotating mirror RotateMirror(x, y, MB_RELEASED); @@ -2740,7 +2823,7 @@ boolean ClickElement(int x, int y, int button) return FALSE; } - if (!FrameReached(&click_delay, click_delay_value) && !new_button) + if (!FrameReached(&click_delay) && !new_button) return FALSE; if (button == MB_MIDDLEBUTTON) // middle button has no function @@ -2827,7 +2910,7 @@ boolean ClickElement(int x, int y, int button) element_clicked = TRUE; } - click_delay_value = (new_button ? CLICK_DELAY_FIRST : CLICK_DELAY); + click_delay.value = (new_button ? CLICK_DELAY_FIRST : CLICK_DELAY); new_button = FALSE; return element_clicked; @@ -2917,7 +3000,9 @@ void RotateMirror(int x, int y, int button) LX, LY, laser.beamer_edge, laser.beamer[1].num); #endif +#if 0 laser.num_edges--; +#endif } ScanLaser(); @@ -2932,7 +3017,7 @@ static void AutoRotateMirrors(void) { int x, y; - if (!FrameReached(&rotate_delay, AUTO_ROTATE_DELAY)) + if (!FrameReached(&rotate_delay)) return; for (x = 0; x < lev_fieldx; x++) @@ -3057,7 +3142,7 @@ void ColorCycling(void) } } -static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) +static void GameActions_MM_Ext(void) { int element; int x, y, i; @@ -3085,6 +3170,8 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) MeltIce(x, y); else if (IS_WALL_CHANGING(element) && Store[x][y] == EL_WALL_AMOEBA) GrowAmoeba(x, y); + else + DrawFieldAnimated_MM(x, y); } AutoRotateMirrors(); @@ -3100,7 +3187,7 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) CT = FrameCounter; - if (game_mm.num_pacman && FrameReached(&pacman_delay, PACMAN_MOVE_DELAY)) + if (game_mm.num_pacman && FrameReached(&pacman_delay)) { MovePacMen(); @@ -3111,61 +3198,25 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) } } - if (FrameReached(&energy_delay, ENERGY_DELAY)) - { - if (game_mm.energy_left > 0) - { - game_mm.energy_left--; - - redraw_mask |= REDRAW_DOOR_1; - } - else if (setup.time_limit && !game_mm.game_over) - { - int i; - - for (i = 15; i >= 0; i--) - { -#if 0 - SetRGB(pen_ray, 0x0000, 0x0000, i * color_scale); -#endif - pen_ray = GetPixelFromRGB(window, - native_mm_level.laser_red * 0x11 * i, - native_mm_level.laser_green * 0x11 * i, - native_mm_level.laser_blue * 0x11 * i); - - DrawLaser(0, DL_LASER_ENABLED); - BackToFront(); - Delay_WithScreenUpdates(50); - } - - StopSound_MM(SND_MM_GAME_HEALTH_CHARGING); -#if 0 - FadeMusic(); -#endif + // skip all following game actions if game is over + if (game_mm.game_over) + return; - DrawLaser(0, DL_LASER_DISABLED); - game_mm.game_over = TRUE; - game_mm.game_over_cause = GAME_OVER_NO_ENERGY; + if (game_mm.energy_left == 0 && !game.no_level_time_limit && game.time_limit) + { + FadeOutLaser(); - SetTileCursorActive(FALSE); + GameOver_MM(GAME_OVER_NO_ENERGY); - game.restart_game_message = "Out of magic energy! Play it again?"; + return; + } -#if 0 - if (Request("Out of magic energy! Play it again?", - REQ_ASK | REQ_STAY_CLOSED)) - { - InitGame(); - } - else - { - game_status = MAINMENU; - DrawMainMenu(); - } -#endif + if (FrameReached(&energy_delay)) + { + if (game_mm.energy_left > 0) + game_mm.energy_left--; - return; - } + // when out of energy, wait another frame to play "out of time" sound } element = laser.dest_element; @@ -3190,9 +3241,11 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) !IS_WALL_AMOEBA(element)) return; + overload_delay.value = HEALTH_DELAY(laser.overloaded); + if (((laser.overloaded && laser.overload_value < MAX_LASER_OVERLOAD) || (!laser.overloaded && laser.overload_value > 0)) && - FrameReached(&overload_delay, HEALTH_DELAY(laser.overloaded))) + FrameReached(&overload_delay)) { if (laser.overloaded) laser.overload_value++; @@ -3209,18 +3262,7 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) if (laser.overload_value < MAX_LASER_OVERLOAD - 8) { - int color_up = 0xFF * laser.overload_value / MAX_LASER_OVERLOAD; - int color_down = 0xFF - color_up; - -#if 0 - SetRGB(pen_ray, (laser.overload_value / 6) * color_scale, 0x0000, - (15 - (laser.overload_value / 6)) * color_scale); -#endif - pen_ray = - GetPixelFromRGB(window, - (native_mm_level.laser_red ? 0xFF : color_up), - (native_mm_level.laser_green ? color_down : 0x00), - (native_mm_level.laser_blue ? color_down : 0x00)); + SetLaserColor(0xFF); DrawLaser(0, DL_LASER_ENABLED); } @@ -3258,44 +3300,11 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) if (laser.overload_value == MAX_LASER_OVERLOAD) { - int i; - UpdateAndDisplayGameControlValues(); - for (i = 15; i >= 0; i--) - { -#if 0 - SetRGB(pen_ray, i * color_scale, 0x0000, 0x0000); -#endif - - pen_ray = GetPixelFromRGB(window, 0x11 * i, 0x00, 0x00); - - DrawLaser(0, DL_LASER_ENABLED); - BackToFront(); - Delay_WithScreenUpdates(50); - } - - DrawLaser(0, DL_LASER_DISABLED); - - game_mm.game_over = TRUE; - game_mm.game_over_cause = GAME_OVER_OVERLOADED; + FadeOutLaser(); - SetTileCursorActive(FALSE); - - game.restart_game_message = "Magic spell hit Mc Duffin! Play it again?"; - -#if 0 - if (Request("Magic spell hit Mc Duffin! Play it again?", - REQ_ASK | REQ_STAY_CLOSED)) - { - InitGame(); - } - else - { - game_status = MAINMENU; - DrawMainMenu(); - } -#endif + GameOver_MM(GAME_OVER_OVERLOADED); return; } @@ -3311,36 +3320,10 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) if (game_mm.cheat_no_explosion) return; -#if 0 - laser.num_damages--; - DrawLaser(0, DL_LASER_DISABLED); - laser.num_edges = 0; -#endif - Bang_MM(ELX, ELY); laser.dest_element = EL_EXPLODING_OPAQUE; -#if 0 - Bang_MM(ELX, ELY); - laser.num_damages--; - DrawLaser(0, DL_LASER_DISABLED); - - laser.num_edges = 0; - Bang_MM(laser.start_edge.x, laser.start_edge.y); - - if (Request("Bomb killed Mc Duffin! Play it again?", - REQ_ASK | REQ_STAY_CLOSED)) - { - InitGame(); - } - else - { - game_status = MAINMENU; - DrawMainMenu(); - } -#endif - return; } @@ -3696,24 +3679,27 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) if (element == EL_FUEL_FULL && CT > 10) { - for (i = game_mm.energy_left; i <= MAX_LASER_ENERGY; i+=2) + int num_init_game_frames = INIT_GAME_ACTIONS_DELAY; + int start = num_init_game_frames * game_mm.energy_left / native_mm_level.time; + + for (i = start; i <= num_init_game_frames; i++) { -#if 0 - BlitBitmap(pix[PIX_DOOR], drawto, - DOOR_GFX_PAGEX4 + XX_ENERGY, - DOOR_GFX_PAGEY1 + YY_ENERGY + ENERGY_YSIZE - i, - ENERGY_XSIZE, i, DX_ENERGY, - DY_ENERGY + ENERGY_YSIZE - i); -#endif + if (i == num_init_game_frames) + StopSound_MM(SND_MM_GAME_LEVELTIME_CHARGING); + else if (setup.sound_loops) + PlaySoundLoop_MM(SND_MM_GAME_LEVELTIME_CHARGING); + else + PlaySound_MM(SND_MM_GAME_LEVELTIME_CHARGING); - redraw_mask |= REDRAW_DOOR_1; - BackToFront(); + game_mm.energy_left = native_mm_level.time * i / num_init_game_frames; - Delay_WithScreenUpdates(20); + UpdateAndDisplayGameControlValues(); + + BackToFront(); } - game_mm.energy_left = MAX_LASER_ENERGY; - Tile[ELX][ELY] = EL_FUEL_EMPTY; + Tile[ELX][ELY] = laser.dest_element = EL_FUEL_EMPTY; + DrawField_MM(ELX, ELY); DrawLaser(0, DL_LASER_ENABLED); @@ -3724,12 +3710,12 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) return; } -void GameActions_MM(struct MouseActionInfo action, boolean warp_mode) +void GameActions_MM(struct MouseActionInfo action) { boolean element_clicked = ClickElement(action.lx, action.ly, action.button); boolean button_released = (action.button == MB_RELEASED); - GameActions_MM_Ext(action, warp_mode); + GameActions_MM_Ext(); CheckSingleStepMode_MM(element_clicked, button_released); } @@ -3839,182 +3825,6 @@ void MovePacMen(void) } } -void GameWon_MM(void) -{ - int hi_pos; - boolean raise_level = FALSE; - -#if 0 - if (local_player->MovPos) - return; - - local_player->LevelSolved = FALSE; -#endif - - if (game_mm.energy_left) - { - if (setup.sound_loops) - PlaySoundExt(SND_SIRR, SOUND_MAX_VOLUME, SOUND_MAX_RIGHT, - SND_CTRL_PLAY_LOOP); - - while (game_mm.energy_left > 0) - { - if (!setup.sound_loops) - PlaySoundStereo(SND_SIRR, SOUND_MAX_RIGHT); - - /* - if (game_mm.energy_left > 0 && !(game_mm.energy_left % 10)) - RaiseScore_MM(native_mm_level.score[SC_ZEITBONUS]); - */ - - RaiseScore_MM(5); - - game_mm.energy_left--; - if (game_mm.energy_left >= 0) - { -#if 0 - BlitBitmap(pix[PIX_DOOR], drawto, - DOOR_GFX_PAGEX5 + XX_ENERGY, DOOR_GFX_PAGEY1 + YY_ENERGY, - ENERGY_XSIZE, ENERGY_YSIZE - game_mm.energy_left, - DX_ENERGY, DY_ENERGY); -#endif - redraw_mask |= REDRAW_DOOR_1; - } - - BackToFront(); - Delay_WithScreenUpdates(10); - } - - if (setup.sound_loops) - StopSound(SND_SIRR); - } - else if (native_mm_level.time == 0) // level without time limit - { - if (setup.sound_loops) - PlaySoundExt(SND_SIRR, SOUND_MAX_VOLUME, SOUND_MAX_RIGHT, - SND_CTRL_PLAY_LOOP); - - while (TimePlayed < 999) - { - if (!setup.sound_loops) - PlaySoundStereo(SND_SIRR, SOUND_MAX_RIGHT); - if (TimePlayed < 999 && !(TimePlayed % 10)) - RaiseScore_MM(native_mm_level.score[SC_TIME_BONUS]); - if (TimePlayed < 900 && !(TimePlayed % 10)) - TimePlayed += 10; - else - TimePlayed++; - - /* - DrawText(DX_TIME, DY_TIME, int2str(TimePlayed, 3), FONT_TEXT_2); - */ - - BackToFront(); - Delay_WithScreenUpdates(10); - } - - if (setup.sound_loops) - StopSound(SND_SIRR); - } - - CloseDoor(DOOR_CLOSE_1); - - Request("Level solved!", REQ_CONFIRM); - - if (level_nr == leveldir_current->handicap_level) - { - leveldir_current->handicap_level++; - SaveLevelSetup_SeriesInfo(); - } - - if (level_editor_test_game) - game_mm.score = -1; // no highscore when playing from editor - else if (level_nr < leveldir_current->last_level) - raise_level = TRUE; // advance to next level - - if ((hi_pos = NewHiScore_MM()) >= 0) - { - game_status = HALLOFFAME; - - // DrawHallOfFame(hi_pos); - - if (raise_level) - level_nr++; - } - else - { - game_status = MAINMENU; - - if (raise_level) - level_nr++; - - // DrawMainMenu(); - } - - BackToFront(); -} - -int NewHiScore_MM(void) -{ - int k, l; - int position = -1; - - // LoadScore(level_nr); - - if (strcmp(setup.player_name, EMPTY_PLAYER_NAME) == 0 || - game_mm.score < highscore[MAX_SCORE_ENTRIES - 1].Score) - return -1; - - for (k = 0; k < MAX_SCORE_ENTRIES; k++) - { - if (game_mm.score > highscore[k].Score) - { - // player has made it to the hall of fame - - if (k < MAX_SCORE_ENTRIES - 1) - { - int m = MAX_SCORE_ENTRIES - 1; - -#ifdef ONE_PER_NAME - for (l = k; l < MAX_SCORE_ENTRIES; l++) - if (!strcmp(setup.player_name, highscore[l].Name)) - m = l; - if (m == k) // player's new highscore overwrites his old one - goto put_into_list; -#endif - - for (l = m; l>k; l--) - { - strcpy(highscore[l].Name, highscore[l - 1].Name); - highscore[l].Score = highscore[l - 1].Score; - } - } - -#ifdef ONE_PER_NAME - put_into_list: -#endif - strncpy(highscore[k].Name, setup.player_name, MAX_PLAYER_NAME_LEN); - highscore[k].Name[MAX_PLAYER_NAME_LEN] = '\0'; - highscore[k].Score = game_mm.score; - position = k; - - break; - } - -#ifdef ONE_PER_NAME - else if (!strncmp(setup.player_name, highscore[k].Name, - MAX_PLAYER_NAME_LEN)) - break; // player already there with a higher score -#endif - - } - - // if (position >= 0) - // SaveScore(level_nr); - - return position; -} - static void InitMovingField_MM(int x, int y, int direction) { int newx = x + (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0); @@ -4189,7 +3999,7 @@ void RaiseScoreElement_MM(int element) // Mirror Magic game engine snapshot handling functions // ---------------------------------------------------------------------------- -void SaveEngineSnapshotValues_MM(ListNode **buffers) +void SaveEngineSnapshotValues_MM(void) { int x, y;