[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src ButtonPanel.cc,1.26,1.27 ButtonPanel.
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src ButtonPanel.cc,1.26,1.27 ButtonPanel.hh,1.14,1.15 Client.cc,1.79,1.80 Client.hh,1.36,1.37 GenericMain.cc,1.17,1.18 Makefile.am,1.74,1.75 MultiplayerGame.cc,1.6,1.7 PLFPreview.cc,1.9,1.10 PLFPreview.hh,1.5,1.6 PingusGameSession.cc,1.12,1.13 PingusGameSession.hh,1.7,1.8 PingusSpotMap.cc,1.51,1.52 PingusSpotMap.hh,1.18,1.19 Playfield.cc,1.30,1.31 Playfield.hh,1.20,1.21 Server.cc,1.23,1.24 Server.hh,1.15,1.16 SmallMap.hh,1.12,1.13 SmallMapImage.cc,1.8,1.9 TrueServer.cc,1.28,1.29 TrueServer.hh,1.10,1.11 World.cc,1.67,1.68 World.hh,1.32,1.33 |
Date: |
7 Jun 2002 19:10:36 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv1716
Modified Files:
ButtonPanel.cc ButtonPanel.hh Client.cc Client.hh
GenericMain.cc Makefile.am MultiplayerGame.cc PLFPreview.cc
PLFPreview.hh PingusGameSession.cc PingusGameSession.hh
PingusSpotMap.cc PingusSpotMap.hh Playfield.cc Playfield.hh
Server.cc Server.hh SmallMap.hh SmallMapImage.cc TrueServer.cc
TrueServer.hh World.cc World.hh
Log Message:
replaced boost::shared_ptr<PLF> with PLF*
Index: ButtonPanel.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/ButtonPanel.cc,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- ButtonPanel.cc 1 Jun 2002 18:05:34 -0000 1.26
+++ ButtonPanel.cc 7 Jun 2002 19:10:33 -0000 1.27
@@ -29,7 +29,7 @@
using boost::shared_ptr;
CL_Surface ButtonPanel::button_cap;
-ButtonPanel::ButtonPanel(boost::shared_ptr<PLF> plf,
+ButtonPanel::ButtonPanel(PLF* plf,
boost::shared_ptr<Controller> arg_controller,
int arg_x_pos, int arg_y_pos)
: controller (arg_controller),
Index: ButtonPanel.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/ButtonPanel.hh,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- ButtonPanel.hh 10 Aug 2001 10:56:13 -0000 1.14
+++ ButtonPanel.hh 7 Jun 2002 19:10:33 -0000 1.15
@@ -34,65 +34,42 @@
class ButtonPanel : public GuiObj
{
private:
- ///
friend class ClientEvent;
- ///
+
std::vector<boost::shared_ptr<ActionButton> > a_buttons;
- ///
typedef std::vector<boost::shared_ptr<ActionButton> >::iterator AButtonIter;
- ///
AButtonIter pressed_button;
- ///
boost::shared_ptr<ArmageddonButton> armageddon;
- ///
boost::shared_ptr<ForwardButton> forward;
- ///
boost::shared_ptr<PauseButton> pause;
- ///
Server* server;
- ///
Client* client;
- ///
+
int armageddon_pressed;
- ///
AnimCounter arma_counter;
- ///
bool left_pressed;
- ///
unsigned int last_press;
- /// static CL_ResourceManager* resource;
static CL_Surface button_cap;
- ///
World* world;
- ///
+
boost::shared_ptr<Controller> controller;
int x_pos, y_pos;
public:
- ///
- ButtonPanel(boost::shared_ptr<PLF> plf,
+ ButtonPanel(PLF* plf,
boost::shared_ptr<Controller>,int arg_x_pos, int arg_y_pos);
- ///
~ButtonPanel();
- ///
void on_button_press(const CL_Key& key);
- ///
void on_button_release(const CL_Key& key);
- ///
std::string get_action_name();
- ///
void update(float delta);
- ///
void draw();
- ///
void set_server(Server*);
- ///
void set_client(Client*);
- ///
void set_button(int);
/// Select the next action
Index: Client.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Client.cc,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- Client.cc 7 Jun 2002 14:50:34 -0000 1.79
+++ Client.cc 7 Jun 2002 19:10:33 -0000 1.80
@@ -34,7 +34,6 @@
#include "PingusError.hh"
#include "OptionMenu.hh"
#include "PLF.hh"
-// clude "XMLPLF.hh"
#include "DeltaManager.hh"
#include "MouseController.hh"
#include "PathManager.hh"
@@ -154,7 +153,7 @@
}
void
-Client::play_level(boost::shared_ptr<PLF> arg_plf)
+Client::play_level(PLF* arg_plf)
{
Timer timer;
Index: Client.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Client.hh,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- Client.hh 7 Jun 2002 14:50:34 -0000 1.36
+++ Client.hh 7 Jun 2002 19:10:33 -0000 1.37
@@ -43,52 +43,38 @@
class PingusCounter;
class HurryUp;
-/** Bla bla.... rewrite this class... */
+/** FIXME: This whole Server/Client concept is screwed */
class Client
{
private:
- ///
- boost::shared_ptr<PLF> plf;
- ///
+
+ PLF* plf;
Result result;
- ///
- Server * server;
- ///
- PingusGameMode mode;
- ///
+ Server* server;
+ PingusGameMode mode;
+
bool fast_forward;
- ///
bool pause;
- ///
int skip_frame;
- ///
bool do_replay;
- ///
bool is_finished;
- ///
std::vector<GuiObj*> obj;
typedef std::vector<GuiObj*>::iterator GuiObjIter;
- ///
+
static bool gui_is_init;
- ///
+
static boost::shared_ptr<ButtonPanel> button_panel;
- ///
static boost::shared_ptr<PingusCounter> pcounter;
- ///
static boost::shared_ptr<Playfield> playfield;
- ///
static boost::shared_ptr<TimeDisplay> time_display;
- ///
static boost::shared_ptr<SmallMap> small_map;
- ///
static boost::shared_ptr<HurryUp> hurry_up;
boost::shared_ptr<Controller> controller;
boost::shared_ptr<Cursor> cursor;
- ///
+
CL_Slot on_button_press_slot;
- ///
CL_Slot on_button_release_slot;
// Slots for controller handling
@@ -105,26 +91,19 @@
CL_Slot slot_next_action_pressed;
CL_Slot slot_previous_action_pressed;
- ///
bool enabled;
public:
- ///
Client(boost::shared_ptr<Controller> arg_controller, Server * s);
- ///
virtual ~Client();
- ///
- Server * get_server() { return server; }
- ///
+ Server* get_server() { return server; }
boost::shared_ptr<Playfield> get_playfield() { return playfield; }
/** Display the game and enter the main game loop */
void display();
- ///
void send_next_event();
- ///
- void play_level(boost::shared_ptr<PLF>);
+ void play_level(PLF*);
/// FIXME: Document me... or rewrite me
void init_display();
@@ -133,25 +112,16 @@
///
void resize_display();
- ///
void set_fast_forward(bool value);
- ///
bool get_fast_forward();
- ///
bool get_pause();
- ///
void set_pause(bool value);
- ///
bool replay();
- ///
void do_restart();
- ///
bool finished();
- ///
void set_finished();
- ///
Result get_result();
/** Draw all gui elements, etc. */
@@ -160,22 +130,15 @@
/** Update all parts of the world */
void update (float delta);
- ///
virtual void on_button_press(CL_InputDevice *device, const CL_Key &key);
- ///
virtual void on_button_release(CL_InputDevice *device, const CL_Key &key);
- ///
void on_mouse_button_press(const CL_Key &key);
- ///
void on_mouse_button_release(const CL_Key &key);
- ///
void on_keyboard_button_press(const CL_Key &key);
- ///
void on_keyboard_button_release(const CL_Key &key);
- ///
void on_left_pressed (const CL_Vector& pos);
void on_left_released (const CL_Vector& pos);
void on_middle_pressed (const CL_Vector& pos);
@@ -188,14 +151,11 @@
void on_scroll_right_pressed (const CL_Vector& pos);
void on_next_action_pressed (const CL_Vector& pos);
void on_previous_action_pressed (const CL_Vector& pos);
- ///
+
void register_event_handler();
- ///
void unregister_event_handler();
- ///
void disable_event_handler();
- ///
void enable_event_handler();
};
Index: GenericMain.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/GenericMain.cc,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- GenericMain.cc 20 Jan 2002 13:34:01 -0000 1.17
+++ GenericMain.cc 7 Jun 2002 19:10:33 -0000 1.18
@@ -25,7 +25,7 @@
#include <ClanLib/png.h>
#include "System.hh"
-#include "war/WarMain.hh"
+//#include "war/WarMain.hh"
#include "PingusMain.hh"
#include "GenericMain.hh"
@@ -74,7 +74,8 @@
if (System::basename(argv[0]) == "warpingus")
{
- main_obj = new WarMain();
+ //main_obj = new WarMain();
+ std::cout << "War no longer supported" << std::endl;
}
else if (System::basename(argv[0]) == "pingus")
{
Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Makefile.am,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- Makefile.am 5 Jun 2002 17:51:08 -0000 1.74
+++ Makefile.am 7 Jun 2002 19:10:33 -0000 1.75
@@ -33,7 +33,6 @@
generic \
particles \
traps \
- war \
worldobjs \
worldmap
@@ -62,7 +61,6 @@
particles/libpingus_particle.a \
editor/libpingus_editor.a \
backgrounds/libpingus_backgrounds.a \
- war/libpingus_war.a \
worldmap/libpingus_worldmap.a \
generic/libpingus_generic.a
Index: MultiplayerGame.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/MultiplayerGame.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- MultiplayerGame.cc 7 Jun 2002 14:50:34 -0000 1.6
+++ MultiplayerGame.cc 7 Jun 2002 19:10:33 -0000 1.7
@@ -46,7 +46,7 @@
{
std::cout << "Starting Multiplayer Game" << std::endl;
try {
- shared_ptr<PLF> plf (new XMLPLF
(path_manager.complete("levels/multi2-grumbel.xml")));
+ PLF* plf = new XMLPLF (path_manager.complete("levels/multi2-grumbel.xml"));
shared_ptr<Server> server (new TrueServer (plf));
shared_ptr<Controller> controller1;
shared_ptr<Controller> controller2;
@@ -76,65 +76,67 @@
{
client = shared_ptr<MultiplayerClient>
(new MultiplayerClient
- (server.get (),
- shared_ptr<GuiObj>(new MultiplayerClientChild (controller1,
-
server.get (),
-
CL_Rect (0,0,
-
CL_Display::get_width ()/2-2,
-
CL_Display::get_height ()))),
- shared_ptr<GuiObj>(new MultiplayerClientChild (controller2,
-
server.get (),
-
CL_Rect (CL_Display::get_width ()/2, 0,
-
CL_Display::get_width (),
-
CL_Display::get_height ())))));
+ (server.get (),
+ shared_ptr<GuiObj>(new MultiplayerClientChild (controller1,
+ server.get (),
+ CL_Rect (0,0,
+
CL_Display::get_width ()/2-2,
+
CL_Display::get_height ()))),
+ shared_ptr<GuiObj>(new MultiplayerClientChild (controller2,
+ server.get (),
+ CL_Rect
(CL_Display::get_width ()/2, 0,
+
CL_Display::get_width (),
+
CL_Display::get_height ())))));
}
else
{
client = shared_ptr<MultiplayerClient>
(new MultiplayerClient
- (server.get (),
- shared_ptr<GuiObj>(new MultiplayerClientChild (controller1,
-
server.get (),
-
CL_Rect (0,
-
0,
-
CL_Display::get_width ()/2 - 4,
-
CL_Display::get_height ()/2 - 4))),
- shared_ptr<GuiObj>(new MultiplayerClientChild (controller2,
-
server.get (),
-
CL_Rect (CL_Display::get_width ()/2 + 4,
-
0,
-
CL_Display::get_width (),
-
CL_Display::get_height ()/2 - 4))),
- shared_ptr<GuiObj>(new MultiplayerClientChild (controller3,
-
server.get (),
-
CL_Rect (0,
-
CL_Display::get_height ()/2 + 4,
-
CL_Display::get_width ()/2 - 4,
-
CL_Display::get_height ()))),
- shared_ptr<GuiObj>(new MultiplayerClientChild (controller4,
-
server.get (),
-
CL_Rect (CL_Display::get_width ()/2 + 4,
-
CL_Display::get_height ()/2 + 4,
-
CL_Display::get_width (),
-
CL_Display::get_height ())))
- ));
- }
+ (server.get (),
+ shared_ptr<GuiObj>(new MultiplayerClientChild (controller1,
+ server.get (),
+ CL_Rect (0,
+ 0,
+
CL_Display::get_width ()/2 - 4,
+
CL_Display::get_height ()/2 - 4))),
+ shared_ptr<GuiObj>(new MultiplayerClientChild (controller2,
+ server.get (),
+ CL_Rect
(CL_Display::get_width ()/2 + 4,
+ 0,
+
CL_Display::get_width (),
+
CL_Display::get_height ()/2 - 4))),
+ shared_ptr<GuiObj>(new MultiplayerClientChild (controller3,
+ server.get (),
+ CL_Rect (0,
+
CL_Display::get_height ()/2 + 4,
+
CL_Display::get_width ()/2 - 4,
+
CL_Display::get_height ()))),
+ shared_ptr<GuiObj>(new MultiplayerClientChild (controller4,
+ server.get (),
+ CL_Rect
(CL_Display::get_width ()/2 + 4,
+
CL_Display::get_height ()/2 + 4,
+
CL_Display::get_width (),
+
CL_Display::get_height ())))
+ ));
+ }
- DeltaManager delta_manager;
- while (!server->is_finished ())
- {
- float delta = delta_manager.getset ();
- server->update (delta);
- client->update (delta);
- client->draw ();
- Display::flip_display ();
- // FIXME: Remove me to gain some fps
- CL_Display::clear_display (1.0, 1.0, 1.0);
- CL_System::keep_alive ();
- CL_System::sleep (0);
- }
+ DeltaManager delta_manager;
+ while (!server->is_finished ())
+ {
+ float delta = delta_manager.getset ();
+ server->update (delta);
+ client->update (delta);
+ client->draw ();
+ Display::flip_display ();
+ // FIXME: Remove me to gain some fps
+ CL_Display::clear_display (1.0, 1.0, 1.0);
+ CL_System::keep_alive ();
+ CL_System::sleep (0);
+ }
+
+ delete plf;
} catch (...) {
- std::cout << "MultiplayerGame: Something went wrong" << std::endl;
+ std::cout << "MultiplayerGame: Something went wrong and we have probally a
memory leak." << std::endl;
}
}
Index: PLFPreview.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/PLFPreview.cc,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- PLFPreview.cc 1 Jun 2002 18:05:34 -0000 1.9
+++ PLFPreview.cc 7 Jun 2002 19:10:33 -0000 1.10
@@ -25,7 +25,7 @@
#include "PLFPreview.hh"
-PLFPreview::PLFPreview(boost::shared_ptr<PLF> p)
+PLFPreview::PLFPreview (PLF* p)
{
plf = p;
}
@@ -37,7 +37,7 @@
}
void
-PLFPreview::load(boost::shared_ptr<PLF> /*p*/)
+PLFPreview::load(PLF* /*p*/)
{
if (surface)
return;
@@ -45,8 +45,7 @@
switch (plf->map_type()) {
case SPOT:
{*/
- PingusSpotMap p_map;
- p_map.load(plf);
+ PingusSpotMap p_map (plf);
surface = p_map.get_surface();
/* }
break;
Index: PLFPreview.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/PLFPreview.hh,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- PLFPreview.hh 10 Apr 2001 21:51:22 -0000 1.5
+++ PLFPreview.hh 7 Jun 2002 19:10:33 -0000 1.6
@@ -22,25 +22,18 @@
#include <ClanLib/core.h>
-
-#include "PLF.hh"
+class PLF;
/// A class to load and manage a small level preview surface
class PLFPreview
{
private:
- ///
CL_Surface surface;
- ///
CL_Canvas* provider;
- ///
- boost::shared_ptr<PLF> plf;
+ PLF* plf;
public:
- ///
- PLFPreview(boost::shared_ptr<PLF>);
- ///
- void load(boost::shared_ptr<PLF>);
- ///
+ PLFPreview(PLF*);
+ void load(PLF*);
CL_Surface get_surface();
};
Index: PingusGameSession.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/PingusGameSession.cc,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- PingusGameSession.cc 7 Jun 2002 14:50:34 -0000 1.12
+++ PingusGameSession.cc 7 Jun 2002 19:10:33 -0000 1.13
@@ -32,12 +32,15 @@
plf(create_plf (filename)),
server (new TrueServer (plf)),
client (new Client(shared_ptr<Controller>(new MouseController ()),
- server.get ()))
+ server))
{
}
PingusGameSession::~PingusGameSession ()
{
+ delete client;
+ delete server;
+ delete plf;
}
void
@@ -54,17 +57,17 @@
return PingusGameSessionResult ();
}
-boost::shared_ptr<PLF>
+PLF*
PingusGameSession::create_plf (std::string pathname)
{
std::string extension = System::extension (pathname);
if (extension == "xml")
- return boost::shared_ptr<PLF> (new XMLPLF (filename));
+ return new XMLPLF (filename);
else if (extension == "plf")
- return boost::shared_ptr<PLF> (new PLFPLF (filename));
+ return new PLFPLF (filename);
else // filename does not have an extension, default to xml
- return boost::shared_ptr<PLF> (new XMLPLF (filename));
+ return new XMLPLF (filename);
}
/* EOF */
Index: PingusGameSession.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/PingusGameSession.hh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- PingusGameSession.hh 2 Jun 2002 21:09:11 -0000 1.7
+++ PingusGameSession.hh 7 Jun 2002 19:10:33 -0000 1.8
@@ -23,8 +23,9 @@
#include <string>
#include "PingusGameSessionResult.hh"
-#include "Server.hh"
-#include "Client.hh"
+class Client;
+class Server;
+class PLF;
/** You can use this class to start up a game session, which consist
of a single level. */
@@ -35,16 +36,17 @@
std::string filename;
/// The level data
- boost::shared_ptr<PLF> plf;
+ PLF* plf;
/// The server
- boost::shared_ptr<Server> server;
+ Server* server;
/// The client
- boost::shared_ptr<Client> client;
+ Client* client;
- /** */
- boost::shared_ptr<PLF> create_plf (std::string filename);
+ /** Create a XMLPLf or a PLFPLF, depending on the file extension,
+ the called must delete the returned PLF object */
+ PLF* create_plf (std::string filename);
public:
/** Create a new game session which is launched on start ()
Index: PingusSpotMap.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/PingusSpotMap.cc,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- PingusSpotMap.cc 1 Jun 2002 18:05:35 -0000 1.51
+++ PingusSpotMap.cc 7 Jun 2002 19:10:33 -0000 1.52
@@ -21,6 +21,7 @@
//#include <cstdio>
#include "PingusResource.hh"
+#include "PLF.hh"
#include "PingusError.hh"
#include "blitter.hh"
#include "algo.hh"
@@ -82,11 +83,7 @@
surface.get_provider()->unlock();
}
-PingusSpotMap::PingusSpotMap()
-{
-}
-
-PingusSpotMap::PingusSpotMap(boost::shared_ptr<PLF> plf)
+PingusSpotMap::PingusSpotMap(PLF* plf)
{
colmap = 0;
@@ -139,7 +136,7 @@
}
void
-PingusSpotMap::load(boost::shared_ptr<PLF> plf)
+PingusSpotMap::load(PLF* plf)
{
ResDescriptor name = plf->get_foreground();
Index: PingusSpotMap.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/PingusSpotMap.hh,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- PingusSpotMap.hh 14 Feb 2002 22:23:52 -0000 1.18
+++ PingusSpotMap.hh 7 Jun 2002 19:10:33 -0000 1.19
@@ -31,12 +31,9 @@
#include "globals.hh"
#include "PinguMap.hh"
#include "ColMap.hh"
-#include "PSMParser.hh"
-#include "PLF.hh"
-
+class PLF;
-///
class MapTileSurface
{
private:
@@ -61,66 +58,41 @@
class PingusSpotMap : public PinguMap
{
private:
- ///
ColMap* colmap;
- ///
+
typedef std::vector<MapTileSurface>::size_type TileIter;
- ///
+
std::vector<GroundpieceData> surfaces;
- ///
- PSMParser psm_parser;
- ///
+
CL_Canvas* provider;
- ///
- CL_Surface map_surface;
- ///
- CL_Canvas* map_canvas;
- ///
+ CL_Surface map_surface;
+ CL_Canvas* map_canvas;
+
std::vector<std::vector<MapTileSurface> > tile;
- ///
+
int width;
- ///
int height;
public:
- ///
- PingusSpotMap();
- ///
- PingusSpotMap(boost::shared_ptr<PLF>);
- ///
+ PingusSpotMap(PLF*);
virtual ~PingusSpotMap();
- ///
void generate_colmap();
- ///
ColMap* PingusSpotMap::get_colmap();
- ///
- void load(boost::shared_ptr<PLF> plf);
- ///
+ void load(PLF* plf);
void gen_tiles();
- ///
void draw(int x, int y, int w, int h, int of_x, int of_y, float s);
- ///
void draw_colmap(int x_pos, int y_pos, int w, int h,
int of_x, int of_y, float s);
- ///
int get_height(void);
- ///
int get_width(void);
- ///
CL_Surface get_surface(void);
- ///
void remove(CL_SurfaceProvider*, int, int);
- ///
void put_alpha_surface(CL_Canvas* provider, CL_SurfaceProvider* sprovider,
int x, int y, int real_x, int real_y);
- ///
void put(CL_SurfaceProvider*, int, int);
- ///
void create_maptiles();
- ///
void create_map();
- ///
void mark_tiles_not_empty(int, int, int, int);
float get_z_pos () const { return 0; }
Index: Playfield.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Playfield.cc,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- Playfield.cc 4 Jun 2002 08:35:30 -0000 1.30
+++ Playfield.cc 7 Jun 2002 19:10:33 -0000 1.31
@@ -35,7 +35,7 @@
using boost::shared_ptr;
-Playfield::Playfield(boost::shared_ptr<PLF> level_data, World* w,
+Playfield::Playfield(PLF* level_data, World* w,
boost::shared_ptr<Controller> arg_controller)
: controller (arg_controller)
{
Index: Playfield.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Playfield.hh,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- Playfield.hh 4 Jun 2002 08:35:30 -0000 1.20
+++ Playfield.hh 7 Jun 2002 19:10:33 -0000 1.21
@@ -75,7 +75,7 @@
boost::shared_ptr<Controller> controller;
public:
- Playfield(boost::shared_ptr<PLF>, World*,
+ Playfield(PLF* plf, World*,
boost::shared_ptr<Controller>);
~Playfield();
Index: Server.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Server.cc,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- Server.cc 1 Jun 2002 18:05:35 -0000 1.23
+++ Server.cc 7 Jun 2002 19:10:33 -0000 1.24
@@ -66,7 +66,7 @@
}
void
-Server::start(boost::shared_ptr<PLF> /*level_data*/)
+Server::start(PLF* /*level_data*/)
{
}
Index: Server.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Server.hh,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- Server.hh 15 Jan 2002 10:48:49 -0000 1.15
+++ Server.hh 7 Jun 2002 19:10:33 -0000 1.16
@@ -30,12 +30,13 @@
/** An Event in the Pingus World
Possible events are the applying of an action, an armageddon,
- scrolling, etc. */
+ scrolling, etc.
+
+ FIXME: The concept is ok, but implementation sucks
+*/
class PingusEvent {
public:
- ///
PingusEvent();
- ///
PingusEvent(std::string);
/// The GameTime at which the event happend
@@ -48,69 +49,43 @@
class Server
{
protected:
- ///
World* world;
- ///
ActionHolder action_holder;
- ///
bool demo_mode;
- ///
std::string demo_file;
/// The name of the current level file
std::string filename;
- ///
bool get_next_event;
- ///
DemoRecorder recorder;
- ///
bool finished;
public:
- ///
Server();
- ///
virtual ~Server();
- ///
virtual bool enough_time_passed() = 0;
- ///
virtual void update(float delta);
- ///
- virtual void start(boost::shared_ptr<PLF> level_data);
+ virtual void start(PLF* level_data);
- ///
virtual void set_fast_forward(bool) = 0;
- ///
virtual bool get_fast_forward() = 0;
- ///
virtual bool get_pause() = 0;
- ///
virtual void set_pause(bool) = 0;
- ///
virtual bool needs_redraw() = 0;
- ///
- virtual boost::shared_ptr<PLF> get_plf () =0;
+ virtual PLF* get_plf () =0;
- ///
World* get_world();
- ///
ActionHolder* get_action_holder();
- ///
bool is_finished();
- ///
void set_finished();
- ///
void process_event(std::string);
- ///
void send_event(std::string);
- ///
void set_demo(std::string);
- ///
void record_demo();
};
Index: SmallMap.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/SmallMap.hh,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- SmallMap.hh 10 Apr 2001 21:51:22 -0000 1.12
+++ SmallMap.hh 7 Jun 2002 19:10:33 -0000 1.13
@@ -29,56 +29,34 @@
class SmallMap : public GuiObj
{
private:
- ///
- boost::shared_ptr<PLF> plf;
- ///
+ PLF* plf;
ColMap* colmap;
- ///
- World* world;
- ///
+ World* world;
+ Client* client;
+
CL_Surface exit_sur;
- ///
CL_Surface entrance_sur;
- ///
CL_Surface sur;
- ///
- Client* client;
- ///
+
int x_pos;
- ///
int y_pos;
- ///
int width;
- ///
int height;
- ///
bool scroll_mode;
- ///
int rwidth;
- ///
int rheight;
public:
- ///
SmallMap();
- ///
~SmallMap();
- ///
bool on_button_press(const CL_Key& key);
- ///
bool on_button_release(const CL_Key& key);
- ///
- void set_client(Client* c);
- ///
+ void set_client(Client* c);
bool mouse_over();
- ///
void init();
- ///
void draw();
- ///
void draw_pingus();
- ///
void update(float delta);
};
Index: SmallMapImage.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/SmallMapImage.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- SmallMapImage.cc 7 Jun 2002 14:50:34 -0000 1.8
+++ SmallMapImage.cc 7 Jun 2002 19:10:33 -0000 1.9
@@ -64,7 +64,6 @@
ColMap* colmap = world->get_colmap();
buffer = colmap->get_data();
- shared_ptr<PLF> plf = world->get_plf();
canvas = new CL_Canvas(width, height);
@@ -120,6 +119,8 @@
}
#if 0
+ PLF* plf = world->get_plf();
+
std::vector<ExitData> exit_d = plf->get_exit();
for(std::vector<ExitData>::iterator i = exit_d.begin(); i != exit_d.end();
i++)
{
Index: TrueServer.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/TrueServer.cc,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- TrueServer.cc 15 Jan 2002 10:48:49 -0000 1.28
+++ TrueServer.cc 7 Jun 2002 19:10:33 -0000 1.29
@@ -26,7 +26,7 @@
using namespace std;
-TrueServer::TrueServer(boost::shared_ptr<PLF> arg_plf)
+TrueServer::TrueServer(PLF* arg_plf)
: plf (arg_plf)
{
filename = plf->get_filename();
@@ -74,7 +74,7 @@
}
void
-TrueServer::start(boost::shared_ptr<PLF> arg_plf)
+TrueServer::start(PLF* arg_plf)
{
Timer timer;
@@ -172,7 +172,7 @@
return false;
}
-boost::shared_ptr<PLF>
+PLF*
TrueServer::get_plf ()
{
return plf;
Index: TrueServer.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/TrueServer.hh,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- TrueServer.hh 13 Apr 2001 13:45:09 -0000 1.10
+++ TrueServer.hh 7 Jun 2002 19:10:33 -0000 1.11
@@ -22,47 +22,33 @@
#include "Server.hh"
-///
+/** FIXME: This whole Server/Client concept is screwed */
class TrueServer : public Server
{
private:
- ///
bool fast_forward;
- ///
bool pause;
- ///
unsigned int last_time;
- ///
int local_game_speed;
- ///
bool client_needs_redraw;
- ///
float delta;
- ///
- boost::shared_ptr<PLF> plf;
+
+ /** Reference to the PLF for this level, this must not be deleted */
+ PLF* plf;
public:
- ///
- TrueServer(boost::shared_ptr<PLF> plf);
- ///
+ TrueServer(PLF* plf);
virtual ~TrueServer();
- ///
- void start(boost::shared_ptr<PLF> level_data);
- ///
+
+ void start(PLF* level_data);
bool enough_time_passed(void);
- ///
void update(float delta);
- ///
bool needs_redraw();
- ///
- boost::shared_ptr<PLF> get_plf ();
- ///
+ /** Return a reference to the plf used for this level */
+ PLF* get_plf ();
void set_fast_forward(bool value);
- ///
bool get_fast_forward();
- ///
void set_pause(bool);
- ///
bool get_pause();
};
Index: World.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/World.cc,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- World.cc 1 Jun 2002 18:05:35 -0000 1.67
+++ World.cc 7 Jun 2002 19:10:33 -0000 1.68
@@ -64,7 +64,7 @@
WorldObj::set_world(this);
}
-World::World(boost::shared_ptr<PLF> plf)
+World::World(PLF* plf)
{
WorldObj::set_world(this);
init (plf);
@@ -160,7 +160,7 @@
}
void
-World::init(boost::shared_ptr<PLF> plf_data)
+World::init(PLF* plf_data)
{
plf = plf_data;
do_armageddon = false;
@@ -178,11 +178,7 @@
particle_holder = shared_ptr<ParticleHolder>(new ParticleHolder());
pingus = new PinguHolder();
- //Timer timer;
- //timer.start();
- //cout << "World: Inititializing world objects... " << flush;
init_worldobjs();
- //cout << "done " << timer.stop() << endl;
}
void
@@ -339,7 +335,7 @@
return particle_holder.get();
}
-boost::shared_ptr<PLF>
+PLF*
World::get_plf()
{
return plf;
Index: World.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/World.hh,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- World.hh 1 Jun 2002 17:58:31 -0000 1.32
+++ World.hh 7 Jun 2002 19:10:33 -0000 1.33
@@ -72,9 +72,9 @@
boost::shared_ptr<ParticleHolder> particle_holder;
ActionHolder* action_holder;
- PinguHolder* pingus;
- ColMap* colmap;
- boost::shared_ptr<PLF> plf;
+ PinguHolder* pingus;
+ ColMap* colmap;
+ PLF* plf;
boost::shared_ptr<View> view;
void init_worldobjs (void);
@@ -82,10 +82,10 @@
public:
World();
- World(boost::shared_ptr<PLF>);
+ World(PLF*);
virtual ~World();
- void init (boost::shared_ptr<PLF>);
+ void init (PLF*);
/** Draws the world onto the screen
@param x1 The left corner of the drawing area.
@@ -129,7 +129,7 @@
/** @return Pointer to the ActionHolder of the world */
ActionHolder* get_action_holder();
- boost::shared_ptr<PLF> get_plf();
+ PLF* get_plf();
unsigned int get_released_pingus() { return released_pingus; }
void inc_released_pingus() { ++released_pingus; }
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src ButtonPanel.cc,1.26,1.27 ButtonPanel.hh,1.14,1.15 Client.cc,1.79,1.80 Client.hh,1.36,1.37 GenericMain.cc,1.17,1.18 Makefile.am,1.74,1.75 MultiplayerGame.cc,1.6,1.7 PLFPreview.cc,1.9,1.10 PLFPreview.hh,1.5,1.6 PingusGameSession.cc,1.12,1.13 PingusGameSession.hh,1.7,1.8 PingusSpotMap.cc,1.51,1.52 PingusSpotMap.hh,1.18,1.19 Playfield.cc,1.30,1.31 Playfield.hh,1.20,1.21 Server.cc,1.23,1.24 Server.hh,1.15,1.16 SmallMap.hh,1.12,1.13 SmallMapImage.cc,1.8,1.9 TrueServer.cc,1.28,1.29 TrueServer.hh,1.10,1.11 World.cc,1.67,1.68 World.hh,1.32,1.33,
grumbel <=