OSDN Git Service

原作のv1.5.1へのバージョンアップに対応する修正
[starfighter-jp/starfighter-jp.git] / src / Starfighter.cpp
index ed91b8b..e579fcb 100644 (file)
@@ -2,7 +2,7 @@
 Project: Starfighter
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -78,32 +78,40 @@ int main(int argc, char **argv)
                }
        }
 
-       atexit(cleanUp);
+       atexit(engine_cleanup);
 
-       initGraphics();
-       initSystem(); // Opens video mode and sound
+       gfx_init();
+       engine_setMode();
        loadFont();
 
        if (cheatAttempt && !engine.cheat)
        {
-               clearScreen(black);
-               drawString("That doesn't work anymore", -1, 285, FONT_WHITE);
-               drawString("Try harder...", -1, 315, FONT_WHITE);
-               updateScreen();
+               screen_clear(black);
+               screen_renderString("That doesn't work anymore", -1, 285, FONT_WHITE);
+               screen_renderString("Try harder...", -1, 315, FONT_WHITE);
+               renderer_update();
                SDL_Delay(2000);
-               clearScreen(black);
-               updateScreen();
+               screen_clear(black);
+               renderer_update();
                SDL_Delay(500);
        }
 
-       freeGraphics();
+       gfx_free();
        audio_loadSounds();
 
        initWeapons();
-       initVars();
+
+       srand(time(NULL));
+
+       if (engine.useAudio)
+       {
+               Mix_Volume(-1, 100);
+               Mix_VolumeMusic(engine.musicVolume);
+       }
+
        alien_defs_init();
 
-       setColorIndexes();
+       colors_init();
 
        showStory();
 
@@ -127,7 +135,7 @@ int main(int argc, char **argv)
 
                        case 2:
                                if (game.stationedPlanet == -1)
-                                       doCutscene(0);
+                                       cutscene_init(0);
                                section = game_mainLoop();
                                break;
                }