[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r3595 - trunk/pingus/src
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r3595 - trunk/pingus/src |
Date: |
Mon, 30 Jun 2008 18:50:52 +0200 |
Author: grumbel
Date: 2008-06-30 18:50:46 +0200 (Mon, 30 Jun 2008)
New Revision: 3595
Modified:
trunk/pingus/src/demo_session.cpp
trunk/pingus/src/game_session.cpp
trunk/pingus/src/game_session.hpp
Log:
Replaced rawpointer with auto_ptr
Modified: trunk/pingus/src/demo_session.cpp
===================================================================
--- trunk/pingus/src/demo_session.cpp 2008-06-30 16:37:49 UTC (rev 3594)
+++ trunk/pingus/src/demo_session.cpp 2008-06-30 16:50:46 UTC (rev 3595)
@@ -17,8 +17,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#include <ClanLib/Display/keyboard.h>
-#include <ClanLib/Display/keys.h>
#include "math.hpp"
#include "xml_pdf.hpp"
#include "server.hpp"
Modified: trunk/pingus/src/game_session.cpp
===================================================================
--- trunk/pingus/src/game_session.cpp 2008-06-30 16:37:49 UTC (rev 3594)
+++ trunk/pingus/src/game_session.cpp 2008-06-30 16:50:46 UTC (rev 3595)
@@ -41,11 +41,11 @@
plf_timer.stop();
Timer server_timer("GameSession server creation");
- server = new Server(plf);
+ server = std::auto_ptr<Server>(new Server(plf));
server_timer.stop();
Timer client_timer("GameSession client creation");
- client = new Client(server);
+ client = std::auto_ptr<Client>(new Client(server.get()));
client_timer.stop();
number_of_redraws = 0;
@@ -66,9 +66,6 @@
<< " Updates: " << number_of_updates
<< " FrameSkip: " << number_of_updates - number_of_redraws
<< std::endl;
-
- delete client;
- delete server;
}
void
Modified: trunk/pingus/src/game_session.hpp
===================================================================
--- trunk/pingus/src/game_session.hpp 2008-06-30 16:37:49 UTC (rev 3594)
+++ trunk/pingus/src/game_session.hpp 2008-06-30 16:50:46 UTC (rev 3595)
@@ -21,15 +21,15 @@
#define HEADER_PINGUS_GAME_SESSION_HPP
#include <string>
+#include <memory>
#include "screen/screen.hpp"
#include "pingus_level.hpp"
-
class Client;
class Server;
class PingusGameSessionResult;
class DemoPlayer;
-
+
/** You can use this class to start up a game session, which consist
of a single level. */
class PingusGameSession : public Screen
@@ -41,10 +41,10 @@
bool show_result_screen;
/// The server
- Server* server;
+ std::auto_ptr<Server> server;
/// The client
- Client* client;
+ std::auto_ptr<Client> client;
/** Time in 1/1000 second's that was not used in the last
update() */
@@ -87,7 +87,7 @@
PingusGameSession& operator= (const PingusGameSession&);
};
-
+
#endif
/* EOF */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r3595 - trunk/pingus/src,
grumbel at BerliOS <=