[Orxonox-commit 4669] r9340 - in code/branches/presentation2012merge: data/overlays src/modules/pong src/modules/tetris src/orxonox/gametypes

jo at orxonox.net jo at orxonox.net
Mon Aug 20 16:46:52 CEST 2012


Author: jo
Date: 2012-08-20 16:46:52 +0200 (Mon, 20 Aug 2012)
New Revision: 9340

Modified:
   code/branches/presentation2012merge/data/overlays/dynamicMatchHUD.oxo
   code/branches/presentation2012merge/src/modules/pong/Pong.cc
   code/branches/presentation2012merge/src/modules/pong/Pong.h
   code/branches/presentation2012merge/src/modules/tetris/Tetris.cc
   code/branches/presentation2012merge/src/orxonox/gametypes/Deathmatch.cc
   code/branches/presentation2012merge/src/orxonox/gametypes/Deathmatch.h
   code/branches/presentation2012merge/src/orxonox/gametypes/Dynamicmatch.cc
   code/branches/presentation2012merge/src/orxonox/gametypes/TeamBaseMatch.cc
   code/branches/presentation2012merge/src/orxonox/gametypes/TeamBaseMatch.h
   code/branches/presentation2012merge/src/orxonox/gametypes/TeamDeathmatch.cc
   code/branches/presentation2012merge/src/orxonox/gametypes/TeamDeathmatch.h
Log:
On the way of repairing a bug that was caused by manual refactoring of gametype's playerScored function.

Modified: code/branches/presentation2012merge/data/overlays/dynamicMatchHUD.oxo
===================================================================
--- code/branches/presentation2012merge/data/overlays/dynamicMatchHUD.oxo	2012-07-30 20:41:03 UTC (rev 9339)
+++ code/branches/presentation2012merge/data/overlays/dynamicMatchHUD.oxo	2012-08-20 14:46:52 UTC (rev 9340)
@@ -1,6 +1,27 @@
 <Template name="DynamicmatchHUD">
   <OverlayGroup name="DynamicmatcHUD" scale = "1, 1">
    
+    <!--OverlayText
+     position  = "0.02, 0.02"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.04
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+     caption   = "Target:"
+    />
+
+    <OverlayText
+     position  = "0.02, 0.055"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.04
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+     caption   = "Score:"
+    /-->
+
+
  <GametypeStaticMessage
    name     = "staticmessage"
    position = "0.5, 0.01"

Modified: code/branches/presentation2012merge/src/modules/pong/Pong.cc
===================================================================
--- code/branches/presentation2012merge/src/modules/pong/Pong.cc	2012-07-30 20:41:03 UTC (rev 9339)
+++ code/branches/presentation2012merge/src/modules/pong/Pong.cc	2012-08-20 14:46:52 UTC (rev 9340)
@@ -255,9 +255,9 @@
     @brief
         Is called when the player scored.
     */
-    void Pong::playerScored(PlayerInfo* player)
+    void Pong::playerScored(PlayerInfo* player, int score)
     {
-        Deathmatch::playerScored(player);
+        Deathmatch::playerScored(player, score);
 
         if (this->center_ != NULL) // If there is a centerpoint.
         {

Modified: code/branches/presentation2012merge/src/modules/pong/Pong.h
===================================================================
--- code/branches/presentation2012merge/src/modules/pong/Pong.h	2012-07-30 20:41:03 UTC (rev 9339)
+++ code/branches/presentation2012merge/src/modules/pong/Pong.h	2012-08-20 14:46:52 UTC (rev 9340)
@@ -72,7 +72,7 @@
 
             virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
 
-            virtual void playerScored(PlayerInfo* player); //!< Is called when the player scored.
+            virtual void playerScored(PlayerInfo* player, int score = 1); //!< Is called when the player scored.
 
             /**
             @brief Set the PongCenterpoint (the playing field).

Modified: code/branches/presentation2012merge/src/modules/tetris/Tetris.cc
===================================================================
--- code/branches/presentation2012merge/src/modules/tetris/Tetris.cc	2012-07-30 20:41:03 UTC (rev 9339)
+++ code/branches/presentation2012merge/src/modules/tetris/Tetris.cc	2012-08-20 14:46:52 UTC (rev 9340)
@@ -25,8 +25,6 @@
  *      Johannes Ritz
  *
  *
- *BUG c) destroying the old stones causes segfault -> WeakPointer as solution ?
- *BUG d) wrong collision detection: sometimes stones "bounce off"
  *
  *
  *TASK c) end the game in a nicer way

Modified: code/branches/presentation2012merge/src/orxonox/gametypes/Deathmatch.cc
===================================================================
--- code/branches/presentation2012merge/src/orxonox/gametypes/Deathmatch.cc	2012-07-30 20:41:03 UTC (rev 9339)
+++ code/branches/presentation2012merge/src/orxonox/gametypes/Deathmatch.cc	2012-08-20 14:46:52 UTC (rev 9340)
@@ -113,9 +113,9 @@
         Gametype::pawnKilled(victim, killer);
     }
 
-    void Deathmatch::playerScored(PlayerInfo* player)
+    void Deathmatch::playerScored(PlayerInfo* player, int score)
     {
-        Gametype::playerScored(player);
+        Gametype::playerScored(player, score);
 
         if (player)
         {

Modified: code/branches/presentation2012merge/src/orxonox/gametypes/Deathmatch.h
===================================================================
--- code/branches/presentation2012merge/src/orxonox/gametypes/Deathmatch.h	2012-07-30 20:41:03 UTC (rev 9339)
+++ code/branches/presentation2012merge/src/orxonox/gametypes/Deathmatch.h	2012-08-20 14:46:52 UTC (rev 9340)
@@ -47,7 +47,7 @@
             virtual bool playerChangedName(PlayerInfo* player);
 
             virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
-            virtual void playerScored(PlayerInfo* player);
+            virtual void playerScored(PlayerInfo* player, int score = 1);
     };
 }
 

Modified: code/branches/presentation2012merge/src/orxonox/gametypes/Dynamicmatch.cc
===================================================================
--- code/branches/presentation2012merge/src/orxonox/gametypes/Dynamicmatch.cc	2012-07-30 20:41:03 UTC (rev 9339)
+++ code/branches/presentation2012merge/src/orxonox/gametypes/Dynamicmatch.cc	2012-08-20 14:46:52 UTC (rev 9340)
@@ -309,8 +309,10 @@
         // Give victim boost
         if (spaceship)
         {
+            WeakPtr<SpaceShip>* ptr = new WeakPtr<SpaceShip>(spaceship);
+            if(ptr == NULL)
+                return;
             spaceship->addSpeedFactor(5);
-            WeakPtr<SpaceShip>* ptr = new WeakPtr<SpaceShip>(spaceship);
             ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
             executor->setDefaultValue(0, ptr);
             new Timer(10, false, executor, true);
@@ -489,7 +491,7 @@
              }
         }
         //killers: every 4th player is a killer
-        if (getPlayerCount()/4 > (int)numberOf[killer])
+        if ( static_cast<unsigned int>(getPlayerCount()/4) > numberOf[killer])
         {
             notEnoughKillers=true;
             if (tutorial) // Announce selectionphase

Modified: code/branches/presentation2012merge/src/orxonox/gametypes/TeamBaseMatch.cc
===================================================================
--- code/branches/presentation2012merge/src/orxonox/gametypes/TeamBaseMatch.cc	2012-07-30 20:41:03 UTC (rev 9339)
+++ code/branches/presentation2012merge/src/orxonox/gametypes/TeamBaseMatch.cc	2012-08-20 14:46:52 UTC (rev 9340)
@@ -127,7 +127,7 @@
 
 
     // collect Points for killing oppenents
-    void TeamBaseMatch::playerScored(PlayerInfo* player)
+    void TeamBaseMatch::playerScored(PlayerInfo* player, int score)
     {
         int teamnr = this->getTeam(player);
         this->addTeamPoints(teamnr, 5);

Modified: code/branches/presentation2012merge/src/orxonox/gametypes/TeamBaseMatch.h
===================================================================
--- code/branches/presentation2012merge/src/orxonox/gametypes/TeamBaseMatch.h	2012-07-30 20:41:03 UTC (rev 9339)
+++ code/branches/presentation2012merge/src/orxonox/gametypes/TeamBaseMatch.h	2012-08-20 14:46:52 UTC (rev 9340)
@@ -46,7 +46,7 @@
             virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
             virtual bool allowPawnDamage(Pawn* victim, Pawn* originator);
 
-            virtual void playerScored(PlayerInfo* player);
+            virtual void playerScored(PlayerInfo* player, int score = 1);
             virtual void showPoints();
             virtual void endGame();
 

Modified: code/branches/presentation2012merge/src/orxonox/gametypes/TeamDeathmatch.cc
===================================================================
--- code/branches/presentation2012merge/src/orxonox/gametypes/TeamDeathmatch.cc	2012-07-30 20:41:03 UTC (rev 9339)
+++ code/branches/presentation2012merge/src/orxonox/gametypes/TeamDeathmatch.cc	2012-08-20 14:46:52 UTC (rev 9340)
@@ -112,9 +112,9 @@
         Gametype::pawnKilled(victim, killer);
     }
 
-    void TeamDeathmatch::playerScored(PlayerInfo* player)
+    void TeamDeathmatch::playerScored(PlayerInfo* player, int score)
     {
-        TeamGametype::playerScored(player);
+        TeamGametype::playerScored(player, score);
 
         if (player)
         {

Modified: code/branches/presentation2012merge/src/orxonox/gametypes/TeamDeathmatch.h
===================================================================
--- code/branches/presentation2012merge/src/orxonox/gametypes/TeamDeathmatch.h	2012-07-30 20:41:03 UTC (rev 9339)
+++ code/branches/presentation2012merge/src/orxonox/gametypes/TeamDeathmatch.h	2012-08-20 14:46:52 UTC (rev 9340)
@@ -47,7 +47,7 @@
             virtual bool playerChangedName(PlayerInfo* player);
 
             virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
-            virtual void playerScored(PlayerInfo* player);
+            virtual void playerScored(PlayerInfo* player, int score = 1);
     };
 }
 




More information about the Orxonox-commit mailing list