Browse Source

Fehler behoben

Kolja Strohm 5 years ago
parent
commit
1a25603159

+ 9 - 2
Test/Minigames.cpp

@@ -281,6 +281,7 @@ MiniGames::MiniGames( Schrift *zSchrift, DLLDateien *zDLLs, Bildschirm *screen,
     tickVal = 0;
     games = new RCArray< MiniGame >();
     mgl = 0;
+    mgInitialized = 0;
     new MGSuchen( (MiniGames*)getThis() );
 }
 
@@ -340,6 +341,7 @@ void MiniGames::doMausEreignis( MausEreignis &me )
             { // spiel starten
                 if( mgl )
                     mgl = (MGLaden*)mgl->release();
+                mgInitialized = 0;
                 mgl = new MGLaden( games->z( i )->zName()->getText(), dLLs, api );
             }
         }
@@ -363,18 +365,23 @@ bool MiniGames::tick( double z )
         if( !mgl->zGame() )
         {
             mgl = (MGLaden*)mgl->release();
+            mgInitialized = 0;
         }
-        else
+        else if( !mgInitialized )
         {
             mgl->zGame()->setSchriftZ( schrift->getThis() );
             mgl->zGame()->setBildschirmZ( screen );
+            mgInitialized = 1;
         }
     }
     if( mgl && mgl->zGame() && !alpha2 )
     {
         rend |= mgl->zGame()->tick( z );
         if( mgl->zGame()->istEnde() )
-            mgl = (MGLaden*)mgl->release();
+        {
+            mgl = (MGLaden *)mgl->release();
+            mgInitialized = 0;
+        }
     }
     if( alpha2 )
     {

+ 1 - 0
Test/Minigames.h

@@ -58,6 +58,7 @@ private:
     DLLDateien *dLLs;
     Bildschirm *screen;
     API *api;
+    bool mgInitialized;
     double tickVal;
     int alpha2;
 

BIN
Test/Test.exe


BIN
Test/data/Minigames/Asteroids/data/game.mgc


BIN
Test/data/Minigames/Asteroids/data/game.save


+ 7 - 0
Test/data/Minigames/Asteroids/data/optionen.ini

@@ -0,0 +1,7 @@
+Breite=1600
+Höhe=1000
+Größe=1000
+Timer=5000
+Ship=0
+Fortsetzen=0
+AutoKam=0

BIN
Test/data/Minigames/Asteroids/data/sasave_0.m2


+ 5 - 0
Test/data/Minigames/Blöcke/data/optionen.ini

@@ -0,0 +1,5 @@
+Breite=20
+Height=12
+Farben=5
+Geschwindigkeit=4000
+Fortsetzen=0

BIN
Test/data/Minigames/Blöcke/data/score.ksgt


+ 6 - 0
Test/data/Minigames/Fangen/data/optionen.ini

@@ -0,0 +1,6 @@
+Breite=800
+Höhe=500
+Ziele=1
++Gegner=3
+Geschwindigkeit=1000
+Fortsetzen=0

BIN
Test/data/Minigames/Fangen/data/score.ksgt


BIN
Test/data/Minigames/Snake/data/game.mgc


BIN
Test/data/Minigames/Snake/data/game.save


BIN
Test/data/Minigames/Tetris/data/game.mgc


BIN
Test/data/Minigames/Tetris/data/game.save


BIN
Test/data/Minigames/Tetris/data/score.ksgt