Selaa lähdekoodia

Fehler behoben wenn mehrere Spiele hintereinander gespielt werden wird jetzt die Spielzeit zurückgesetzt (wichtig für aufzeichnungen wo eingaben mit spielzeit gespeichert werden)

Kolja Strohm 6 vuotta sitten
vanhempi
commit
b4f4b58e30
3 muutettua tiedostoa jossa 124 lisäystä ja 123 poistoa
  1. 0 1
      Asteroids/Map.cpp
  2. 4 2
      Asteroids/Menü.cpp
  3. 120 120
      Asteroids/Menü.h

+ 0 - 1
Asteroids/Map.cpp

@@ -10,7 +10,6 @@
 #include <Rahmen.h>
 #include <Globals.h>
 #include <AsynchronCall.h>
-#include <iostream>
 
 // Inhalt der Map Klasse aus Map.h
 // Konstruktor

+ 4 - 2
Asteroids/Menü.cpp

@@ -108,6 +108,7 @@ Men
 // nicht constant
 void MenüSpiel::reset()
 {
+    timePuffer = 0;
     Text optionen = "Width=";
     InitDatei *opd = new InitDatei( "data/Minigames/Asteroids/data/optionen.ini" );
     if( !opd->laden() )
@@ -149,7 +150,7 @@ void Men
     else
     {
         opd->addWert( "Ship", "0" );
-        optionen += "0";
+        optionen += 0;
     }
     optionen += ",Fortsetzen=";
     if( opd->wertExistiert( "Fortsetzen" ) )
@@ -157,7 +158,7 @@ void Men
     else
     {
         opd->addWert( "Fortsetzen", "0" );
-        optionen += "0";
+        optionen += 0;
     }
     opd->speichern();
     opd->release();
@@ -405,6 +406,7 @@ Men
     zurück = initKnopf( 350, 470, 100, 20, zSchrift, Knopf::Style::Sichtbar, "Zurück" );
     screen = zScreen->getThis();
     schrift = zSchrift->getThis();
+    asyncFinished = 1;
 }
 
 // Destruktor

+ 120 - 120
Asteroids/Menü.h

@@ -12,53 +12,53 @@ using namespace Framework;
 class MenüVerloren
 {
 private:
-	LRahmen *ram;
-	TextFeld *verloren;
-	Knopf *neu;
-	Knopf *beenden;
-	int ref;
+    LRahmen *ram;
+    TextFeld *verloren;
+    Knopf *neu;
+    Knopf *beenden;
+    int ref;
 
 public:
-	// Kontruktor
-	MenüVerloren( Schrift *zSchrift );
-	// Destruktor
-	~MenüVerloren();
-	// nicht constant
-	int doMausEreignis( MausEreignis &me );
-	bool tick( double tickVal );
-	void render( Bild &zRObj );
-	// Reference Counting
-	MenüVerloren *getThis();
-	MenüVerloren *release();
+    // Kontruktor
+    MenüVerloren( Schrift *zSchrift );
+    // Destruktor
+    ~MenüVerloren();
+    // nicht constant
+    int doMausEreignis( MausEreignis &me );
+    bool tick( double tickVal );
+    void render( Bild &zRObj );
+    // Reference Counting
+    MenüVerloren *getThis();
+    MenüVerloren *release();
 };
 
 class MenüSpiel
 {
 private:
-	TextFeld *scoreT;
-	Knopf *beenden;
-	Map *map;
-	MenüVerloren *verloren;
+    TextFeld *scoreT;
+    Knopf *beenden;
+    Map *map;
+    MenüVerloren *verloren;
     double timePuffer;
-	bool beendet;
-	int ref;
+    bool beendet;
+    int ref;
 
 public:
-	// Konstruktor
-	MenüSpiel( Schrift *zSchrift, Bildschirm *zScreen, MinigameKlientV *klient );
-	// Destruktor
-	~MenüSpiel();
-	// nicht constant
-	void reset();
-	void doMausEreignis( MausEreignis &me );
-	void doTastaturEreignis( TastaturEreignis &te );
-	bool tick( double tickVal );
-	void render( Bild &zRObj );
-	// constant
-	bool istBeendet() const;
-	// Reference Counting
-	MenüSpiel *getThis();
-	MenüSpiel *release();
+    // Konstruktor
+    MenüSpiel( Schrift *zSchrift, Bildschirm *zScreen, MinigameKlientV *klient );
+    // Destruktor
+    ~MenüSpiel();
+    // nicht constant
+    void reset();
+    void doMausEreignis( MausEreignis &me );
+    void doTastaturEreignis( TastaturEreignis &te );
+    bool tick( double tickVal );
+    void render( Bild &zRObj );
+    // constant
+    bool istBeendet() const;
+    // Reference Counting
+    MenüSpiel *getThis();
+    MenüSpiel *release();
 };
 
 class MenüWiederhohlung
@@ -95,111 +95,111 @@ public:
 class MenüStatistik
 {
 private:
-	TextFeld *ansichtT;
-	AuswahlBox *ansicht;
-	KontrollKnopf *optionen;
-	ObjTabelle *gesammtT;
-	ObjTabelle *optionenT;
+    TextFeld *ansichtT;
+    AuswahlBox *ansicht;
+    KontrollKnopf *optionen;
+    ObjTabelle *gesammtT;
+    ObjTabelle *optionenT;
     ObjTabelle *worldBestT;
-	LDiag *gesammtD;
-	LDiag *optionenD;
-	Knopf *remove;
-	Knopf *zurück;
-	Schrift *schrift;
+    LDiag *gesammtD;
+    LDiag *optionenD;
+    Knopf *remove;
+    Knopf *zurück;
+    Schrift *schrift;
     MinigameKlientV *klient;
     MenüWiederhohlung *wiederH;
     Bildschirm *screen;
     bool asyncFinished;
-	bool beendet;
-	int ref = 1;
+    bool beendet;
+    int ref = 1;
 
 public:
-	// Konstruktor
-	MenüStatistik( Schrift *zSchrift, Bildschirm *zScreen, MinigameKlientV *klient );
-	// Destruktor
-	~MenüStatistik();
-	// nicht constant
-	void reset();
-	void doMausEreignis( MausEreignis &me );
-	bool tick( double tickVal );
-	void render( Bild &zRObj );
-	// constant
-	bool istBeendet() const;
+    // Konstruktor
+    MenüStatistik( Schrift *zSchrift, Bildschirm *zScreen, MinigameKlientV *klient );
+    // Destruktor
+    ~MenüStatistik();
+    // nicht constant
+    void reset();
+    void doMausEreignis( MausEreignis &me );
+    bool tick( double tickVal );
+    void render( Bild &zRObj );
+    // constant
+    bool istBeendet() const;
     bool istWiederhohlung() const;
-	// Reference Counting
-	MenüStatistik *getThis();
-	MenüStatistik *release();
+    // Reference Counting
+    MenüStatistik *getThis();
+    MenüStatistik *release();
 };
 
 class MenüOptionen
 {
 private:
-	TextFeld *breiteT;
-	TextFeld *breite;
-	TextFeld *höheT;
-	TextFeld *höhe;
-	TextFeld *aGrößeT;
-	TextFeld *aGröße;
-	TextFeld *timerT;
-	TextFeld *timer;
-	TextFeld *shipT;
-	AuswahlBox *ship;
-	KontrollKnopf *fortsetzen;
-	Knopf *abbrechen;
-	Knopf *ok;
-	bool beendet;
-	int ref;
+    TextFeld *breiteT;
+    TextFeld *breite;
+    TextFeld *höheT;
+    TextFeld *höhe;
+    TextFeld *aGrößeT;
+    TextFeld *aGröße;
+    TextFeld *timerT;
+    TextFeld *timer;
+    TextFeld *shipT;
+    AuswahlBox *ship;
+    KontrollKnopf *fortsetzen;
+    Knopf *abbrechen;
+    Knopf *ok;
+    bool beendet;
+    int ref;
 
 public:
-	// Konstruktor
-	MenüOptionen( Schrift *zSchrift, Bildschirm *zScreen );
-	// Destruktor
-	~MenüOptionen();
-	// nicht constant
-	void reset();
-	void doMausEreignis( MausEreignis &me );
-	void doTastaturEreignis( TastaturEreignis &te );
-	bool tick( double tickVal );
-	void render( Bild &zRObj );
-	// constant
-	bool istBeendet() const;
-	// Reference Counting
-	MenüOptionen *getThis();
-	MenüOptionen *release();
+    // Konstruktor
+    MenüOptionen( Schrift *zSchrift, Bildschirm *zScreen );
+    // Destruktor
+    ~MenüOptionen();
+    // nicht constant
+    void reset();
+    void doMausEreignis( MausEreignis &me );
+    void doTastaturEreignis( TastaturEreignis &te );
+    bool tick( double tickVal );
+    void render( Bild &zRObj );
+    // constant
+    bool istBeendet() const;
+    // Reference Counting
+    MenüOptionen *getThis();
+    MenüOptionen *release();
 };
 
 class Menü
 {
 private:
-	Knopf *spielen;
-	MenüSpiel *spielenF;
-	Knopf *optionen;
-	MenüOptionen *optionenF;
-	Knopf *statistik;
-	MenüStatistik *statistikF;
-	Knopf *beenden;
-	Bild *hintergrund;
-	LRahmen *ram;
-	bool beendet;
-	int status;
-	int ref;
+    Knopf *spielen;
+    MenüSpiel *spielenF;
+    Knopf *optionen;
+    MenüOptionen *optionenF;
+    Knopf *statistik;
+    MenüStatistik *statistikF;
+    Knopf *beenden;
+    Bild *hintergrund;
+    LRahmen *ram;
+    bool beendet;
+    int status;
+    int ref;
 
 public:
-	// Konstruktor
-	Menü( Schrift *zSchrift, Bildschirm *zScreen, MinigameKlientV *klient );
-	// Destruktor
-	~Menü();
-	// nicht constant
-	void reset();
-	void doMausEreignis( MausEreignis &me );
-	void doTastaturEreignis( TastaturEreignis &te );
-	bool tick( double z );
-	void render( Bild &zRObj );
-	// constant
-	bool istBeendet() const;
-	// Reference Counting
-	Menü *getThis();
-	Menü *release();
+    // Konstruktor
+    Menü( Schrift *zSchrift, Bildschirm *zScreen, MinigameKlientV *klient );
+    // Destruktor
+    ~Menü();
+    // nicht constant
+    void reset();
+    void doMausEreignis( MausEreignis &me );
+    void doTastaturEreignis( TastaturEreignis &te );
+    bool tick( double z );
+    void render( Bild &zRObj );
+    // constant
+    bool istBeendet() const;
+    // Reference Counting
+    Menü *getThis();
+    Menü *release();
 };
 
 #endif