[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2667 - in branches/pingus_sdl/src: . editor gui worldobjs
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r2667 - in branches/pingus_sdl/src: . editor gui worldobjs |
Date: |
Tue, 16 Jan 2007 04:32:01 +0100 |
Author: grumbel
Date: 2007-01-16 04:31:58 +0100 (Tue, 16 Jan 2007)
New Revision: 2667
Removed:
branches/pingus_sdl/src/game_counter.cxx
branches/pingus_sdl/src/game_counter.hxx
Modified:
branches/pingus_sdl/src/SConscript
branches/pingus_sdl/src/blitter.hxx
branches/pingus_sdl/src/editor/context_menu.cxx
branches/pingus_sdl/src/editor/context_menu.hxx
branches/pingus_sdl/src/editor/editor_panel.cxx
branches/pingus_sdl/src/editor/editor_panel.hxx
branches/pingus_sdl/src/editor/editor_screen.cxx
branches/pingus_sdl/src/editor/editor_viewport.cxx
branches/pingus_sdl/src/editor/editor_viewport.hxx
branches/pingus_sdl/src/editor/level_head.cxx
branches/pingus_sdl/src/editor/level_head.hxx
branches/pingus_sdl/src/editor/level_impl.hxx
branches/pingus_sdl/src/editor/level_objs.cxx
branches/pingus_sdl/src/editor/level_objs.hxx
branches/pingus_sdl/src/editor/panel_buttons.cxx
branches/pingus_sdl/src/editor/panel_buttons.hxx
branches/pingus_sdl/src/editor/xml_level.cxx
branches/pingus_sdl/src/editor/xml_level.hxx
branches/pingus_sdl/src/file_dialog.cxx
branches/pingus_sdl/src/file_dialog_item.cxx
branches/pingus_sdl/src/file_dialog_item.hxx
branches/pingus_sdl/src/font.hpp
branches/pingus_sdl/src/gui/buffer_graphic_context.cxx
branches/pingus_sdl/src/gui/buffer_graphic_context.hxx
branches/pingus_sdl/src/gui/checkbox.cxx
branches/pingus_sdl/src/gui/checkbox.hxx
branches/pingus_sdl/src/gui/checkbox_listener.hxx
branches/pingus_sdl/src/gui/combobox.cxx
branches/pingus_sdl/src/gui/combobox.hxx
branches/pingus_sdl/src/gui/combobox_listener.hxx
branches/pingus_sdl/src/gui/cursor.cxx
branches/pingus_sdl/src/gui/cursor.hxx
branches/pingus_sdl/src/gui/input_box.cxx
branches/pingus_sdl/src/gui/input_box.hxx
branches/pingus_sdl/src/worldobjs/guillotine.hxx
branches/pingus_sdl/src/worldobjs/spike.hxx
branches/pingus_sdl/src/xml_file_reader.hxx
branches/pingus_sdl/src/xml_file_writer.cxx
branches/pingus_sdl/src/xml_file_writer.hxx
Log:
- editor now compiles as well
Modified: branches/pingus_sdl/src/SConscript
===================================================================
--- branches/pingus_sdl/src/SConscript 2007-01-16 02:40:45 UTC (rev 2666)
+++ branches/pingus_sdl/src/SConscript 2007-01-16 03:31:58 UTC (rev 2667)
@@ -118,28 +118,27 @@
'display/drawing_context.cxx',
'display/scene_context.cxx',
-# # 'editor/context_menu.cxx',
-# # 'editor/editor_panel.cxx',
-# # 'editor/editor_screen.cxx',
-# # 'editor/editor_viewport.cxx',
-# # 'editor/level_head.cxx',
-# # 'editor/level_objs.cxx',
-# # 'editor/panel_buttons.cxx',
-# # 'editor/xml_level.cxx',
+'editor/context_menu.cxx',
+'editor/editor_panel.cxx',
+'editor/editor_screen.cxx',
+'editor/editor_viewport.cxx',
+'editor/level_head.cxx',
+'editor/level_objs.cxx',
+'editor/panel_buttons.cxx',
+'editor/xml_level.cxx',
'command_line.cpp',
'command_line_generic.cpp',
'exit_menu.cxx',
-# 'file_dialog.cxx',
-# 'file_dialog_item.cxx',
+'file_dialog.cxx',
+'file_dialog_item.cxx',
'file_reader.cxx',
'sexpr_file_reader.cpp',
'fonts.cxx',
'font.cpp',
'sprite.cpp',
-# 'fps_counter.cxx',
-# 'game_counter.cxx',
+#'fps_counter.cxx',
'game_session.cxx',
'game_session_result.cxx',
'game_time.cxx',
@@ -149,13 +148,13 @@
'goal_manager.cxx',
'graphic_context_state.cxx',
'groundtype.cxx',
-# 'gui/checkbox.cxx',
-# 'gui/combobox.cxx',
-# 'gui/cursor.cxx',
+'gui/checkbox.cxx',
+'gui/combobox.cxx',
+'gui/cursor.cxx',
'gui/display.cxx',
'gui/gui_manager.cxx',
'gui/gui_screen.cxx',
-# 'gui/input_box.cxx',
+'gui/input_box.cxx',
# 'gui/input_debug_screen.cxx',
'gui/root_gui_manager.cxx',
'gui/screen.cxx',
Modified: branches/pingus_sdl/src/blitter.hxx
===================================================================
--- branches/pingus_sdl/src/blitter.hxx 2007-01-16 02:40:45 UTC (rev 2666)
+++ branches/pingus_sdl/src/blitter.hxx 2007-01-16 03:31:58 UTC (rev 2667)
@@ -21,12 +21,13 @@
#define HEADER_PINGUS_BLITTER_HXX
#include "pingus.hxx"
+#include "math/color.hpp"
+#include "math/rect.hpp"
////#include <ClanLib/Display/color.h>
-class CL_Surface;
+////class CL_Surface;
class PixelBuffer;
-#if 0
/** A bunch of blitting and creation functions to operate on
PixelBuffer. Some of them a similar to the ones in ClanLib, but
this are slower and work. */
@@ -41,8 +42,8 @@
int x, int y);
public:
/** Puts a given surface to a given canvas at position x, y. */
- static void put_surface(PixelBuffer target, const CL_Surface& source,
- int x, int y);
+ ////static void put_surface(PixelBuffer target, const CL_Surface& source,
+ //// int x, int y);
/** Puts a given surface provider to a given canvas at position x, y. */
static void put_surface(PixelBuffer target, PixelBuffer source,
@@ -50,7 +51,7 @@
/** Returns a newly allocated canvas. The canvas contains the same
image as the given surface. */
- static PixelBuffer create_canvas(const CL_Surface&);
+ ////static PixelBuffer create_canvas(const CL_Surface&);
/** Returns a newly allocated canvas. The canvas contains the same
image as the given surface provider */
@@ -59,7 +60,7 @@
/** Sets all pixels of a canvas to zero */
static void clear_canvas(PixelBuffer, Color color = Color(0, 0, 0, 0));
- static void fill_rect(PixelBuffer target, const CL_Rect& rect, const Color&
color);
+ static void fill_rect(PixelBuffer target, const Rect& rect, const Color&
color);
/** Creates a new surface (based on a canvas) with the given width
and height and stretches the source surface onto it
@@ -68,7 +69,7 @@
@param width The new width of the surface.
@param height The new height of the surface.
@return A newly created surface, the caller is responsible to delete it.
*/
- static CL_Surface scale_surface (const CL_Surface& sur, int width, int
height);
+ ////static CL_Surface scale_surface (const CL_Surface& sur, int width, int
height);
/** Flip a surface horizontal */
static PixelBuffer flip_horizontal (PixelBuffer sur);
@@ -97,7 +98,7 @@
@param width The new width of the surface.
@param height The new height of the surface.
@return A newly created surface, the caller is responsible to delete it.
*/
- static PixelBuffer scale_surface_to_canvas (const CL_Surface& sur, int
width, int height);
+ ////static PixelBuffer scale_surface_to_canvas (const CL_Surface& sur, int
width, int height);
static PixelBuffer scale_surface_to_canvas (PixelBuffer sur, int width, int
height);
@@ -105,7 +106,6 @@
Blitter (const Blitter&);
Blitter& operator= (const Blitter&);
};
-#endif
#endif
Modified: branches/pingus_sdl/src/editor/context_menu.cxx
===================================================================
--- branches/pingus_sdl/src/editor/context_menu.cxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/context_menu.cxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -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/sprite.h>
-#include <ClanLib/Core/System/clanstring.h>
#include "context_menu.hxx"
#include "level_objs.hxx"
#include "editor_viewport.hxx"
@@ -26,11 +24,10 @@
#include "../gui/gui_manager.hxx"
#include "../fonts.hxx"
-
namespace Editor {
// Determine which actions are available for these objects
- ContextMenu::ContextMenu(std::vector<LevelObj*> o, Vector p,
EditorViewport* vp, bool base_menu)
+ ContextMenu::ContextMenu(std::vector<LevelObj*> o, Vector3f p,
EditorViewport* vp, bool base_menu)
: objs(o),
viewport(vp),
pos(p),
@@ -80,16 +77,16 @@
{
// Draw the box
gc.draw_fillrect(pos.x, pos.y, pos.x + width, pos.y +
total_height,
- CL_Color(211,211,211,100));
+ Color(211,211,211,100));
// Draw the border
gc.draw_rect(pos.x, pos.y, pos.x + width, pos.y +
total_height,
- CL_Color::black);
+ Color(0,0,0));
// Draw the highlighted action if the mouse is in the
box
if (hover)
{
gc.draw_fillrect(pos.x, pos.y +
selected_action_offset *
item_height, pos.x + width, pos.y +
(selected_action_offset + 1) * item_height,
- CL_Color(128,128,128,150));
+ Color(128,128,128,150));
}
// Draw the action names
@@ -125,14 +122,14 @@
objs[i]->set_modifier(actions[selected_action_offset].parameter);
break;
case (SET_OWNER) :
-
objs[i]->set_owner(CL_String::to_int(actions[selected_action_offset].parameter));
+
////objs[i]->set_owner(CL_String::to_int(actions[selected_action_offset].parameter));
break;
case (SET_DIRECTION) :
objs[i]->set_direction(actions[selected_action_offset].parameter);
break;
case (SET_Z_POS) :
-
objs[i]->set_pos(Vector(objs[i]->get_pos().x, objs[i]->get_pos().y,
-
(float)CL_String::to_int(actions[selected_action_offset].parameter)));
+
////objs[i]->set_pos(Vector3f(objs[i]->get_pos().x, objs[i]->get_pos().y,
+ ////
(float)CL_String::to_int(actions[selected_action_offset].parameter)));
objs[i]->set_orig_pos(objs[i]->get_pos());
break;
default :
@@ -164,7 +161,7 @@
ContextMenu* menu;
if (available_attribs & CAN_ROTATE)
{
- menu = new ContextMenu(objs, Vector(pos.x + width,
pos.y), viewport, false);
+ menu = new ContextMenu(objs, Vector3f(pos.x + width,
pos.y), viewport, false);
viewport->get_screen()->get_gui_manager()->add(menu);
menu->add_action(ContextItem("0 degrees", "ROT0",
ROTATE, 0));
menu->add_action(ContextItem("90 Degrees", "ROT90",
ROTATE, 0));
@@ -178,7 +175,7 @@
}
if (available_attribs & HAS_OWNER)
{
- menu = new ContextMenu(objs, Vector(pos.x + width,
pos.y), viewport, false);
+ menu = new ContextMenu(objs, Vector3f(pos.x + width,
pos.y), viewport, false);
viewport->get_screen()->get_gui_manager()->add(menu);
menu->add_action(ContextItem("0", "0", SET_OWNER, 0));
menu->add_action(ContextItem("1", "1", SET_OWNER, 0));
@@ -188,14 +185,14 @@
}
if (available_attribs & HAS_DIRECTION)
{
- menu = new ContextMenu(objs, Vector(pos.x + width,
pos.y), viewport, false);
+ menu = new ContextMenu(objs, Vector3f(pos.x + width,
pos.y), viewport, false);
viewport->get_screen()->get_gui_manager()->add(menu);
menu->add_action(ContextItem("Left", "left",
SET_DIRECTION, 0));
menu->add_action(ContextItem("Right", "right",
SET_DIRECTION, 0));
menu->add_action(ContextItem("Misc.", "misc",
SET_DIRECTION, 0));
add_action(ContextItem("Direction >", "",
SET_DIRECTION, menu));
}
- menu = new ContextMenu(objs, Vector(pos.x + width, pos.y),
viewport, false);
+ menu = new ContextMenu(objs, Vector3f(pos.x + width, pos.y),
viewport, false);
viewport->get_screen()->get_gui_manager()->add(menu);
menu->add_action(ContextItem("-50", "-50", SET_Z_POS, 0));
menu->add_action(ContextItem("-25", "-25", SET_Z_POS, 0));
@@ -243,6 +240,5 @@
}
} // Editor namespace
-} // Pingus namespace
/* EOF */
Modified: branches/pingus_sdl/src/editor/context_menu.hxx
===================================================================
--- branches/pingus_sdl/src/editor/context_menu.hxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/context_menu.hxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -21,10 +21,10 @@
#define HEADER_PINGUS_EDITOR_CONTEXT_MENU_HXX
#include <vector>
-#include "../vector.hxx"
+#include <string>
+#include "../math/vector3f.hpp"
#include "../gui/component.hxx"
-
namespace Editor {
class LevelObj;
@@ -66,10 +66,10 @@
std::vector<ContextItem> actions;
/** Where the mouse is located */
- Vector mouse_at;
+ Vector3f mouse_at;
/** Location of context menu */
- Vector pos;
+ Vector3f pos;
/** Is the mouse over the menu? */
bool hover;
@@ -91,7 +91,7 @@
public:
// Constructor
- ContextMenu (std::vector<LevelObj*>, Vector p, EditorViewport*
v, bool base_menu = true);
+ ContextMenu (std::vector<LevelObj*>, Vector3f p,
EditorViewport* v, bool base_menu = true);
// Desctructor
~ContextMenu ();
@@ -121,7 +121,6 @@
}; // ContextMenu class
} // Editor namespace
-} // Pingus namespace
#endif
Modified: branches/pingus_sdl/src/editor/editor_panel.cxx
===================================================================
--- branches/pingus_sdl/src/editor/editor_panel.cxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/editor_panel.cxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -17,10 +17,10 @@
// 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/color.h>
#include <vector>
#include "../resource.hxx"
-#include "../vector.hxx"
+#include "../gui/display.hxx"
+#include "../math/vector3f.hpp"
#include "../display/drawing_context.hxx"
#include "../gui/gui_manager.hxx"
#include "../gui/checkbox.hxx"
@@ -65,13 +65,13 @@
add((PanelButton*)(new PanelButtonGroundpiece(this)));
add((PanelButton*)(new PanelButtonHead(this)));
// Create Checkboxes
- snap_to_checkbox = new GUI::Checkbox(Vector(370, 5), "Snap To Grid: ",
this);
+ snap_to_checkbox = new GUI::Checkbox(Vector3f(370, 5), "Snap To Grid:
", this);
get_screen()->get_gui_manager()->add(snap_to_checkbox);
// Create Comboboxes
- combobox_3 = new GUI::Combobox(Vector(500, 36), this);
- combobox_2 = new GUI::Combobox(Vector(500, 18), this);
- combobox_1 = new GUI::Combobox(Vector(500, 0), this);
+ combobox_3 = new GUI::Combobox(Vector3f(500, 36), this);
+ combobox_2 = new GUI::Combobox(Vector3f(500, 18), this);
+ combobox_1 = new GUI::Combobox(Vector3f(500, 0), this);
get_screen()->get_gui_manager()->add(combobox_3);
get_screen()->get_gui_manager()->add(combobox_2);
get_screen()->get_gui_manager()->add(combobox_1);
@@ -85,8 +85,8 @@
EditorPanel::draw (DrawingContext& gc)
{
// Draw the panel
- gc.draw_fillrect(0, 0, (float)CL_Display::get_width(),
- 50.0f, CL_Color::lightgray, -50);
+ gc.draw_fillrect(0, 0, (float)Display::get_width(),
+ 50.0f, Color(80,80,80), -50);
}
// Add the button to the vector, set it's position, and add to the gui_manager
@@ -94,13 +94,13 @@
EditorPanel::add(PanelButton* button)
{
// Determind where to place this buttons
- Vector new_pos;
+ Vector3f new_pos;
if (panel_buttons.empty())
- new_pos = Vector(0.0f, 0.0f, 0.0f);
+ new_pos = Vector3f(0.0f, 0.0f, 0.0f);
else
- new_pos = Vector(panel_buttons.back()->get_pos() +
- Vector((float)(5 + panel_buttons.back()->get_width()),
0.0f));
+ new_pos = Vector3f(panel_buttons.back()->get_pos() +
+ Vector3f((float)(5 +
panel_buttons.back()->get_width()), 0.0f));
// Add button to collection of buttons
panel_buttons.push_back(button);
@@ -171,4 +171,3 @@
}
} // Editor namespace
-} // Pingus namespace
Modified: branches/pingus_sdl/src/editor/editor_panel.hxx
===================================================================
--- branches/pingus_sdl/src/editor/editor_panel.hxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/editor_panel.hxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -100,7 +100,6 @@
}; // EditorPanel
} // Editor namespace
-} // Pingus namespace
#endif
Modified: branches/pingus_sdl/src/editor/editor_screen.cxx
===================================================================
--- branches/pingus_sdl/src/editor/editor_screen.cxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/editor_screen.cxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -18,7 +18,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <iostream>
-#include <ClanLib/Core/System/clanstring.h>
+#include "../gui/display.hxx"
#include "../system.hxx"
#include "../sound/sound.hxx"
#include "../gui/gui_manager.hxx"
@@ -139,16 +139,16 @@
// Draw the background and components
bool
-EditorScreen::draw(Pingus::DrawingContext &gc)
+EditorScreen::draw(DrawingContext &gc)
{
// Black out screen
- gc.draw_fillrect(0, 0, (float)CL_Display::get_width(),
- (float)CL_Display::get_height(), CL_Color::black, -10000);
+ gc.draw_fillrect(0, 0, (float)Display::get_width(),
+ (float)Display::get_height(), Color(0,0,0), -10000);
gui_manager->draw(gc);
// FIXME: Remove this warning
- gc.print_center(Fonts::pingus_large, (float)(CL_Display::get_width() /
2),
- (float)(CL_Display::get_height() / 2), "Not yet functional");
+ gc.print_center(Fonts::pingus_large, (float)(Display::get_width() / 2),
+ (float)(Display::get_height() / 2), "Not yet functional");
if (filedialog)
filedialog->draw(gc);
@@ -188,4 +188,4 @@
}
} // Editor namespace
-} // Pingus namespace
+
Modified: branches/pingus_sdl/src/editor/editor_viewport.cxx
===================================================================
--- branches/pingus_sdl/src/editor/editor_viewport.cxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/editor_viewport.cxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -17,13 +17,13 @@
// 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 <vector>
#include <string>
#include <iostream>
#include "../gui/gui_manager.hxx"
+#include "../gui/display.hxx"
#include "../display/drawing_context.hxx"
-#include "../vector.hxx"
+#include "../math/vector3f.hpp"
#include "../graphic_context_state.hxx"
#include "editor_viewport.hxx"
#include "editor_screen.hxx"
@@ -35,7 +35,7 @@
// Constructor
EditorViewport::EditorViewport(EditorScreen* e) :
- state(CL_Display::get_width(), CL_Display::get_height()),
+ state(Display::get_width(), Display::get_height()),
scene_context(new SceneContext()),
editor(e),
autoscroll(true),
@@ -45,8 +45,8 @@
current_action(NOTHING)
{
// FIXME: Hardcoded values should be determined by level size
- state.set_limit(CL_Rect(-30, -50, 1600, 1300));
- state.set_pos(CL_Pointf(0, 0));
+ state.set_limit(Rect(-30, -50, 1600, 1300));
+ state.set_pos(Vector2f(0, 0));
}
// Destructor
@@ -60,7 +60,7 @@
{
remove_context_menu();
- Vector mouse_pos(x - (state.get_width()/2 - state.get_pos().x),
+ Vector3f mouse_pos(x - (state.get_width()/2 - state.get_pos().x),
y - (state.get_height()/2 - state.get_pos().y));
std::cout << "Right-click at " << mouse_pos.x << ", "
@@ -71,7 +71,7 @@
{
// std::vector<LevelObj*> objs;
// objs.push_back(obj);
- context_menu = new ContextMenu(current_objs, Vector((float)x,
(float)y), this);
+ context_menu = new ContextMenu(current_objs, Vector3f((float)x,
(float)y), this);
editor->get_gui_manager()->add(context_menu, true);
}
}
@@ -127,7 +127,7 @@
for (unsigned i = 0; i < objs.size(); i++)
{
// Calculate the object's position
- CL_Point obj_pos((int)objs[i]->get_pos().x +
(state.get_width()/2 -
+ Vector2i obj_pos((int)objs[i]->get_pos().x +
(state.get_width()/2 -
(int)state.get_pos().x),
(int)objs[i]->get_pos().y + (state.get_height()/2 -
(int)state.get_pos().y));
@@ -152,8 +152,8 @@
void
EditorViewport::on_pointer_move(int x, int y)
{
- mouse_at = Vector(float(x), float(y));
- mouse_at_world = Vector(x - (state.get_width()/2 - state.get_pos().x),
+ mouse_at = Vector3f(float(x), float(y));
+ mouse_at_world = Vector3f(x - (state.get_width()/2 - state.get_pos().x),
y - (state.get_height()/2 - state.get_pos().y));
if (current_action == HIGHLIGHTING)
@@ -167,7 +167,7 @@
for (unsigned i = 0; i < current_objs.size(); i++)
{
- Vector orig_pos(current_objs[i]->get_orig_pos());
+ Vector3f orig_pos(current_objs[i]->get_orig_pos());
float x_offset = mouse_at_world.x - drag_start_pos.x;
float y_offset = mouse_at_world.y - drag_start_pos.y;
if (snap_to)
@@ -181,7 +181,7 @@
new_x = x_offset + orig_pos.x;
new_y = y_offset + orig_pos.y;
}
- current_objs[i]->set_pos(Vector(new_x, new_y,
orig_pos.z));
+ current_objs[i]->set_pos(Vector3f(new_x, new_y,
orig_pos.z));
}
}
}
@@ -203,10 +203,10 @@
if (current_action == HIGHLIGHTING)
gc.draw_rect((float)highlighted_area.left,
(float)highlighted_area.top,
(float)highlighted_area.right,
(float)highlighted_area.bottom,
- CL_Color(255,255,255,150));
+ Color(255,255,255,150));
state.pop(*scene_context);
- gc.draw(new SceneContextDrawingRequest(scene_context, CL_Vector(0, 0,
-5000)));
+ gc.draw(new SceneContextDrawingRequest(scene_context, Vector3f(0, 0,
-5000)));
}
// Returns true if the viewport is at the x,y coordinate
@@ -229,13 +229,13 @@
if (autoscroll)
{
if (mouse_at.x < autoscroll_border)
- state.set_pos(state.get_pos() - CL_Pointf(5,
0));
- else if ((float)CL_Display::get_width() - mouse_at.x <
autoscroll_border)
- state.set_pos(state.get_pos() + CL_Pointf(5,
0));
+ state.set_pos(state.get_pos() - Vector2f(5, 0));
+ else if ((float)Display::get_width() - mouse_at.x <
autoscroll_border)
+ state.set_pos(state.get_pos() + Vector2f(5, 0));
else if (mouse_at.y < autoscroll_border)
- state.set_pos(state.get_pos() - CL_Pointf(0,
5));
- else if ((float)CL_Display::get_height() - mouse_at.y <
autoscroll_border)
- state.set_pos(state.get_pos() + CL_Pointf(0,
5));
+ state.set_pos(state.get_pos() - Vector2f(0, 5));
+ else if ((float)Display::get_height() - mouse_at.y <
autoscroll_border)
+ state.set_pos(state.get_pos() + Vector2f(0, 5));
}
}
}
@@ -279,6 +279,5 @@
}
} // Editor namespace
-} // Pingus namespace
/* EOF */
Modified: branches/pingus_sdl/src/editor/editor_viewport.hxx
===================================================================
--- branches/pingus_sdl/src/editor/editor_viewport.hxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/editor_viewport.hxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -26,7 +26,7 @@
#include <string>
- class Vector;
+ class Vector3f;
class DrawingContext;
class SceneContext;
@@ -92,13 +92,13 @@
bool autoscroll;
/** Where the mouse is right now - used for autoscrolling */
- Vector mouse_at;
+ Vector3f mouse_at;
/** Where the mouse is at in relation to the world/level */
- Vector mouse_at_world;
+ Vector3f mouse_at_world;
/** Where the mouse started dragging from */
- Vector drag_start_pos;
+ Vector3f drag_start_pos;
/** All objects in the level */
std::vector<LevelObj*> objs;
@@ -107,7 +107,7 @@
std::vector<LevelObj*> current_objs;
/** The region that is currently highlighted */
- CL_Rect highlighted_area;
+ Rect highlighted_area;
/** Returns the topmost object at this x, y location */
LevelObj* object_at(int x, int y);
@@ -128,7 +128,6 @@
};
} // Editor namespace
-} // Pingus namespace
#endif
Modified: branches/pingus_sdl/src/editor/level_head.cxx
===================================================================
--- branches/pingus_sdl/src/editor/level_head.cxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/level_head.cxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -17,18 +17,18 @@
// 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 "../display/drawing_context.hxx"
#include "../gui/gui_manager.hxx"
#include "../gui/surface_button.hxx"
#include "../gui/input_box.hxx"
#include "../sound/sound.hxx"
#include "../resource.hxx"
-#include "../vector.hxx"
+#include "../math/vector3f.hpp"
#include "../fonts.hxx"
#include "../gettext.h"
#include "level_head.hxx"
#include "level_impl.hxx"
+#include "../gui/display.hxx"
#include "panel_buttons.hxx"
#include "editor_panel.hxx"
#include "editor_screen.hxx"
@@ -44,8 +44,8 @@
public:
LevelHeadCloseButton(LevelHead* h)
- : GUI::SurfaceButton(CL_Display::get_width() -100,
- CL_Display::get_height() -100,
+ : GUI::SurfaceButton(Display::get_width() -100,
+ Display::get_height() -100,
ResDescriptor("core/menu/exit_button_normal"),
ResDescriptor("core/menu/exit_button_pressed"),
ResDescriptor("core/menu/exit_button_hover")),
@@ -56,8 +56,8 @@
void draw (DrawingContext& gc) {
SurfaceButton::draw(gc);
- gc.print_right(Fonts::chalk_large, (float)CL_Display::get_width() -
150,
- (float)CL_Display::get_height() - 100, label);
+ gc.print_right(Fonts::chalk_large, (float)Display::get_width() - 150,
+ (float)Display::get_height() - 100, label);
}
void on_click()
@@ -76,14 +76,14 @@
head_button(pbh),
impl(p->get_screen()->get_level()->get_level_impl()),
gui_manager(p->get_screen()->get_gui_manager()),
- pos(Vector(50, 75))
+ pos(Vector3f(50, 75))
{
gui_manager->add((GUI::Component*)this);
// Create GUI items
- name = new GUI::InputBox(400, Vector(pos.x + 175, pos.y + 10),
+ name = new GUI::InputBox(400, Vector3f(pos.x + 175, pos.y + 10),
impl->levelname, false, "Level Name");
- desc = new GUI::InputBox(500, Vector(pos.x + 175, pos.y + 60),
+ desc = new GUI::InputBox(500, Vector3f(pos.x + 175, pos.y + 60),
impl->description, false, "Level Description");
// Add GUI Items to the GUIManager
@@ -108,18 +108,18 @@
LevelHead::draw(DrawingContext& gc)
{
// Draw the background for window
- gc.draw_fillrect(pos.x, pos.y, (float)CL_Display::get_width() - 50,
- (float)CL_Display::get_height()-50,
CL_Color(100,150,50,150));
+ gc.draw_fillrect(pos.x, pos.y, (float)Display::get_width() - 50,
+ (float)Display::get_height()-50, Color(100,150,50,150));
// Draw the window border
- gc.draw_rect(pos.x, pos.y, (float)CL_Display::get_width() - 50,
- (float)CL_Display::get_height()-50, CL_Color::white);
+ gc.draw_rect(pos.x, pos.y, (float)Display::get_width() - 50,
+ (float)Display::get_height()-50, Color(255,255,255));
}
bool
LevelHead::is_at(int x, int y)
{
- return (x > pos.x && y > pos.y && x < CL_Display::get_width()-50 &&
- y < CL_Display::get_height()-50);
+ return (x > pos.x && y > pos.y && x < Display::get_width()-50 &&
+ y < Display::get_height()-50);
}
void
@@ -133,6 +133,5 @@
} // Editor
-} // Pingus
/* EOF */
Modified: branches/pingus_sdl/src/editor/level_head.hxx
===================================================================
--- branches/pingus_sdl/src/editor/level_head.hxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/level_head.hxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -23,7 +23,7 @@
#include "../gui/component.hxx"
- class Vector;
+ class Vector3f;
namespace GUI {
class GUIManager;
@@ -51,7 +51,7 @@
GUI::GUIManager* gui_manager;
/** Where this box is drawn*/
- Vector pos;
+ Vector3f pos;
// Input boxes for each item of the level impl
GUI::InputBox* name;
@@ -72,7 +72,6 @@
};
} // Editor namespace
-} // Pingus namespace
#endif
Modified: branches/pingus_sdl/src/editor/level_impl.hxx
===================================================================
--- branches/pingus_sdl/src/editor/level_impl.hxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/level_impl.hxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -20,9 +20,6 @@
#ifndef HEADER_PINGUS_EDITOR_LEVEL_IMPL_HXX
#define HEADER_PINGUS_EDITOR_LEVEL_IMPL_HXX
-#include <ClanLib/Core/System/sharedptr.h>
-#include <ClanLib/Core/Math/size.h>
-#include <ClanLib/Display/color.h>
#include <map>
#include <string>
#include <vector>
@@ -42,8 +39,8 @@
public:
// Set defaults in constructor
LevelImpl()
- : ambient_light(CL_Colorf(1.0f, 1.0f, 1.0f, 1.0f)),
- music("none")
+ : ambient_light(255, 255, 255),
+ music("none")
{
// Do nothing
}
@@ -61,8 +58,8 @@
std::string levelname;
std::string description;
- CL_Colorf ambient_light;
- CL_Size size;
+ Color ambient_light;
+ Size size;
int number_of_pingus;
int number_to_save;
@@ -90,7 +87,6 @@
}; // LevelImpl class
} // Editor namespace
-} // Pingus namespace
#endif
Modified: branches/pingus_sdl/src/editor/level_objs.cxx
===================================================================
--- branches/pingus_sdl/src/editor/level_objs.cxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/level_objs.cxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -19,12 +19,12 @@
#include <string>
#include <iostream>
-#include <ClanLib/Display/sprite.h>
#include "level_objs.hxx"
#include "level_impl.hxx"
#include "../blitter.hxx"
#include "../resource.hxx"
#include "../res_descriptor.hxx"
+#include "../gui/display.hxx"
#include "../display/drawing_context.hxx"
#include "../xml_file_writer.hxx"
@@ -34,8 +34,8 @@
// Default constructor
LevelObj::LevelObj(std::string obj_name, LevelImpl* level_) :
level(level_),
- pos(Vector(0,0,0)),
- translated_pos(Vector(0,0,0)),
+ pos(Vector3f(0,0,0)),
+ translated_pos(Vector3f(0,0,0)),
section_name(obj_name),
speed(0),
parallax(0.0),
@@ -75,18 +75,18 @@
if (selected)
gc.draw_rect(translated_pos.x, translated_pos.y,
translated_pos.x
+ sprite.get_width(), translated_pos.y +
sprite.get_height(),
- CL_Color(255,255,255,150), 5000);
+ Color(255,255,255,150), 5000);
if (attribs & HAS_WIDTH)
{
for(int x = static_cast<int>(pos.x); x < pos.x + width;
x += sprite.get_width())
- gc.draw(sprite, Vector(static_cast<float>(x),
pos.y, pos.z));
+ gc.draw(sprite, Vector3f(static_cast<float>(x),
pos.y, pos.z));
}
else if(attribs & HAS_STRETCH)
{
// Surface Background - tile it
for (int x = 0; x < level->size.width; x +=
sprite.get_width())
for (int y = 0; y < level->size.height; y +=
sprite.get_height())
- gc.draw(sprite, Vector((float)x,
(float)y, pos.z));
+ gc.draw(sprite, Vector3f((float)x,
(float)y, pos.z));
}
else
gc.draw(sprite, pos);
@@ -129,10 +129,10 @@
if (attribs & HAS_SURFACE)
{
sprite = Resource::load_sprite(desc);
- int x, y;
- sprite.get_alignment(origin, x, y);
+ ////int x, y;
+ ////sprite.get_alignment(origin, x, y);
- CL_PixelBuffer pb;
+ PixelBuffer pb;
// Apply modifier, then change the sprite loaded for this
object in memory.
if (stretch_x || stretch_y)
@@ -144,19 +144,19 @@
if (stretch_x && !stretch_y)
{
if (keep_aspect)
- h = h * CL_Display::get_width() / w;
- w = (float)CL_Display::get_width();
+ h = h * Display::get_width() / w;
+ w = (float)Display::get_width();
}
else if (stretch_y && !stretch_x)
{
if (keep_aspect)
- w = w * CL_Display::get_height() / h;
- h = (float)CL_Display::get_height();
+ w = w * Display::get_height() / h;
+ h = (float)Display::get_height();
}
else
{
- w = (float)CL_Display::get_width();
- h = (float)CL_Display::get_height();
+ w = (float)Display::get_width();
+ h = (float)Display::get_height();
}
//FIXME: Sat Jan 13 10:26:15 2007
@@ -167,12 +167,13 @@
}
else // No stretch involved
pb = Resource::load_pixelbuffer(desc);
-
- CL_SpriteDescription sprite_desc;
+#if 0
+ SpriteDescription sprite_desc;
sprite_desc.add_frame(pb);
- sprite = CL_Sprite(sprite_desc);
+ sprite = Sprite(sprite_desc);
sprite.set_alignment(origin, x, y);
+#endif
}
set_translated_pos();
}
@@ -221,7 +222,7 @@
if (attribs & HAS_RELEASE_RATE)
xml.write_int("release-rate", release_rate);
if (attribs & HAS_COLOR)
- xml.write_color("color", color);
+ ////xml.write_color("color", color);
if (attribs & HAS_STRETCH)
{
xml.write_bool("stretch-x", stretch_x);
@@ -242,8 +243,8 @@
// Writes any extra properties that may be necessary (virtual
function)
write_extra_properties(xml);
- // Write the Vector position - all objects have this
- xml.write_vector("position", pos);
+ // Write the Vector3f position - all objects have this
+ ////xml.write_vector("position", pos);
xml.end_section(); // object's section_name
}
@@ -270,12 +271,12 @@
translated_pos = pos;
- CL_Origin orig;
- int x, y;
+ Origin orig = origin_top_left;
+ ////int x, y;
float w = (float)sprite.get_width();
float h = (float)sprite.get_height();
- sprite.get_alignment(orig, x, y);
+ ////sprite.get_alignment(orig, x, y);
switch (orig)
{
case origin_top_left :
@@ -311,13 +312,12 @@
}
void
-LevelObj::set_pos(Vector p)
+LevelObj::set_pos(Vector3f p)
{
pos = p;
set_translated_pos();
}
} // Editor namespace
-} // Pingus namespace
/* EOF */
Modified: branches/pingus_sdl/src/editor/level_objs.hxx
===================================================================
--- branches/pingus_sdl/src/editor/level_objs.hxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/level_objs.hxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -20,8 +20,10 @@
#ifndef HEADER_PINGUS_EDITOR_LEVEL_OBJS_HXX
#define HEADER_PINGUS_EDITOR_LEVEL_OBJS_HXX
-#include <ClanLib/Display/sprite.h>
-#include "../vector.hxx"
+#include "../sprite.hpp"
+#include "../math/color.hpp"
+#include "../math/origin.hpp"
+#include "../math/vector3f.hpp"
#include "../res_descriptor.hxx"
#include <string>
@@ -77,8 +79,8 @@
{
protected:
/** Sprite used to draw this object */
- CL_Sprite sprite;
-
+ Sprite sprite;
+
/** Level to which this object belongs */
LevelImpl* level;
@@ -86,14 +88,14 @@
ResDescriptor desc;
/** Location of this object in the World */
- Vector pos;
+ Vector3f pos;
- /** Only used for display functions - this is the pos Vector adjusted
+ /** Only used for display functions - this is the pos Vector3f adjusted
by the translation origin of the sprite */
- Vector translated_pos;
+ Vector3f translated_pos;
/** Location of this object before moving it around */
- Vector orig_pos;
+ Vector3f orig_pos;
/** Name of the section header for this object (hotspot, groundpiece,
etc.) */
std::string section_name;
@@ -141,10 +143,10 @@
float para_y;
/** Optional color field for certain objects */
- CL_Colorf color;
+ Color color;
/** Optional translation origin of the sprite */
- CL_Origin origin;
+ Origin origin;
/** Number representing which attributes this object possesses */
unsigned attribs;
@@ -170,8 +172,8 @@
/// Retrieve info
public:
/** Retrieve the object's position */
- Vector get_pos() const { return pos; }
- Vector get_orig_pos() const { return orig_pos; }
+ Vector3f get_pos() const { return pos; }
+ Vector3f get_orig_pos() const { return orig_pos; }
/** Retrieve this object's attribute number */
unsigned get_attribs() const { return attribs; }
@@ -201,7 +203,7 @@
int get_width() const { return width; }
/** Retrieve the object's color */
- CL_Colorf get_color() const { return color; }
+ Color get_color() const { return color; }
/** Returns true if the object is stretched in the x direction */
bool get_stretch_x() const { return stretch_x; }
@@ -234,10 +236,10 @@
/// Operations
public:
/** Set the object's position */
- void set_pos(const Vector p);
+ void set_pos(const Vector3f p);
/** Original position of the objects before being dragged around */
- void set_orig_pos(const Vector p) { orig_pos = p; }
+ void set_orig_pos(const Vector3f p) { orig_pos = p; }
/** Set the object's resource name */
void set_res_desc(const ResDescriptor d);
@@ -282,9 +284,8 @@
void set_aspect(const bool a);
/** Set the objects color if applicable */
- void set_color(const CL_Colorf c)
- { color.alpha = c.alpha; color.blue = c.blue;
- color.green = c.green; color.red = c.red; }
+ void set_color(const Color& c)
+ { color = c; }
/** Set the object's parallax scroll multiplier in the x direction */
void set_para_x(const float p) { para_x = p; }
@@ -330,7 +331,6 @@
}; // LevelObj class
} // Editor namespace
-} // Pingus namespace
#endif
Modified: branches/pingus_sdl/src/editor/panel_buttons.cxx
===================================================================
--- branches/pingus_sdl/src/editor/panel_buttons.cxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/panel_buttons.cxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <vector>
-#include <ClanLib/Display/sprite.h>
#include "../gui/combobox.hxx"
#include "../gui/gui_manager.hxx"
#include "../display/scene_context.hxx"
@@ -49,7 +48,7 @@
// Draw the button
void
-PanelButton::draw(Pingus::DrawingContext &gc)
+PanelButton::draw(DrawingContext &gc)
{
if (is_selected)
gc.draw(button_pressed, pos);
@@ -67,7 +66,7 @@
// Set the position of this panelbutton
void
-PanelButton::set_pos(Vector p)
+PanelButton::set_pos(Vector3f p)
{
pos = p;
}
@@ -149,6 +148,7 @@
void
PanelButtonGroundpiece::on_primary_button_click(int x, int y)
{
+#if 0
PanelButton::on_primary_button_click(x, y);
panel->get_combobox(1)->clear();
@@ -165,12 +165,14 @@
groundpieces[i]));
}
panel->get_combobox(1)->set_enabled(true);
+#endif
}
// Populate the other comboboxes with the available resources.
void
PanelButtonGroundpiece::combobox_changed(int i, const std::string &value)
{
+#if 0
std::string section;
if (i == 1)
{
@@ -207,11 +209,12 @@
// 3rd box was selected - add the resource to the current level.
LevelObj* obj = new LevelObj("groundpiece",
panel->get_screen()->get_level()->get_level_impl());
obj->set_res_desc(ResDescriptor(value));
- obj->set_pos(Vector(0, 0, 0));
+ obj->set_pos(Vector3f(0, 0, 0));
// 1st combobox displayed the "type" of resource (solid,
transparent, etc.)
obj->set_type(panel->get_combobox(1)->get_selected_item()->get_displayed_string());
panel->get_screen()->add_object(obj);
}
+#endif
}
PanelButtonHead::PanelButtonHead(EditorPanel *p)
@@ -246,4 +249,3 @@
} // Editor namespace
-} // Pingus namespace
Modified: branches/pingus_sdl/src/editor/panel_buttons.hxx
===================================================================
--- branches/pingus_sdl/src/editor/panel_buttons.hxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/panel_buttons.hxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -20,11 +20,9 @@
#ifndef HEADER_PINGUS_PANEL_BUTTONS_HXX
#define HEADER_PINGUS_PANEL_BUTTONS_HXX
-#include <ClanLib/Display/sprite.h>
#include "../gui/component.hxx"
-#include "../vector.hxx"
+#include "../math/vector3f.hpp"
-
class DrawingContext;
namespace Editor {
@@ -41,13 +39,13 @@
protected:
/** The actual button image */
- CL_Sprite sur;
+ Sprite sur;
/** The button background image when not pressed */
- CL_Sprite button;
+ Sprite button;
/** The button background image while pressed */
- CL_Sprite button_pressed;
+ Sprite button_pressed;
/** The panel to which this button belongs */
EditorPanel* panel;
@@ -56,7 +54,7 @@
std::string tooltip;
/** The location of this button on the screen (set by the EditorPanel)
*/
- Vector pos;
+ Vector3f pos;
/** Is this button currently selected? */
bool is_selected;
@@ -70,11 +68,11 @@
virtual ~PanelButton() { }
/** Set the position of this button on the screen - used by the
EditorPanel
- @param p the x,y,z Vector where this button belongs */
- void set_pos (Vector p);
+ @param p the x,y,z Vector3f where this button belongs */
+ void set_pos (Vector3f p);
- /** Returns the Vector of this button's location */
- Vector get_pos () { return pos; }
+ /** Returns the Vector3f of this button's location */
+ Vector3f get_pos () { return pos; }
/** Returns the width of the sur sprite */
int get_width() { return sur.get_width(); }
@@ -207,7 +205,6 @@
}; // PanelButtonHead class
} // Editor namespace
-} // Pingus namespace
#endif
Modified: branches/pingus_sdl/src/editor/xml_level.cxx
===================================================================
--- branches/pingus_sdl/src/editor/xml_level.cxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/xml_level.cxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -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/color.h>
#include <iostream>
#include <string>
#include <fstream>
@@ -53,7 +52,7 @@
- At least 1 entrance
- At least 1 exit
- At least 1 surface-background
- - Each object should be within valid ranges (pos Vector should be inside the
world)
+ - Each object should be within valid ranges (pos Vector3f should be inside
the world)
-----------
Head section:
- Everything should be filled in and within valid ranges
@@ -70,6 +69,7 @@
// Save the level to a file. Returns true if successful
bool XMLLevel::save_level(const std::string& filename)
{
+#if 0
// Make sure level is valid
if (!is_valid())
return false;
@@ -119,12 +119,14 @@
// Clean up
out_file.close();
+#endif
return true;
}
// Load an existing level from a file
void XMLLevel::load_level(const std::string& filename)
{
+#if 0
if (impl)
delete impl;
impl = new LevelImpl();
@@ -147,8 +149,8 @@
// Temporary objects
unsigned attribs;
- Vector p;
- CL_Colorf tmp_color;
+ Vector3f p;
+ Colorf tmp_color;
ResDescriptor desc;
std::string tmp_str;
int tmp_int;
@@ -243,6 +245,7 @@
// Sort by Z coordinate
impl->sort_objs();
+#endif
}
void
@@ -252,4 +255,3 @@
}
} // Editor namespace
-} // Pingus namespace
Modified: branches/pingus_sdl/src/editor/xml_level.hxx
===================================================================
--- branches/pingus_sdl/src/editor/xml_level.hxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/editor/xml_level.hxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -66,7 +66,6 @@
}; // XMLLevel class
} // Editor namespace
-} // Pingus namespace
#endif
Modified: branches/pingus_sdl/src/file_dialog.cxx
===================================================================
--- branches/pingus_sdl/src/file_dialog.cxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/file_dialog.cxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -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/display.h>
-#include <ClanLib/Core/IOData/directory_scanner.h>
#include "gettext.h"
#include "system.hxx"
#include "pingus_menu_manager.hxx"
@@ -44,8 +42,8 @@
public:
FileDialogOkButton (FileDialog *f, std::string l)
- : GUI::SurfaceButton(CL_Display::get_width()/2 + 170,
- CL_Display::get_height()/2 + 160,
+ : GUI::SurfaceButton(Display::get_width()/2 + 170,
+ Display::get_height()/2 + 160,
ResDescriptor("core/menu/exit_button_normal"),
ResDescriptor("core/menu/exit_button_pressed"),
ResDescriptor("core/menu/exit_button_hover")),
@@ -59,8 +57,8 @@
if (!is_hidden)
{
SurfaceButton::draw(gc);
- gc.print_right(Fonts::chalk_large,
(float)CL_Display::get_width()/2 + 200,
- (float)CL_Display::get_height()/2 +
160, label);
+ gc.print_right(Fonts::chalk_large,
(float)Display::get_width()/2 + 200,
+ (float)Display::get_height()/2 + 160,
label);
}
}
@@ -94,8 +92,8 @@
public:
FileDialogCancelButton (FileDialog* f)
- : GUI::SurfaceButton(CL_Display::get_width()/2 - 280,
- CL_Display::get_height()/2 + 160,
+ : GUI::SurfaceButton(Display::get_width()/2 - 280,
+ Display::get_height()/2 + 160,
ResDescriptor("core/menu/exit_button_normal"),
ResDescriptor("core/menu/exit_button_pressed"),
ResDescriptor("core/menu/exit_button_hover")),
@@ -105,8 +103,8 @@
void draw (DrawingContext& gc) {
SurfaceButton::draw(gc);
- gc.print_right(Fonts::chalk_large,
(float)CL_Display::get_width()/2 - 200,
- (float)CL_Display::get_height()/2 + 160,
_("Cancel"));
+ gc.print_right(Fonts::chalk_large,
(float)Display::get_width()/2 - 200,
+ (float)Display::get_height()/2 + 160,
_("Cancel"));
}
void on_click()
@@ -129,10 +127,10 @@
FileDialog* file_dialog;
/** Where the image is located */
- Vector pos;
+ Vector3f pos;
/** Image used for the scroll button */
- CL_Sprite sprite;
+ Sprite sprite;
/** 0 for Up, 1 for Down */
int direction;
@@ -145,8 +143,8 @@
public:
FileDialogScrollButton (FileDialog* f, int d, int height_offset)
: file_dialog(f),
- pos(Vector((float)CL_Display::get_width()/2 +
210,
- (float)CL_Display::get_height()/2 +
height_offset)),
+ pos(Vector3f((float)Display::get_width()/2 +
210,
+ (float)Display::get_height()/2 +
height_offset)),
direction(d),
is_hidden(false),
hover(false)
@@ -192,18 +190,18 @@
FileDialog* file_dialog;
/** Where the image is located */
- Vector pos;
+ Vector3f pos;
/** Image used for the parent folder button */
- CL_Sprite sprite;
+ Sprite sprite;
bool hover;
public:
FileDialogParentFolderButton (FileDialog* f)
: file_dialog(f),
- pos(Vector((float)CL_Display::get_width()/2 + 230,
- (float)CL_Display::get_height()/2 - 210)),
+ pos(Vector3f((float)Display::get_width()/2 + 230,
+ (float)Display::get_height()/2 - 210)),
sprite(Resource::load_sprite("core/menu/parent_folder")),
hover(false)
{
@@ -259,29 +257,29 @@
// FIXME: Ugly - hardcoded values for items in file dialog.
Should be dynamic.
// Create 8 FileDialogItems and add them to the gui_manager.
- float center_x = (float)CL_Display::get_width()/2;
- float center_y = (float)CL_Display::get_height()/2;
+ float center_x = (float)Display::get_width()/2;
+ float center_y = (float)Display::get_height()/2;
- inputbox = new GUI::InputBox(450, Vector(center_x - 225,
+ inputbox = new GUI::InputBox(450, Vector3f(center_x - 225,
center_y - 170), "", for_loading);
gui_manager->add((GUI::Component*)inputbox);
file_dialog_items.push_back(new FileDialogItem(this,
- Vector(center_x - 280, center_y - 140)));
+ Vector3f(center_x - 280, center_y - 140)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector(center_x - 280, center_y - 70)));
+ Vector3f(center_x - 280, center_y - 70)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector(center_x - 280, center_y + 10)));
+ Vector3f(center_x - 280, center_y + 10)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector(center_x - 280, center_y + 80)));
+ Vector3f(center_x - 280, center_y + 80)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector(center_x - 10, center_y - 140)));
+ Vector3f(center_x - 10, center_y - 140)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector(center_x - 10, center_y - 70)));
+ Vector3f(center_x - 10, center_y - 70)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector(center_x - 10, center_y + 10)));
+ Vector3f(center_x - 10, center_y + 10)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector(center_x - 10, center_y + 80)));
+ Vector3f(center_x - 10, center_y + 80)));
for (std::vector<FileDialogItem*>::const_iterator i =
file_dialog_items.begin();
i != file_dialog_items.end(); i++)
@@ -297,10 +295,10 @@
bool
FileDialog::draw (DrawingContext& gc)
{
- gc.draw(sprite, Vector(gc.get_width ()/2 - sprite.get_width
()/2,
+ gc.draw(sprite, Vector3f(gc.get_width ()/2 - sprite.get_width
()/2,
gc.get_height ()/2 - sprite.get_height ()/2));
gc.draw_rect(gc.get_width() / 2 - 285, gc.get_height() / 2 -
160,
- gc.get_width() / 2 + 285, gc.get_height() / 2 + 160,
Color::black);
+ gc.get_width() / 2 + 285, gc.get_height() / 2 +
160, Color(0,0,0));
gc.print_center(Fonts::chalk_large, gc.get_width()/2,
gc.get_height()/2 - 220,
current_file.friendly_name == "" ? current_file.name :
current_file.friendly_name);
@@ -324,6 +322,7 @@
FileItem f;
// Get the list of files and folders in the current folder
+#if 0
CL_DirectoryScanner scanner;
scanner.scan(current_path, "*");
while (scanner.next())
@@ -346,7 +345,7 @@
}
std::sort(file_list.begin(), file_list.end(), &FileItemCompare);
-
+#endif
current_offset = 0;
offset_changed();
}
Modified: branches/pingus_sdl/src/file_dialog_item.cxx
===================================================================
--- branches/pingus_sdl/src/file_dialog_item.cxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/file_dialog_item.cxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -17,14 +17,10 @@
// 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/sprite.h>
-#include <ClanLib/Core/IOData/directory_scanner.h>
-#include <ClanLib/Core/IOData/inputsource_provider_file.h>
-#include <ClanLib/Core/System/clanstring.h>
#include "pingus_error.hxx"
#include "file_dialog_item.hxx"
#include "file_dialog.hxx"
-#include "vector.hxx"
+#include "math/vector3f.hpp"
#include "fonts.hxx"
#include "resource.hxx"
#include "gettext.h"
@@ -35,7 +31,7 @@
#include "worldmap/metamap.hxx"
// Only Constructor
- FileDialogItem::FileDialogItem(FileDialog* f, Vector p)
+ FileDialogItem::FileDialogItem(FileDialog* f, Vector3f p)
: mouse_over(false),
is_hidden(true),
file_dialog(f),
@@ -58,6 +54,7 @@
}
else
{
+#if 0
// FIXME: Load thumbnail specific to this level
sprite =
Resource::load_sprite("core/menu/default_level");
@@ -135,6 +132,7 @@
} // if XML Node == "head"
} // for loop
} // if XML tag_name was recognized
+#endif
} // else it's a file, not a directory
} //set_file()
@@ -171,11 +169,11 @@
Color color;
if (file_item.is_accessible)
if (file_item.is_finished)
- color = Color::azure;
+ color =
Color(123,123,0);////Color::azure;
else
- color = Color::aqua;
+ color = Color(123,0,222);
////Color::aqua;
else
- color = Color::red;
+ color = Color(255,0,0);
gc.draw_fillrect(pos.x+50, pos.y,
pos.x+270, pos.y+75, color);
// Draw level or worldmap information.
@@ -209,6 +207,5 @@
else
return file_item.name.substr(0, file_item.name.size() -
file_dialog->get_file_mask().size());
}
-}
/* EOF */
Modified: branches/pingus_sdl/src/file_dialog_item.hxx
===================================================================
--- branches/pingus_sdl/src/file_dialog_item.hxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/file_dialog_item.hxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -20,9 +20,9 @@
#ifndef HEADER_PINGUS_FILE_DIALOG_ITEM_HXX
#define HEADER_PINGUS_FILE_DIALOG_ITEM_HXX
-#include <ClanLib/Display/sprite.h>
#include "gui/component.hxx"
-#include "vector.hxx"
+#include "math/vector3f.hpp"
+#include "sprite.hpp"
#include "file_dialog.hxx"
@@ -39,17 +39,17 @@
std::string status;
FileDialog* file_dialog;
- Vector pos;
+ Vector3f pos;
/** This file_item name will change based on the current file list */
FileItem file_item;
/** This sprite will change based on the currently displayed file */
- CL_Sprite sprite;
+ Sprite sprite;
public:
// Only Constructor
- FileDialogItem(FileDialog* f, Vector p) ;
+ FileDialogItem(FileDialog* f, Vector3f p) ;
/** Set the current file assigned to this button */
void set_file(FileItem f);
@@ -77,8 +77,6 @@
FileDialogItem& operator= (const FileDialogItem&);
}; // FileDialogItem class
-} // Pingus namespace
-
#endif
/* EOF */
Modified: branches/pingus_sdl/src/font.hpp
===================================================================
--- branches/pingus_sdl/src/font.hpp 2007-01-16 02:40:45 UTC (rev 2666)
+++ branches/pingus_sdl/src/font.hpp 2007-01-16 03:31:58 UTC (rev 2667)
@@ -30,6 +30,7 @@
#include "SDL.h"
#include "math/origin.hpp"
#include "math/rect.hpp"
+#include "math/size.hpp"
/** */
class Font
@@ -40,6 +41,8 @@
void draw(int, int, const std::string& text, SDL_Surface* target = 0) {}
void set_alignment(Origin origin) {}
int get_height() { return 0; }
+ int get_width(char) { return 0; }
+ Size get_size(const std::string& str) { return Size(0,0);}
Rect bounding_rect(int , int, const std::string& str) const;
};
Deleted: branches/pingus_sdl/src/game_counter.cxx
===================================================================
--- branches/pingus_sdl/src/game_counter.cxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/game_counter.cxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -1,156 +0,0 @@
-// $Id: game_counter.cxx,v 1.4 2003/10/18 23:17:27 grumbel Exp $
-//
-// Pingus - A free Lemmings clone
-// Copyright (C) 1999 Ingo Ruhnke <address@hidden>
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-#include <iostream>
-
-#include "game_counter.hxx"
-
-
-GameCounter::GameCounter()
-{
- count = 0;
- add = 0;
- size = 0;
- type = loop;
- is_finished = false;
-}
-
-GameCounter::~GameCounter()
-{
-
-}
-
-void
-GameCounter:: set_speed(double i)
-{
- add = i;
-}
-
-bool
-GameCounter::finished(void)
-{
- return is_finished;
-}
-
-void
-GameCounter::set_type(CounterType t)
-{
- type = t;
-}
-
-void
-GameCounter::check_overflow(void)
-{
- if (int(count) >= int(size)) {
- switch(type) {
- case (CounterType)loop:
- count -= size;
- break;
- case (CounterType)ping_pong:
- add = -add;
- count += add;
- break;
- case (CounterType)once:
- count = size - 1;
- is_finished = true;
- break;
- default:
- std::cout << "GameCounter: Bug" << std::endl;
- }
- } else if (count < 0) {
- switch(type) {
- case (CounterType)ping_pong:
- case (CounterType)loop:
- add = -add;
- count += add;
- break;
- case (CounterType)once:
- count = 0;
- break;
- }
- }
-
- if ((count >= size || count < 0) && !(count == 0 && size == 0))
- {
- std::cout << "GameCounter: Something is wrong..." << std::endl;
- std::cout << "GameCounter: Size: " << size << std::endl;
- std::cout << "GameCounter: Count: " << count << std::endl;
- }
-}
-
-int
-GameCounter::get_size()
-{
- return (int)size;
-}
-
-void
-GameCounter::set_size(int i)
-{
- size = double(i);
- is_finished = false;
-}
-
-int
-GameCounter::operator++()
-{
- count += add;
- check_overflow();
- return int(count);
-}
-
-int
-GameCounter::operator++(int)
-{
- int tmp_count = (int)count;
-
- count += add;
- check_overflow();
-
- return tmp_count;
-}
-
-
-int GameCounter::operator--()
-{
- count -= add;
- check_overflow();
- return int(count);
-}
-
-int
-GameCounter::operator=(int i)
-{
- is_finished = false;
- return int(count = double(i));
-}
-
-int
-GameCounter::value(void)
-{
- return int(count);
-}
-
-GameCounter::operator int(void)
-{
- return int(count);
-}
-
-
-/* EOF */
Deleted: branches/pingus_sdl/src/game_counter.hxx
===================================================================
--- branches/pingus_sdl/src/game_counter.hxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/game_counter.hxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -1,60 +0,0 @@
-// $Id: game_counter.hxx,v 1.8 2003/10/18 23:17:27 grumbel Exp $
-//
-// Pingus - A free Lemmings clone
-// Copyright (C) 1999 Ingo Ruhnke <address@hidden>
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-#ifndef HEADER_PINGUS_GAME_COUNTER_HXX
-#define HEADER_PINGUS_GAME_COUNTER_HXX
-
-#include "pingus.hxx"
-
-
-class GameCounter
-{
-public:
- enum CounterType { loop, once, ping_pong };
-private:
- int last_time;
- double count;
- double add;
- double size;
- bool is_finished;
- CounterType type;
-
- void check_overflow (void);
-public:
- GameCounter ();
- ~GameCounter ();
-
- void set_type (CounterType t);
- void set_size (int);
- int get_size ();
- bool finished ();
- void set_speed (double i);
- int value ();
- bool enough_time_passed ();
- int operator++ ();
- int operator++ (int);
- int operator-- ();
- int operator= (int i);
- operator int ();
-};
-
-
-#endif
-
-/* EOF */
Modified: branches/pingus_sdl/src/gui/buffer_graphic_context.cxx
===================================================================
--- branches/pingus_sdl/src/gui/buffer_graphic_context.cxx 2007-01-16
02:40:45 UTC (rev 2666)
+++ branches/pingus_sdl/src/gui/buffer_graphic_context.cxx 2007-01-16
03:31:58 UTC (rev 2667)
@@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <iostream>
-#include <ClanLib/display.h>
#include "../pingus_error.hxx"
#include "../blitter.hxx"
#include "../screenshot.hxx"
@@ -50,12 +49,12 @@
}
void
-BufferGraphicContext::draw(CL_Sprite, const Pingus::Vector&)
+BufferGraphicContext::draw(CL_Sprite, const Vector3f&)
{
}
void
-BufferGraphicContext::draw(CL_Sprite, const Pingus::Vector&, int)
+BufferGraphicContext::draw(CL_Sprite, const Vector3f&, int)
{
}
Modified: branches/pingus_sdl/src/gui/buffer_graphic_context.hxx
===================================================================
--- branches/pingus_sdl/src/gui/buffer_graphic_context.hxx 2007-01-16
02:40:45 UTC (rev 2666)
+++ branches/pingus_sdl/src/gui/buffer_graphic_context.hxx 2007-01-16
03:31:58 UTC (rev 2667)
@@ -22,9 +22,6 @@
#include <string>
#include "../vector.hxx"
-#include <ClanLib/Core/Math/rect.h>
-#include <ClanLib/Display/pixel_buffer.h>
-#include <ClanLib/Display/font.h>
#include "graphic_context.hxx"
class CL_Surface;
@@ -65,8 +62,8 @@
void clear (float r, float g, float b);
- void draw(CL_Sprite, const Pingus::Vector&);
- void draw(CL_Sprite, const Pingus::Vector&, int);
+ void draw(CL_Sprite, const Vector3f&);
+ void draw(CL_Sprite, const Vector3f&, int);
void draw (CL_Surface sur, int x_pos, int y_pos);
void draw (CL_Surface sur, int x_pos, int y_pos, int frame);
Modified: branches/pingus_sdl/src/gui/checkbox.cxx
===================================================================
--- branches/pingus_sdl/src/gui/checkbox.cxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/gui/checkbox.cxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -17,10 +17,9 @@
// 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/sprite.h>
#include "checkbox.hxx"
#include "../fonts.hxx"
-#include "../vector.hxx"
+#include "../math/vector3f.hpp"
#include "../resource.hxx"
#include "../display/drawing_context.hxx"
#include "../gui/checkbox_listener.hxx"
@@ -28,7 +27,7 @@
namespace GUI {
-Checkbox::Checkbox(Vector p, std::string label_, CheckboxListener* l) :
+Checkbox::Checkbox(Vector3f p, std::string label_, CheckboxListener* l) :
checkmark(Resource::load_sprite("core/misc/checkbox_clicked")),
is_checked(false),
pos(p),
@@ -43,7 +42,7 @@
Checkbox::draw(DrawingContext& gc)
{
gc.draw_rect(pos.x, pos.y, pos.x + width, pos.y + height,
- CL_Color::black);
+ Color(0,0,0));
if (is_checked)
gc.draw(checkmark, pos);
@@ -65,6 +64,5 @@
}
} // GUI namespace
-} // Pingus namespace
/* EOF */
Modified: branches/pingus_sdl/src/gui/checkbox.hxx
===================================================================
--- branches/pingus_sdl/src/gui/checkbox.hxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/gui/checkbox.hxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -21,9 +21,9 @@
#define HEADER_PINGUS_GUI_CHECKBOX_HXX
#include "../gui/component.hxx"
-#include "../vector.hxx"
+#include "../math/vector3f.hpp"
+#include "../sprite.hpp"
-
class DrawingContext;
namespace GUI {
@@ -33,11 +33,11 @@
class Checkbox : public GUI::Component
{
private:
- CL_Sprite box;
- CL_Sprite checkmark;
+ Sprite box;
+ Sprite checkmark;
bool is_checked;
- Vector pos;
+ Vector3f pos;
float width;
float height;
@@ -46,7 +46,7 @@
std::string label;
public:
- Checkbox(Vector p, std::string label_, CheckboxListener* l);
+ Checkbox(Vector3f p, std::string label_, CheckboxListener* l);
void draw(DrawingContext& gc);
bool is_at(int x, int y);
@@ -58,7 +58,6 @@
}; // Checkbox class
} // GUI namespace
-} // Pingus namespace
#endif
Modified: branches/pingus_sdl/src/gui/checkbox_listener.hxx
===================================================================
--- branches/pingus_sdl/src/gui/checkbox_listener.hxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/gui/checkbox_listener.hxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -32,7 +32,6 @@
}; // CheckboxListener class
} // GUI namespace
-} // Pingus namespace
#endif
Modified: branches/pingus_sdl/src/gui/combobox.cxx
===================================================================
--- branches/pingus_sdl/src/gui/combobox.cxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/gui/combobox.cxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -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/font.h>
#include <vector>
#include <string>
#include "combobox.hxx"
@@ -27,7 +26,7 @@
namespace GUI {
// Constructor
-Combobox::Combobox (Vector p, ComboboxListener* listener_, std::string l) :
+Combobox::Combobox (Vector3f p, ComboboxListener* listener_, std::string l) :
current_item(0),
drop_down(false),
hover(false),
@@ -145,18 +144,18 @@
// Draw the rectangle
gc.draw_fillrect(pos.x, pos.y, pos.x + get_width(), pos.y +
get_height(),
- CL_Color::white);
+ Color(255,255,255));
// Next, draw the rectangle border
gc.draw_rect(pos.x, pos.y, pos.x + get_width(), pos.y + get_height(),
- CL_Color::black);
+ Color(0,0,0));
if (drop_down && item_list.size() > 0)
{
// Draw the highlighted box
int y_offset = int(int(((mouse_pos.y - pos.y -
height)/height)+1) * height);
gc.draw_fillrect(pos.x, pos.y + y_offset, pos.x + get_width(),
pos.y + y_offset +
- height, CL_Color::gray);
+ height, Color(128,128,128));
// Draw all of the items
for (unsigned i = 0; i < item_list.size(); i++)
@@ -174,6 +173,5 @@
}
} // GUI namespace
-} // Pingus namespace
/* EOF */
Modified: branches/pingus_sdl/src/gui/combobox.hxx
===================================================================
--- branches/pingus_sdl/src/gui/combobox.hxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/gui/combobox.hxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -23,7 +23,7 @@
#include <vector>
#include <string>
#include "component.hxx"
-#include "../vector.hxx"
+#include "../math/vector3f.hpp"
namespace GUI {
@@ -92,7 +92,7 @@
bool hover;
/** Where the mouse is located */
- Vector mouse_pos;
+ Vector3f mouse_pos;
/** Width of the Combobox */
float width;
@@ -104,7 +104,7 @@
float height;
/** Location of the Combobox */
- Vector pos;
+ Vector3f pos;
/** Whether or not this combobox is enabled */
bool enabled;
@@ -117,7 +117,7 @@
public:
/** Constructor */
- Combobox (Vector p, ComboboxListener* listener, std::string label =
std::string());
+ Combobox (Vector3f p, ComboboxListener* listener, std::string label =
std::string());
/** Destructor */
virtual ~Combobox ();
@@ -159,7 +159,7 @@
virtual void on_pointer_enter() { hover = true; }
virtual void on_pointer_leave() { hover = false; }
- virtual void on_pointer_move(int x, int y) { mouse_pos =
Vector((float)x, (float)y); }
+ virtual void on_pointer_move(int x, int y) { mouse_pos =
Vector3f((float)x, (float)y); }
/** Sets whether or not this combobox is clickable */
virtual void set_enabled(bool e) { enabled = e; }
@@ -178,7 +178,6 @@
}; // Combobox class
} // GUI namespace
-} // Pingus namespace
#endif
Modified: branches/pingus_sdl/src/gui/combobox_listener.hxx
===================================================================
--- branches/pingus_sdl/src/gui/combobox_listener.hxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/gui/combobox_listener.hxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -32,7 +32,6 @@
}; // ComboboxListener class
} // GUI namespace
-} // Pingus namespace
#endif
Modified: branches/pingus_sdl/src/gui/cursor.cxx
===================================================================
--- branches/pingus_sdl/src/gui/cursor.cxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/gui/cursor.cxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -41,7 +41,7 @@
void
Cursor::on_event()
{
- const Input::Pointer* pointer =
Input::Controller::get_current()->get_pointer();
+ ////const Input::Pointer* pointer =
Input::Controller::get_current()->get_pointer();
// sprite.draw(pointer->get_x_pos (),
// pointer->get_y_pos ());
}
Modified: branches/pingus_sdl/src/gui/cursor.hxx
===================================================================
--- branches/pingus_sdl/src/gui/cursor.hxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/gui/cursor.hxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -22,15 +22,15 @@
#include <string>
#include "display.hxx"
+#include "../sprite.hpp"
-
/** A simple mouse cursor class and stupid. We can't use the X11/win32
nativ mouse cursor because we want also to support non-mouse input
devices and because we want to support multiple cursors */
class Cursor : public DisplayHook
{
private:
- ///CL_Sprite sprite;
+ Sprite sprite;
public:
Cursor (const std::string& ident);
Modified: branches/pingus_sdl/src/gui/input_box.cxx
===================================================================
--- branches/pingus_sdl/src/gui/input_box.cxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/gui/input_box.cxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -20,12 +20,12 @@
#include <algorithm>
#include "input_box.hxx"
#include "../display/drawing_context.hxx"
-#include "../vector.hxx"
+#include "../math/vector3f.hpp"
#include "../fonts.hxx"
namespace GUI {
-InputBox::InputBox(float width_, Vector p, const std::string& default_value,
+InputBox::InputBox(float width_, Vector3f p, const std::string& default_value,
bool locked, const std::string& label_)
: str(default_value),
pos(p),
@@ -42,8 +42,8 @@
{
// Draw the rectangle and border
gc.draw_fillrect(pos.x, pos.y, pos.x + width, pos.y + height,
- CL_Color::black);
- gc.draw_rect(pos.x, pos.y, pos.x + width, pos.y + height,
CL_Color::white);
+ Color(0,0,0));
+ gc.draw_rect(pos.x, pos.y, pos.x + width, pos.y + height,
Color(255,255,255));
// If there is text, draw it:
if (str != std::string())
@@ -55,7 +55,7 @@
if (has_focus)
gc.draw_line(pos.x +
Fonts::pingus_small.get_size(shrink_string(str)).width + 12,
pos.y, pos.x +
Fonts::pingus_small.get_size(shrink_string(str)).width + 12,
- pos.y + height, CL_Color::yellow);
+ pos.y + height, Color(0,255,255));
}
bool
@@ -97,6 +97,5 @@
}
} // GUI
-} // Pingus
/* EOF */
Modified: branches/pingus_sdl/src/gui/input_box.hxx
===================================================================
--- branches/pingus_sdl/src/gui/input_box.hxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/gui/input_box.hxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -21,7 +21,7 @@
#define HEADER_PINGUS_GUI_INPUTBOX_HXX
#include "component.hxx"
-#include "../vector.hxx"
+#include "../math/vector3f.hpp"
#include <string>
@@ -33,7 +33,7 @@
class InputBox : public GUI::Component {
protected:
std::string str;
- Vector pos;
+ Vector3f pos;
float width;
float height;
bool is_locked;
@@ -45,7 +45,7 @@
std::string label;
public:
- InputBox(float width_, Vector p, const std::string&
+ InputBox(float width_, Vector3f p, const std::string&
default_value = std::string(), bool locked = false,
const std::string& label_ = std::string());
@@ -64,7 +64,6 @@
}; // InputBox class
} // GUI namespace
-} // Pingus namespace
#endif
Modified: branches/pingus_sdl/src/worldobjs/guillotine.hxx
===================================================================
--- branches/pingus_sdl/src/worldobjs/guillotine.hxx 2007-01-16 02:40:45 UTC
(rev 2666)
+++ branches/pingus_sdl/src/worldobjs/guillotine.hxx 2007-01-16 03:31:58 UTC
(rev 2667)
@@ -20,7 +20,6 @@
#ifndef HEADER_PINGUS_WORLDOBJS_GUILLOTINE_HXX
#define HEADER_PINGUS_WORLDOBJS_GUILLOTINE_HXX
-#include "../game_counter.hxx"
#include "../direction.hxx"
#include "../worldobj.hxx"
Modified: branches/pingus_sdl/src/worldobjs/spike.hxx
===================================================================
--- branches/pingus_sdl/src/worldobjs/spike.hxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/worldobjs/spike.hxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -20,7 +20,6 @@
#ifndef HEADER_PINGUS_TRAPS_SPIKE_HXX
#define HEADER_PINGUS_TRAPS_SPIKE_HXX
-#include "../game_counter.hxx"
#include "../worldobj.hxx"
Modified: branches/pingus_sdl/src/xml_file_reader.hxx
===================================================================
--- branches/pingus_sdl/src/xml_file_reader.hxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/xml_file_reader.hxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -20,6 +20,7 @@
#ifndef HEADER_XML_FILE_READER_HXX
#define HEADER_XML_FILE_READER_HXX
+#if 0
#include <ClanLib/Core/XML/dom_element.h>
#include "file_reader.hxx"
@@ -29,8 +30,9 @@
public:
XMLFileReader(CL_DomElement element);
};
+#endif
-
#endif
+
/* EOF */
Modified: branches/pingus_sdl/src/xml_file_writer.cxx
===================================================================
--- branches/pingus_sdl/src/xml_file_writer.cxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/xml_file_writer.cxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -71,13 +71,13 @@
}
void
-XMLFileWriter::write_color (const char* name, const Colorf& color)
+XMLFileWriter::write_color (const char* name, const Color& color)
{
(*out) << "<" << name << ">\n"
- << " <red>" << color.red << "</red>\n"
- << " <green>" << color.green << "</green>\n"
- << " <blue>" << color.blue << "</blue>\n"
- << " <alpha>" << color.alpha << "</alpha>\n"
+ << " <red>" << int(color.r * 255) << "</red>\n"
+ << " <green>" << int(color.g * 255) << "</green>\n"
+ << " <blue>" << int(color.b * 255) << "</blue>\n"
+ << " <alpha>" << int(color.a * 255) << "</alpha>\n"
<< "</" << name << ">"
<< std::endl;
}
@@ -117,7 +117,7 @@
}
void
-XMLFileWriter::write_vector (const char* name, const Vector& value)
+XMLFileWriter::write_vector (const char* name, const Vector3f& value)
{
(*out) << "<" << name << ">\n"
<< " <x>" << value.x << "</x>\n"
Modified: branches/pingus_sdl/src/xml_file_writer.hxx
===================================================================
--- branches/pingus_sdl/src/xml_file_writer.hxx 2007-01-16 02:40:45 UTC (rev
2666)
+++ branches/pingus_sdl/src/xml_file_writer.hxx 2007-01-16 03:31:58 UTC (rev
2667)
@@ -46,9 +46,9 @@
void write_int (const char* name, int);
void write_float (const char* name, float);
void write_bool (const char* name, bool);
- void write_color (const char* name, const Colorf&);
+ void write_color (const char* name, const Color&);
void write_string (const char* name, const std::string&);
- void write_vector (const char* name, const Vector&);
+ void write_vector (const char* name, const Vector3f&);
template<class E, class F>
void write_enum (const char* name, E value, F enum2string)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2667 - in branches/pingus_sdl/src: . editor gui worldobjs,
grumbel at BerliOS <=