[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2662 - in branches/pingus_sdl/src: . components display
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r2662 - in branches/pingus_sdl/src: . components display |
Date: |
Tue, 16 Jan 2007 01:01:21 +0100 |
Author: grumbel
Date: 2007-01-16 01:01:18 +0100 (Tue, 16 Jan 2007)
New Revision: 2662
Modified:
branches/pingus_sdl/src/SConscript
branches/pingus_sdl/src/capture_rectangle.hxx
branches/pingus_sdl/src/client.cxx
branches/pingus_sdl/src/client.hxx
branches/pingus_sdl/src/components/action_button.cxx
branches/pingus_sdl/src/components/action_button.hxx
branches/pingus_sdl/src/components/button_panel.cxx
branches/pingus_sdl/src/components/button_panel.hxx
branches/pingus_sdl/src/components/hurry_up.cxx
branches/pingus_sdl/src/components/hurry_up.hxx
branches/pingus_sdl/src/components/pingus_counter.cxx
branches/pingus_sdl/src/components/pingus_counter.hxx
branches/pingus_sdl/src/components/playfield.cxx
branches/pingus_sdl/src/components/playfield.hxx
branches/pingus_sdl/src/components/smallmap.cxx
branches/pingus_sdl/src/components/smallmap.hxx
branches/pingus_sdl/src/components/time_display.cxx
branches/pingus_sdl/src/components/time_display.hxx
branches/pingus_sdl/src/display/drawing_context.cxx
branches/pingus_sdl/src/display/drawing_context.hxx
branches/pingus_sdl/src/game_session.cxx
branches/pingus_sdl/src/pingu.cxx
branches/pingus_sdl/src/pingu.hxx
branches/pingus_sdl/src/pingu_holder.hxx
branches/pingus_sdl/src/server_event.cxx
branches/pingus_sdl/src/smallmap_image.cxx
branches/pingus_sdl/src/smallmap_image.hxx
branches/pingus_sdl/src/sprite.cpp
branches/pingus_sdl/src/sprite.hpp
branches/pingus_sdl/src/start_screen.cxx
branches/pingus_sdl/src/timer.cxx
branches/pingus_sdl/src/world.cxx
branches/pingus_sdl/src/world.hxx
Log:
- a bunch of more code compilable, however not yet linkable
Modified: branches/pingus_sdl/src/SConscript
===================================================================
--- branches/pingus_sdl/src/SConscript 2007-01-15 23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/SConscript 2007-01-16 00:01:18 UTC (rev 2662)
@@ -97,17 +97,17 @@
# 'blitter_test.cxx',
# 'capture_rectangle.cxx',
'cheat.cxx',
-# 'client.cxx',
+'client.cxx',
# 'col_map.cxx',
# 'collider.cxx',
# 'colliders/pingu_collider.cxx',
-# 'components/action_button.cxx',
-# 'components/button_panel.cxx',
-# 'components/hurry_up.cxx',
-# 'components/pingus_counter.cxx',
-# 'components/playfield.cxx',
-# 'components/smallmap.cxx',
-# 'components/time_display.cxx',
+'components/action_button.cxx',
+'components/button_panel.cxx',
+'components/hurry_up.cxx',
+'components/pingus_counter.cxx',
+'components/playfield.cxx',
+'components/smallmap.cxx',
+'components/time_display.cxx',
'config.cxx',
'console.cxx',
# 'credits.cxx',
@@ -142,8 +142,8 @@
'sprite.cpp',
# 'fps_counter.cxx',
# 'game_counter.cxx',
-# 'game_session.cxx',
-# 'game_session_result.cxx',
+'game_session.cxx',
+'game_session_result.cxx',
'game_time.cxx',
'gettext.cxx',
# 'global_event.cxx',
@@ -236,8 +236,8 @@
'savegame.cxx',
'savegame_manager.cxx',
# 'screenshot.cxx',
-# 'server.cxx',
-# 'server_event.cxx',
+'server.cxx',
+'server_event.cxx',
# 'smallmap_image.cxx',
'sound/sound.cxx',
'sound/sound_dummy.cxx',
@@ -252,9 +252,9 @@
'math/origin.cpp',
'math/rect.cpp',
'system.cxx',
-# 'timer.cxx',
+'timer.cxx',
'tinygettext/tinygettext.cxx',
-# 'true_server.cxx',
+'true_server.cxx',
'math/vector2f.cpp',
'math/vector2i.cpp',
'math/vector3f.cpp',
Modified: branches/pingus_sdl/src/capture_rectangle.hxx
===================================================================
--- branches/pingus_sdl/src/capture_rectangle.hxx 2007-01-15 23:28:22 UTC
(rev 2661)
+++ branches/pingus_sdl/src/capture_rectangle.hxx 2007-01-16 00:01:18 UTC
(rev 2662)
@@ -20,17 +20,16 @@
#ifndef HEADER_PINGUS_CAPTURE_RECTANGLE_HXX
#define HEADER_PINGUS_CAPTURE_RECTANGLE_HXX
-#include <ClanLib/Display/font.h>
-
-class CL_Font;
-
-
+class Font;
class Pingu;
class PinguAction;
class Pingu;
class ButtonPanel;
class DrawingContext;
+#include "font.hpp"
+#include "sprite.hpp"
+
/** The rectangle that is shown when the mouse cursor is above a
pingu. The rectangle shows the current pingu direction along with
the current active action.
@@ -44,13 +43,13 @@
/// The id of the owner of this capture rectangle
int owner_id;
- CL_Sprite good;
- CL_Sprite bad;
- CL_Sprite arrow_left;
- CL_Sprite arrow_right;
+ Sprite good;
+ Sprite bad;
+ Sprite arrow_left;
+ Sprite arrow_right;
ButtonPanel* button_panel;
- CL_Font font;
+ Font font;
public:
CaptureRectangle(ButtonPanel*);
Modified: branches/pingus_sdl/src/client.cxx
===================================================================
--- branches/pingus_sdl/src/client.cxx 2007-01-15 23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/client.cxx 2007-01-16 00:01:18 UTC (rev 2662)
@@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <iostream>
-#include <ClanLib/Display/display.h>
#include "globals.hxx"
#include "components/playfield.hxx"
#include "timer.hxx"
@@ -50,9 +49,9 @@
Timer timer("Client UI generation");
// These object will get deleted by the gui_manager
- button_panel = new ButtonPanel(this, 2, CL_Display::get_height()/2);
- playfield = new Playfield(this, CL_Rect(CL_Point(0, 0),
CL_Size(CL_Display::get_width(),
-
CL_Display::get_height())));
+ button_panel = new ButtonPanel(this, 2, Display::get_height()/2);
+ playfield = new Playfield(this, Rect(Vector2i(0, 0),
Size(Display::get_width(),
+
Display::get_height())));
hurry_up = new HurryUp(this);
pcounter = new PingusCounter(get_server());
small_map = new SmallMap(this);
@@ -65,9 +64,9 @@
gui_manager->add(small_map, true);
gui_manager->add(time_display, true);
- gui_manager->add(new ArmageddonButton(server, CL_Display::get_width() - 40,
CL_Display::get_height() - 62), true);
- gui_manager->add(new ForwardButton (server, CL_Display::get_width() - 40 *
2, CL_Display::get_height() - 62), true);
- gui_manager->add(new PauseButton (server, CL_Display::get_width() - 40 *
3, CL_Display::get_height() - 62), true);
+ gui_manager->add(new ArmageddonButton(server, Display::get_width() - 40,
Display::get_height() - 62), true);
+ gui_manager->add(new ForwardButton (server, Display::get_width() - 40 * 2,
Display::get_height() - 62), true);
+ gui_manager->add(new PauseButton (server, Display::get_width() - 40 * 3,
Display::get_height() - 62), true);
// Connect the button_panel with the playfield
playfield->set_server(server);
@@ -235,7 +234,7 @@
if (verbose)
std::cout << "Client: Entering main_loop. Startup time: "
- << CL_System::get_time() << " msec." << std::endl;
+ << SDL_GetTicks() << " msec." << std::endl;
}
void
Modified: branches/pingus_sdl/src/client.hxx
===================================================================
--- branches/pingus_sdl/src/client.hxx 2007-01-15 23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/client.hxx 2007-01-16 00:01:18 UTC (rev 2662)
@@ -20,14 +20,8 @@
#ifndef HEADER_PINGUS_CLIENT_HXX
#define HEADER_PINGUS_CLIENT_HXX
-#include <ClanLib/Signals/slot.h>
-#include <ClanLib/Display/sprite.h>
-#include <ClanLib/Display/input_device.h>
#include "gui/gui_screen.hxx"
-class CL_InputEvent;
-
-
namespace Input {
class Controller;
struct ButtonEvent;
@@ -93,9 +87,6 @@
void on_primary_button_press(int x, int y);
void on_primary_button_release(int x, int y);
- void on_butmouse_button_press(const CL_InputEvent &key);
- void on_mouse_button_release(const CL_InputEvent &key);
-
// Overloaded GUIScreen stuff
void on_startup ();
void on_shutdown ();
Modified: branches/pingus_sdl/src/components/action_button.cxx
===================================================================
--- branches/pingus_sdl/src/components/action_button.cxx 2007-01-15
23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/components/action_button.cxx 2007-01-16
00:01:18 UTC (rev 2662)
@@ -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.h>
-#include <ClanLib/Core/System/clanstring.h>
#include "../globals.hxx"
#include "../cheat.hxx"
#include "../resource.hxx"
@@ -28,6 +26,7 @@
#include "../display/drawing_context.hxx"
#include "../gui/display.hxx"
#include "../fonts.hxx"
+#include "../math/vector3f.hpp"
using namespace Actions;
@@ -49,7 +48,7 @@
font_b = Fonts::pingus_large;
sprite = Resource::load_sprite("pingus/player0/" + action_to_string(name) +
"/right");
- sprite.set_play_loop(true);
+ ////sprite.set_play_loop(true);
}
bool
@@ -103,7 +102,7 @@
if (fast_mode)
{
gc.draw_fillrect((float)x_pos, (float)y_pos, (float)x_pos + 60,
(float)y_pos + 35,
- CL_Color(255, 255, 255));
+ Color(255, 255, 255));
}
else
{
@@ -123,22 +122,23 @@
}
}
- gc.draw(sprite, Vector((float)x_pos + 20, (float)y_pos + 32));
+ gc.draw(sprite, Vector3f((float)x_pos + 20, (float)y_pos + 32));
- CL_Font myfont = font;
- CL_Font myfontb = font_b;
+ Font myfont = font;
+ Font myfontb = font_b;
// print the action name next to the button, when mouse pointer is on
// the button.
// FIXME: this should use the GUI events, not CL_Mouse
+#if 0
if (action_help
&& CL_Mouse::get_x() > x_pos && CL_Mouse::get_x() < x_pos + 60
&& CL_Mouse::get_y() < y_pos + 35 && CL_Mouse::get_y() > y_pos)
{
gc.print_left(myfontb, (float)x_pos + 65, (float)y_pos,
action_to_screenname(name));
}
+#endif
-
if (Cheat::unlimited_actions)
{
// FIXME: insert unlimited surface here
@@ -146,8 +146,10 @@
}
else
{
+#if 0
std::string str = CL_String::to(action_holder->get_available(name));
gc.print_center(myfont, (float)x_pos + 46, (float)y_pos + 5, str);
+#endif
}
}
@@ -169,16 +171,16 @@
{
if (server->get_world()->check_armageddon ())
{
- gc.draw(backgroundhl, Vector((float)x_pos, (float)y_pos));
- gc.draw(sprite, Vector((float)x_pos, (float)y_pos));
+ gc.draw(backgroundhl, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(sprite, Vector3f((float)x_pos, (float)y_pos));
}
else
{
if (!fast_mode)
- gc.draw(background, Vector((float)x_pos, (float)y_pos));
+ gc.draw(background, Vector3f((float)x_pos, (float)y_pos));
sprite.set_frame(7);
- gc.draw(sprite, Vector((float)x_pos, (float)y_pos));
+ gc.draw(sprite, Vector3f((float)x_pos, (float)y_pos));
}
}
@@ -247,15 +249,15 @@
{
if (server->get_fast_forward())
{
- gc.draw(backgroundhl, Vector((float)x_pos, (float)y_pos));
+ gc.draw(backgroundhl, Vector3f((float)x_pos, (float)y_pos));
}
else
{
if (!fast_mode)
- gc.draw(background, Vector((float)x_pos, (float)y_pos));
+ gc.draw(background, Vector3f((float)x_pos, (float)y_pos));
}
- gc.draw(surface, Vector((float)x_pos, (float)y_pos));
+ gc.draw(surface, Vector3f((float)x_pos, (float)y_pos));
}
bool
@@ -295,15 +297,15 @@
{
if (server->get_pause())
{
- gc.draw(backgroundhl, Vector((float)x_pos, (float)y_pos));
+ gc.draw(backgroundhl, Vector3f((float)x_pos, (float)y_pos));
}
else
{
if (!fast_mode)
- gc.draw(background, Vector((float)x_pos, (float)y_pos));
+ gc.draw(background, Vector3f((float)x_pos, (float)y_pos));
}
- gc.draw(surface, Vector((float)x_pos, (float)y_pos));
+ gc.draw(surface, Vector3f((float)x_pos, (float)y_pos));
}
bool
Modified: branches/pingus_sdl/src/components/action_button.hxx
===================================================================
--- branches/pingus_sdl/src/components/action_button.hxx 2007-01-15
23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/components/action_button.hxx 2007-01-16
00:01:18 UTC (rev 2662)
@@ -20,9 +20,8 @@
#ifndef HEADER_PINGUS_ACTION_BUTTON_HXX
#define HEADER_PINGUS_ACTION_BUTTON_HXX
-#include <ClanLib/Display/sprite.h>
-#include <ClanLib/Display/font.h>
#include <string>
+#include "../font.hpp"
#include "../pingu_enums.hxx"
#include "../state_sprite.hxx"
#include "../gui/component.hxx"
@@ -46,9 +45,9 @@
int y_pos;
bool pressed;
float press_time;
- CL_Sprite sprite;
- CL_Sprite background;
- CL_Sprite backgroundhl;
+ Sprite sprite;
+ Sprite background;
+ Sprite backgroundhl;
friend class ButtonPanel;
public:
@@ -77,9 +76,9 @@
TrueServer* server;
int x_pos;
int y_pos;
- CL_Sprite surface;
- CL_Sprite background;
- CL_Sprite backgroundhl;
+ Sprite surface;
+ Sprite background;
+ Sprite backgroundhl;
friend class ButtonPanel;
public:
ForwardButton(TrueServer*, int x, int y);
@@ -106,9 +105,9 @@
TrueServer* server;
int x_pos;
int y_pos;
- CL_Sprite surface;
- CL_Sprite background;
- CL_Sprite backgroundhl;
+ Sprite surface;
+ Sprite background;
+ Sprite backgroundhl;
friend class ButtonPanel;
public:
PauseButton(TrueServer*, int x, int y);
@@ -130,12 +129,12 @@
class ActionButton : public GUI::Component
{
protected:
- CL_Sprite sprite;
+ Sprite sprite;
int x_pos;
int y_pos;
- CL_Font font;
+ Font font;
// Added for printing action names next to the button.
- CL_Font font_b;
+ Font font_b;
Actions::ActionName name;
bool is_multi_direct;
@@ -175,8 +174,8 @@
class VerticalActionButton : public ActionButton
{
private:
- CL_Sprite background;
- CL_Sprite backgroundhl;
+ Sprite background;
+ Sprite backgroundhl;
public:
VerticalActionButton(ActionHolder* h, int x, int y, Actions::ActionName
name, int owner_id);
Modified: branches/pingus_sdl/src/components/button_panel.cxx
===================================================================
--- branches/pingus_sdl/src/components/button_panel.cxx 2007-01-15 23:28:22 UTC
(rev 2661)
+++ branches/pingus_sdl/src/components/button_panel.cxx 2007-01-16 00:01:18 UTC
(rev 2662)
@@ -17,9 +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/mouse.h>
-#include <ClanLib/Display/input_event.h>
-#include <ClanLib/Display/keys.h>
#include <iostream>
#include <algorithm>
#include "../globals.hxx"
@@ -30,8 +27,6 @@
using namespace Actions;
-CL_Surface ButtonPanel::button_cap;
-
struct action_sorter {
bool operator() (const ActionName& a, const ActionName& b) {
return a < b;
@@ -67,9 +62,10 @@
}
pressed_button = 0;
- wheel_slot = CL_Mouse::sig_key_down().connect(this,
&ButtonPanel::on_wheel_move);
+ ////wheel_slot = CL_Mouse::sig_key_down().connect(this,
&ButtonPanel::on_wheel_move);
}
+#if 0
void
ButtonPanel::on_wheel_move(const CL_InputEvent& key)
{
@@ -82,6 +78,7 @@
previous_action();
}
}
+#endif
ButtonPanel::~ButtonPanel()
{
@@ -96,7 +93,7 @@
{
a_buttons[pressed_button]->update(delta);
- if (last_press + 350 < CL_System::get_time())
+ if (last_press + 350 < SDL_GetTicks())
{
armageddon_pressed = 0;
}
Modified: branches/pingus_sdl/src/components/button_panel.hxx
===================================================================
--- branches/pingus_sdl/src/components/button_panel.hxx 2007-01-15 23:28:22 UTC
(rev 2661)
+++ branches/pingus_sdl/src/components/button_panel.hxx 2007-01-16 00:01:18 UTC
(rev 2662)
@@ -45,12 +45,11 @@
bool left_pressed;
unsigned int last_press;
- static CL_Surface button_cap;
int x_pos, y_pos;
- CL_Slot wheel_slot;
- void on_wheel_move(const CL_InputEvent& key);
+ ////CL_Slot wheel_slot;
+ ////void on_wheel_move(const CL_InputEvent& key);
public:
ButtonPanel(Client* c, int arg_x_pos, int arg_y_pos);
virtual ~ButtonPanel();
Modified: branches/pingus_sdl/src/components/hurry_up.cxx
===================================================================
--- branches/pingus_sdl/src/components/hurry_up.cxx 2007-01-15 23:28:22 UTC
(rev 2661)
+++ branches/pingus_sdl/src/components/hurry_up.cxx 2007-01-16 00:01:18 UTC
(rev 2662)
@@ -17,14 +17,11 @@
// 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/Core/System/system.h>
-#include <ClanLib/Display/display.h>
-#include <ClanLib/Display/font.h>
#include "../resource.hxx"
#include "../fonts.hxx"
+#include "gui/display.hxx"
#include "hurry_up.hxx"
-
HurryUp::HurryUp (Client* c)
: font(Fonts::pingus_large),
is_running(false),
@@ -71,12 +68,12 @@
if (center_reached)
{
// Wait some secs
- if (static_cast<unsigned int>(wait_counter) < CL_System::get_time())
+ if (static_cast<unsigned int>(wait_counter) < SDL_GetTicks())
{
speed *= 1.2f;
x_pos += speed;
- if (x_pos > CL_Display::get_width() + 200)
+ if (x_pos > Display::get_width() + 200)
is_finished = true;
}
}
@@ -85,11 +82,11 @@
x_pos += speed;
speed *= 1.2f;
- if (static_cast<int>(x_pos) > CL_Display::get_width()/2)
+ if (static_cast<int>(x_pos) > Display::get_width()/2)
{
- x_pos = (float)CL_Display::get_width()/2;
+ x_pos = (float)Display::get_width()/2;
center_reached = true;
- wait_counter = CL_System::get_time() + 2000;
+ wait_counter = SDL_GetTicks() + 2000;
}
}
}
Modified: branches/pingus_sdl/src/components/hurry_up.hxx
===================================================================
--- branches/pingus_sdl/src/components/hurry_up.hxx 2007-01-15 23:28:22 UTC
(rev 2661)
+++ branches/pingus_sdl/src/components/hurry_up.hxx 2007-01-16 00:01:18 UTC
(rev 2662)
@@ -22,9 +22,8 @@
#include "../gui/component.hxx"
-class CL_Font;
+#include "../font.hpp"
-
class DrawingContext;
class Client;
@@ -32,7 +31,7 @@
class HurryUp : public GUI::Component
{
private:
- CL_Font font;
+ Font font;
bool is_running;
bool is_finished;
bool center_reached;
Modified: branches/pingus_sdl/src/components/pingus_counter.cxx
===================================================================
--- branches/pingus_sdl/src/components/pingus_counter.cxx 2007-01-15
23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/components/pingus_counter.cxx 2007-01-16
00:01:18 UTC (rev 2662)
@@ -18,8 +18,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdio.h>
-#include <ClanLib/Display/display.h>
-#include <ClanLib/Display/font.h>
+#include "../gui/display.hxx"
#include "../gettext.h"
#include "../resource.hxx"
#include "../world.hxx"
@@ -43,7 +42,7 @@
char str[128];
if (!fast_mode)
- gc.draw(background, Vector(gc.get_width()/2, 0));
+ gc.draw(background, Vector3f(gc.get_width()/2, 0));
World* world = server->get_world();
Modified: branches/pingus_sdl/src/components/pingus_counter.hxx
===================================================================
--- branches/pingus_sdl/src/components/pingus_counter.hxx 2007-01-15
23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/components/pingus_counter.hxx 2007-01-16
00:01:18 UTC (rev 2662)
@@ -20,13 +20,10 @@
#ifndef HEADER_PINGUS_PINGUS_COUNTER_HXX
#define HEADER_PINGUS_PINGUS_COUNTER_HXX
-#include <ClanLib/Display/sprite.h>
-#include <ClanLib/Display/font.h>
#include "../gui/component.hxx"
+#include "../font.hpp"
+#include "../sprite.hpp"
-class CL_Font;
-
-
class DrawingContext;
class World;
class Server;
@@ -35,8 +32,8 @@
{
private:
Server* server;
- CL_Font font;
- CL_Sprite background;
+ Font font;
+ Sprite background;
public:
PingusCounter(Server* s);
virtual ~PingusCounter() {}
Modified: branches/pingus_sdl/src/components/playfield.cxx
===================================================================
--- branches/pingus_sdl/src/components/playfield.cxx 2007-01-15 23:28:22 UTC
(rev 2661)
+++ branches/pingus_sdl/src/components/playfield.cxx 2007-01-16 00:01:18 UTC
(rev 2662)
@@ -19,7 +19,6 @@
#include <stdio.h>
#include <iostream>
-#include <ClanLib/Display/display.h>
#include "../globals.hxx"
#include "../pingu_holder.hxx"
#include "../display/drawing_context.hxx"
@@ -33,7 +32,7 @@
#include "playfield.hxx"
-Playfield::Playfield (Client* client_, const CL_Rect& rect_)
+Playfield::Playfield (Client* client_, const Rect& rect_)
: rect(rect_),
client(client_),
buttons(client->get_button_panel()),
@@ -47,29 +46,29 @@
world = client->get_server()->get_world();
mouse_scrolling = false;
- state.set_limit(CL_Rect(CL_Point(0, 0), CL_Size(world->get_width(),
world->get_height())));
+ state.set_limit(Rect(Vector2i(0, 0), Size(world->get_width(),
world->get_height())));
}
Playfield::~Playfield()
{
- delete scene_context;
+ delete scene_context;
}
void
Playfield::draw (DrawingContext& gc)
{
scene_context->clear();
- scene_context->light().fill_screen(CL_Color(50, 50, 50));
+ scene_context->light().fill_screen(Color(50, 50, 50));
state.push(*scene_context);
cap.set_pingu(current_pingu);
cap.draw(*scene_context);
- // Blank out the entire window in case the screen resolution is larger
- // than the current level.
- gc.draw_fillrect(0, 0, (float)CL_Display::get_width(),
(float)CL_Display::get_height(),
- CL_Color::black, -15000);
+ // Blank out the entire window in case the screen resolution is larger
+ // than the current level.
+ gc.draw_fillrect(0, 0, (float)Display::get_width(),
(float)Display::get_height(),
+ Color(0,0,0), -15000);
world->draw(*scene_context);
// Draw the scrolling band
@@ -77,31 +76,31 @@
{
gc.draw_line((float)mouse_pos.x, (float)mouse_pos.y,
(float)scroll_center.x, (float)scroll_center.y-15,
- CL_Color(0, 255, 0));
+ Color(0, 255, 0));
gc.draw_line((float)mouse_pos.x, (float)mouse_pos.y,
(float)scroll_center.x, (float)scroll_center.y,
- CL_Color(255, 0, 0));
+ Color(255, 0, 0));
gc.draw_line((float)mouse_pos.x, (float)mouse_pos.y,
(float)scroll_center.x, (float)scroll_center.y+15,
- CL_Color(0, 0, 255));
+ Color(0, 0, 255));
gc.draw_line((float)mouse_pos.x, (float)mouse_pos.y,
(float)scroll_center.x + 15, (float)scroll_center.y,
- CL_Color(0, 255, 255));
+ Color(0, 255, 255));
gc.draw_line((float)mouse_pos.x, (float)mouse_pos.y,
(float)scroll_center.x - 15, (float)scroll_center.y,
- CL_Color(255, 255, 0));
+ Color(255, 255, 0));
}
state.pop(*scene_context);
- gc.draw(new SceneContextDrawingRequest(scene_context,
CL_Vector(0,0,-10000)));
+ gc.draw(new SceneContextDrawingRequest(scene_context, Vector3f(0,0,-10000)));
}
Pingu*
-Playfield::current_pingu_find (const CL_Pointf& pos)
+Playfield::current_pingu_find (const Vector2f& pos)
{
double min_dist = 500.0;
double dist;
@@ -128,6 +127,7 @@
void
Playfield::update(float delta)
{
+#if 0
// FIXME: This should be delta dependant
if (!mouse_scrolling)
{
@@ -142,8 +142,8 @@
}
else
{
- state.set_pos(CL_Pointf(state.get_pos().x - float(scroll_center.x -
mouse_pos.x) * 0.2f,
- state.get_pos().y - float(scroll_center.y -
mouse_pos.y) * 0.2f));
+ state.set_pos(Vector2f(state.get_pos().x - float(scroll_center.x -
mouse_pos.x) * 0.2f,
+ state.get_pos().y - float(scroll_center.y -
mouse_pos.y) * 0.2f));
}
}
@@ -155,22 +155,23 @@
if (mouse_pos.x < 10)
{
- state.set_pos(state.get_pos() - CL_Point(scroll_speed, 0));
+ state.set_pos(state.get_pos() - Vector2i(scroll_speed, 0));
}
- else if (mouse_pos.x > CL_Display::get_width() - 10)
+ else if (mouse_pos.x > Display::get_width() - 10)
{
- state.set_pos(state.get_pos() + CL_Point(scroll_speed, 0));
+ state.set_pos(state.get_pos() + Vector2i(scroll_speed, 0));
}
if (mouse_pos.y < 10)
{
- state.set_pos(state.get_pos() - CL_Point(0, scroll_speed));
+ state.set_pos(state.get_pos() - Vector2i(0, scroll_speed));
}
- else if (mouse_pos.y > CL_Display::get_height() - 10)
+ else if (mouse_pos.y > Display::get_height() - 10)
{
- state.set_pos(state.get_pos() + CL_Point(0, scroll_speed));
+ state.set_pos(state.get_pos() + Vector2i(0, scroll_speed));
}
}
+#endif
}
void
@@ -218,31 +219,32 @@
server = s;
}
-CL_Point
+Vector2i
Playfield::get_pos() const
{
- return CL_Point(state.get_pos());
+ return Vector2i(static_cast<int>(state.get_pos().x),
+ static_cast<int>(state.get_pos().y));
}
void
Playfield::set_viewpoint(int x, int y)
{
- state.set_pos(CL_Point(x, y));
+ state.set_pos(Vector2f(x, y));
}
void
Playfield::generate_clipping_rects(int x1, int y1, int x2, int y2)
{
- clipping_rectangles.push_back(CL_Rect(0, 0, CL_Display::get_width() - 1,
y1));
- clipping_rectangles.push_back(CL_Rect(0, y1, x1, y2+1));
- clipping_rectangles.push_back(CL_Rect(x2+1, y1, CL_Display::get_width() - 1,
y2+1));
- clipping_rectangles.push_back(CL_Rect(0, y2+1, CL_Display::get_width() - 1,
CL_Display::get_height() - 1));
+ clipping_rectangles.push_back(Rect(0, 0, Display::get_width() - 1, y1));
+ clipping_rectangles.push_back(Rect(0, y1, x1, y2+1));
+ clipping_rectangles.push_back(Rect(x2+1, y1, Display::get_width() - 1,
y2+1));
+ clipping_rectangles.push_back(Rect(0, y2+1, Display::get_width() - 1,
Display::get_height() - 1));
}
void
Playfield::scroll (int x, int y)
{
- state.set_pos(state.get_pos() + CL_Point(x, y));
+ state.set_pos(state.get_pos() + Vector2f(x, y));
}
Modified: branches/pingus_sdl/src/components/playfield.hxx
===================================================================
--- branches/pingus_sdl/src/components/playfield.hxx 2007-01-15 23:28:22 UTC
(rev 2661)
+++ branches/pingus_sdl/src/components/playfield.hxx 2007-01-16 00:01:18 UTC
(rev 2662)
@@ -20,13 +20,11 @@
#ifndef HEADER_PINGUS_PLAYFIELD_HXX
#define HEADER_PINGUS_PLAYFIELD_HXX
-#include <ClanLib/Core/Math/rect.h>
#include "../client.hxx"
#include "../graphic_context_state.hxx"
#include "../gui/component.hxx"
#include "../capture_rectangle.hxx"
-
class Pingu;
class World;
class Server;
@@ -40,9 +38,9 @@
private:
friend class Client;
- CL_Rect rect;
+ Rect rect;
- CL_Surface buffer;
+ ////CL_Surface buffer;
Server* server;
Client* client;
@@ -54,23 +52,23 @@
bool mouse_scrolling;
int scroll_speed;
- CL_Point scroll_center;
+ Vector2i scroll_center;
SceneContext* scene_context;
GraphicContextState state;
CaptureRectangle cap;
- std::vector<CL_Rect> clipping_rectangles;
+ std::vector<Rect> clipping_rectangles;
- CL_Point mouse_pos;
- CL_Pointf old_state_pos;
+ Vector2i mouse_pos;
+ Vector2f old_state_pos;
public:
- Playfield (Client*, const CL_Rect& rect);
+ Playfield (Client*, const Rect& rect);
virtual ~Playfield();
/** Returns the point onto which the Playfield is currently focused
(ie. center of the Playfield) in WorldCO */
- CL_Point get_pos() const;
+ Vector2i get_pos() const;
void scroll (int x, int y);
@@ -78,7 +76,7 @@
void draw(DrawingContext& gc);
void update(float delta);
- Pingu* current_pingu_find(const CL_Pointf& pos);
+ Pingu* current_pingu_find(const Vector2f& pos);
void on_primary_button_press (int x, int y);
void on_secondary_button_press (int x, int y);
Modified: branches/pingus_sdl/src/components/smallmap.cxx
===================================================================
--- branches/pingus_sdl/src/components/smallmap.cxx 2007-01-15 23:28:22 UTC
(rev 2661)
+++ branches/pingus_sdl/src/components/smallmap.cxx 2007-01-16 00:01:18 UTC
(rev 2662)
@@ -17,7 +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/display.h>
#include "../pingu_holder.hxx"
#include "../gui/display.hxx"
#include "../display/drawing_context.hxx"
@@ -28,7 +27,7 @@
#include "../smallmap_image.hxx"
#include "../pingu.hxx"
#include "../math.hxx"
-#include "../vector.hxx"
+#include "../math/vector3f.hpp"
#include "../globals.hxx"
#include "playfield.hxx"
#include "smallmap.hxx"
@@ -64,9 +63,9 @@
}
x_pos = 5;
- y_pos = CL_Display::get_height() - height - 5;
- rwidth = CL_Display::get_width() * width /
client->get_server()->get_world()->get_colmap()->get_width();
- rheight = CL_Display::get_height() * height /
client->get_server()->get_world()->get_colmap()->get_height();
+ y_pos = Display::get_height() - height - 5;
+ rwidth = Display::get_width() * width /
client->get_server()->get_world()->get_colmap()->get_width();
+ rheight = Display::get_height() * height /
client->get_server()->get_world()->get_colmap()->get_height();
image = new SmallMapImage(c->get_server(), width, height);
@@ -87,9 +86,9 @@
Playfield* playfield = client->get_playfield();
- gc.draw(image->get_surface(), Vector((float)x_pos, (float)y_pos));
-
- CL_Point of = playfield->get_pos();
+ gc.draw(image->get_surface(), Vector3f((float)x_pos, (float)y_pos));
+
+ Vector2i of = playfield->get_pos();
of.x = x_pos + of.x * width /
client->get_server()->get_world()->get_colmap()->get_width();
of.y = y_pos + of.y * height /
client->get_server()->get_world()->get_colmap()->get_height();
@@ -99,7 +98,7 @@
gc.draw_rect(float(of.x - w/2), float(of.y - h/2),
float(of.x + w/2), float(of.y + h/2),
- CL_Color(0, 255, 0));
+ Color(0, 255, 0));
client->get_server()->get_world()->draw_smallmap(this);
@@ -111,7 +110,7 @@
int x = static_cast<int>(x_pos + ((*i)->get_x() * width /
world->get_colmap()->get_width()));
int y = static_cast<int>(y_pos + ((*i)->get_y() * height /
world->get_colmap()->get_height()));
- gc.draw_line((float)x, (float)y, (float)x, (float)y-2, CL_Color(255,
255, 0));
+ gc.draw_line((float)x, (float)y, (float)x, (float)y-2, Color(255, 255,
0));
}
gc_ptr = 0;
@@ -124,13 +123,13 @@
}
void
-SmallMap::draw_sprite(CL_Sprite sprite, Vector pos)
+SmallMap::draw_sprite(Sprite sprite, Vector3f pos)
{
World* world = client->get_server()->get_world();
float x = x_pos + (pos.x * width / world->get_colmap()->get_width());
float y = y_pos + (pos.y * height / world->get_colmap()->get_height());
- gc_ptr->draw(sprite, Vector(x, y));
+ gc_ptr->draw(sprite, Vector3f(x, y));
}
bool
Modified: branches/pingus_sdl/src/components/smallmap.hxx
===================================================================
--- branches/pingus_sdl/src/components/smallmap.hxx 2007-01-15 23:28:22 UTC
(rev 2661)
+++ branches/pingus_sdl/src/components/smallmap.hxx 2007-01-16 00:01:18 UTC
(rev 2662)
@@ -20,15 +20,12 @@
#ifndef HEADER_PINGUS_SMALLMAP_HXX
#define HEADER_PINGUS_SMALLMAP_HXX
-#include <ClanLib/Display/sprite.h>
-#include <ClanLib/Display/pixel_buffer.h>
#include "../gui/component.hxx"
class CL_Key;
-
class Client;
-class Vector;
+class Vector3f;
class SmallMapImage;
/** This is the map that appears in the corner of the screen */
@@ -38,10 +35,10 @@
Client* client;
/** Graphic surface of the exit */
- CL_Sprite exit_sur;
+ Sprite exit_sur;
/** Graphic surface of the entrance */
- CL_Sprite entrance_sur;
+ Sprite entrance_sur;
SmallMapImage* image;
@@ -98,7 +95,7 @@
@param sprite the Sprite to draw, it will keep its original size
@param pos the position to draw it in World COs, it will get
recalculated to screen CO */
- void draw_sprite(CL_Sprite sprite, Vector pos);
+ void draw_sprite(Sprite sprite, Vector3f pos);
private:
SmallMap (const SmallMap&);
Modified: branches/pingus_sdl/src/components/time_display.cxx
===================================================================
--- branches/pingus_sdl/src/components/time_display.cxx 2007-01-15 23:28:22 UTC
(rev 2661)
+++ branches/pingus_sdl/src/components/time_display.cxx 2007-01-16 00:01:18 UTC
(rev 2662)
@@ -19,10 +19,8 @@
#include <assert.h>
#include <stdio.h>
-#include <ClanLib/Display/display.h>
-#include <ClanLib/Display/font.h>
-#include <ClanLib/Core/System/clanstring.h>
+#include "../gui/display.hxx"
#include "../globals.hxx"
#include "../resource.hxx"
#include "../world.hxx"
@@ -48,23 +46,23 @@
std::string time_string;
if (server->get_plf().get_time() == -1 && !(pingus_debug_flags &
PINGUS_DEBUG_GAMETIME))
- {
- gc.draw(infinity_symbol,
static_cast<float>(CL_Display::get_width()
- - infinity_symbol.get_width() - 6), 2.0f,
150.0f);
- }
+ {
+ gc.draw(infinity_symbol, static_cast<float>(Display::get_width()
+ -
infinity_symbol.get_width() - 6), 2.0f, 150.0f);
+ }
else
- {
- if (!(pingus_debug_flags & PINGUS_DEBUG_GAMETIME))
- time_string =
GameTime::ticks_to_realtime_string(time_value);
- else
- {
- time_value = server->get_world()->get_time_passed();
- time_string = CL_String::to(time_value);
- }
+ {
+ if (!(pingus_debug_flags & PINGUS_DEBUG_GAMETIME))
+ time_string = GameTime::ticks_to_realtime_string(time_value);
+ else
+ {
+ //// time_value = server->get_world()->get_time_passed();
+ //// time_string = CL_String::to(time_value);
+ }
- gc.print_right(font, static_cast<float>(CL_Display::get_width()
- 30),
-
3.0f, time_string, 150.0f);
- }
+ gc.print_right(font, static_cast<float>(Display::get_width() - 30),
+ 3.0f, time_string, 150.0f);
+ }
}
Modified: branches/pingus_sdl/src/components/time_display.hxx
===================================================================
--- branches/pingus_sdl/src/components/time_display.hxx 2007-01-15 23:28:22 UTC
(rev 2661)
+++ branches/pingus_sdl/src/components/time_display.hxx 2007-01-16 00:01:18 UTC
(rev 2662)
@@ -20,13 +20,9 @@
#ifndef HEADER_PINGUS_TIME_DISPLAY_HXX
#define HEADER_PINGUS_TIME_DISPLAY_HXX
-#include <ClanLib/Display/sprite.h>
-#include <ClanLib/Display/font.h>
#include "../gui/component.hxx"
-class CL_Font;
-
-
+class Font;
class Server;
class Client;
class DrawingContext;
@@ -35,8 +31,8 @@
{
private:
Server* server;
- CL_Font font;
- CL_Sprite infinity_symbol;
+ Font font;
+ Sprite infinity_symbol;
public:
TimeDisplay(Client* c);
Modified: branches/pingus_sdl/src/display/drawing_context.cxx
===================================================================
--- branches/pingus_sdl/src/display/drawing_context.cxx 2007-01-15 23:28:22 UTC
(rev 2661)
+++ branches/pingus_sdl/src/display/drawing_context.cxx 2007-01-16 00:01:18 UTC
(rev 2662)
@@ -255,6 +255,7 @@
pos.z)));
}
#endif
+
void
DrawingContext::draw(const Sprite& sprite, const Vector3f& pos)
{
@@ -298,27 +299,28 @@
#endif
}
-#if 0
void
DrawingContext::draw_rect (float x1, float y1, float x2, float y2,
- const CL_Color& color, float z)
+ const Color& color, float z)
{
+#if 0
draw(new RectDrawingRequest(CL_Rectf(x1 + translate_stack.back().x, y1 +
translate_stack.back().y,
x2 + translate_stack.back().x, y2 +
translate_stack.back().y),
color,
false,
z));
+#endif
}
void
DrawingContext::draw_pixel (float x_pos, float y_pos,
- const CL_Color& color)
+ const Color& color)
{
}
void
DrawingContext::draw_circle (float x_pos, float y_pos, float radius,
- const CL_Color& color)
+ const Color& color)
{
}
@@ -326,16 +328,15 @@
counterclockwise direction. Angles are taken in radian */
void
DrawingContext::draw_arc (float x_pos, float y_pos, float radius, float
angle_start, float angle_end,
- const CL_Color& color)
+ const Color& color)
{
}
void
-DrawingContext::fill_screen(const CL_Color& color)
+DrawingContext::fill_screen(const Color& color)
{
- draw(new FillScreenDrawingRequest(color));
+ //// draw(new FillScreenDrawingRequest(color));
}
-#endif
void
DrawingContext::rotate(float angel)
Modified: branches/pingus_sdl/src/display/drawing_context.hxx
===================================================================
--- branches/pingus_sdl/src/display/drawing_context.hxx 2007-01-15 23:28:22 UTC
(rev 2661)
+++ branches/pingus_sdl/src/display/drawing_context.hxx 2007-01-16 00:01:18 UTC
(rev 2662)
@@ -69,18 +69,15 @@
void draw(const Sprite& sprite, const Vector3f& pos);
void draw(const Sprite& sprite, float x, float y, float z = 0);
-#if 0
-
/** Fills the screen with a given color, this is different from
clear() in that it doesn't remove other DrawingRequest from the
queue */
- void fill_screen(const CL_Color& color);
+ void fill_screen(const Color& color);
void draw(const std::string& text, float x, float y, float z = 0);
- void draw(const CL_Surface& surface, const Vector& pos);
+ ////void draw(const CL_Surface& surface, const Vector& pos);
-#endif
void draw_line (float x1, float y1, float x2, float y2,
const Color& color, float z = 0);
void draw_fillrect (float x1, float y1, float x2, float y2,
Modified: branches/pingus_sdl/src/game_session.cxx
===================================================================
--- branches/pingus_sdl/src/game_session.cxx 2007-01-15 23:28:22 UTC (rev
2661)
+++ branches/pingus_sdl/src/game_session.cxx 2007-01-16 00:01:18 UTC (rev
2662)
@@ -160,7 +160,7 @@
if (left_over_time < 0)
{
// FIXME: This doesn't really belong here
- CL_System::sleep(-left_over_time);
+ SDL_Delay(-left_over_time);
}
// Client is independend of the update limit, well, not completly...
Modified: branches/pingus_sdl/src/pingu.cxx
===================================================================
--- branches/pingus_sdl/src/pingu.cxx 2007-01-15 23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/pingu.cxx 2007-01-16 00:01:18 UTC (rev 2662)
@@ -39,8 +39,7 @@
// Init a pingu at the given position while falling
Pingu::Pingu (int arg_id, const Vector& arg_pos, int owner)
- : light(Resource::load_sprite("other/light")),
- action(0),
+ : action(0),
countdown_action (0),
wall_action(0),
fall_action(0),
@@ -53,7 +52,6 @@
pos_y(arg_pos.y),
velocity(new Vector(0, 0, 0))
{
- light.set_blend_func(blend_src_alpha, blend_one);
direction.left ();
// Initialisize the action, after this step the action ptr will
@@ -357,8 +355,6 @@
gc.color().print_center(Fonts::lcd, pos_x, pos_y - 45 + 2, str);
}
-
- gc.light().draw(light, get_center_pos());
}
int
Modified: branches/pingus_sdl/src/pingu.hxx
===================================================================
--- branches/pingus_sdl/src/pingu.hxx 2007-01-15 23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/pingu.hxx 2007-01-16 00:01:18 UTC (rev 2662)
@@ -20,11 +20,9 @@
#ifndef HEADER_PINGUS_PINGU_HXX
#define HEADER_PINGUS_PINGU_HXX
-#include <ClanLib/Display/sprite.h>
#include "direction.hxx"
#include "pingu_enums.hxx"
-
// Forward declarations
class Vector;
class ActionHolder;
@@ -37,8 +35,6 @@
class Pingu
{
private:
- CL_Sprite light;
-
/** The primary action with is currently in use */
PinguAction* action;
Modified: branches/pingus_sdl/src/pingu_holder.hxx
===================================================================
--- branches/pingus_sdl/src/pingu_holder.hxx 2007-01-15 23:28:22 UTC (rev
2661)
+++ branches/pingus_sdl/src/pingu_holder.hxx 2007-01-16 00:01:18 UTC (rev
2662)
@@ -26,7 +26,7 @@
class PingusLevel;
-class Vector;
+class Vector3f;
class Pingu;
typedef std::list<Pingu*>::iterator PinguIter;
@@ -94,7 +94,7 @@
will take care of the deletion. The caller *must* not delete the
Pingu. Might return 0 if all available pingus are already
released */
- Pingu* create_pingu(const Vector& pos, int owner_id);
+ Pingu* create_pingu(const Vector3f& pos, int owner_id);
/** Get a pingu by id, references to dead or exited Pingus are not
returned, but 0 instead
Modified: branches/pingus_sdl/src/server_event.cxx
===================================================================
--- branches/pingus_sdl/src/server_event.cxx 2007-01-15 23:28:22 UTC (rev
2661)
+++ branches/pingus_sdl/src/server_event.cxx 2007-01-16 00:01:18 UTC (rev
2662)
@@ -19,7 +19,6 @@
#include <assert.h>
#include <iostream>
-#include <ClanLib/Core/System/clanstring.h>
#include "pingus_error.hxx"
#include "server.hxx"
#include "world.hxx"
@@ -58,6 +57,7 @@
void
ServerEvent::write_xml(std::ostream& xml) const
{
+#if 0
switch(type)
{
case ARMAGEDDON_EVENT:
@@ -70,6 +70,7 @@
default:
assert(!"Unknown type");
}
+#endif
}
ServerEvent
Modified: branches/pingus_sdl/src/smallmap_image.cxx
===================================================================
--- branches/pingus_sdl/src/smallmap_image.cxx 2007-01-15 23:28:22 UTC (rev
2661)
+++ branches/pingus_sdl/src/smallmap_image.cxx 2007-01-16 00:01:18 UTC (rev
2662)
@@ -29,7 +29,7 @@
SmallMapImage::SmallMapImage(Server* s, int width, int height)
: server(s),
- canvas(width, height, width*4, CL_PixelFormat::rgba8888),
+ ////canvas(width, height, width*4, CL_PixelFormat::rgba8888),
update_count(0),
colmap_serial(0)
{
@@ -55,7 +55,7 @@
}
}
-CL_Sprite
+Sprite
SmallMapImage::get_surface ()
{
if (sur)
@@ -72,6 +72,7 @@
void
SmallMapImage::update_surface()
{
+#if 0
unsigned char* buffer;
unsigned char* cbuffer;
unsigned char current_pixel;
@@ -218,6 +219,7 @@
CL_SpriteDescription desc;
desc.add_frame(canvas);
sur = CL_Sprite(desc);
+#endif
}
Modified: branches/pingus_sdl/src/smallmap_image.hxx
===================================================================
--- branches/pingus_sdl/src/smallmap_image.hxx 2007-01-15 23:28:22 UTC (rev
2661)
+++ branches/pingus_sdl/src/smallmap_image.hxx 2007-01-16 00:01:18 UTC (rev
2662)
@@ -21,10 +21,7 @@
#define HEADER_PINGUS_SMALLMAP_IMAGE_HXX
#include "pingus.hxx"
-#include <ClanLib/Display/sprite.h>
-#include "vector.hxx"
-
class Server;
/** The base image of the small map, it doesn't handle any userinput,
@@ -35,10 +32,10 @@
Server* server;
/** The canvas that represents the small-colmap */
- CL_PixelBuffer canvas;
+ ////CL_PixelBuffer canvas;
/** Graphic surface for the generated rectanglar background of the small map
*/
- CL_Sprite sur;
+ Sprite sur;
/** number of seconds till the smallmap will update itself */
float update_count;
@@ -50,7 +47,7 @@
SmallMapImage (Server* s, int width, int height);
void update (float delta);
- CL_Sprite get_surface();
+ Sprite get_surface();
/** Regenerate the smallmap surface */
void update_surface();
Modified: branches/pingus_sdl/src/sprite.cpp
===================================================================
--- branches/pingus_sdl/src/sprite.cpp 2007-01-15 23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/sprite.cpp 2007-01-16 00:01:18 UTC (rev 2662)
@@ -141,4 +141,10 @@
{
}
+void
+Sprite::set_frame(int i)
+{
+
+}
+
/* EOF */
Modified: branches/pingus_sdl/src/sprite.hpp
===================================================================
--- branches/pingus_sdl/src/sprite.hpp 2007-01-15 23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/sprite.hpp 2007-01-16 00:01:18 UTC (rev 2662)
@@ -48,7 +48,7 @@
void update(float delta);
void draw(float x, float y, SDL_Surface* target);
-
+ void set_frame(int i);
operator bool();
private:
SharedPtr<SpriteImpl> impl;
Modified: branches/pingus_sdl/src/start_screen.cxx
===================================================================
--- branches/pingus_sdl/src/start_screen.cxx 2007-01-15 23:28:22 UTC (rev
2661)
+++ branches/pingus_sdl/src/start_screen.cxx 2007-01-16 00:01:18 UTC (rev
2662)
@@ -235,10 +235,8 @@
void
StartScreen::start_game()
{
-#if 0
PingusGameSession* game_session = new PingusGameSession(plf, true);
ScreenManager::instance()->replace_screen(game_session, true);
-#endif
}
void
Modified: branches/pingus_sdl/src/timer.cxx
===================================================================
--- branches/pingus_sdl/src/timer.cxx 2007-01-15 23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/timer.cxx 2007-01-16 00:01:18 UTC (rev 2662)
@@ -17,7 +17,7 @@
// 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/Core/System/system.h>
+#include "SDL.h"
#include "debug.hxx"
#include "globals.hxx"
#include "timer.hxx"
@@ -25,14 +25,14 @@
Timer::Timer(const char* desc)
: description(desc),
- start_time (CL_System::get_time())
+ start_time(SDL_GetTicks())
{
}
void
Timer::stop()
{
- unsigned int time = CL_System::get_time() - start_time;
+ unsigned int time = SDL_GetTicks() - start_time;
pout(PINGUS_DEBUG_LOADING)
<< "Timer: '" << description << "' took "
<< time << "msec" << std::endl;
Modified: branches/pingus_sdl/src/world.cxx
===================================================================
--- branches/pingus_sdl/src/world.cxx 2007-01-15 23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/world.cxx 2007-01-16 00:01:18 UTC (rev 2662)
@@ -222,11 +222,11 @@
}
void
-World::play_sound(std::string name, const Vector& pos, float volume)
+World::play_sound(std::string name, const Vector3f& pos, float volume)
{
// FIXME: Stereo is for the moment disabled
/*
- Vector center = view->get_center();
+ Vector3f center = view->get_center();
float panning = pos.x - center.x;
panning /= view->get_width()/2;
@@ -242,7 +242,7 @@
}
Pingu*
-World::get_pingu (const Vector& pos)
+World::get_pingu (const Vector3f& pos)
{
Pingu* current_pingu = 0;
double distance = -1.0;
Modified: branches/pingus_sdl/src/world.hxx
===================================================================
--- branches/pingus_sdl/src/world.hxx 2007-01-15 23:28:22 UTC (rev 2661)
+++ branches/pingus_sdl/src/world.hxx 2007-01-16 00:01:18 UTC (rev 2662)
@@ -23,11 +23,10 @@
#include "pingus.hxx"
#include <vector>
#include <string>
-#include <ClanLib/Display/color.h>
+#include "math/color.hpp"
-
// Forward declarations
-class Vector;
+class Vector3f;
//class ActionHolder;
class Entrance;
class Exit;
@@ -60,7 +59,7 @@
class World
{
private:
- CL_Color ambient_light;
+ Color ambient_light;
/** groundmap for the pingus */
GroundMap* gfx_map;
@@ -151,12 +150,12 @@
going to be ignored) void play_sound (std::string name, const
@param volume The volume of the sound
*/
- void play_sound (std::string name, const Vector& pos, float volume = 0.5f);
+ void play_sound (std::string name, const Vector3f& pos, float volume = 0.5f);
PinguHolder* get_pingus(void);
/** @return the pingu at the given word coordinates, 0 if none is there */
- Pingu* get_pingu (const Vector& pos);
+ Pingu* get_pingu (const Vector3f& pos);
/** Return a pointer to the GameTime object of this World */
GameTime* get_game_time ();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2662 - in branches/pingus_sdl/src: . components display,
grumbel at BerliOS <=