[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2517 - in trunk: . src src/editor src/gui
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r2517 - in trunk: . src src/editor src/gui |
Date: |
Thu, 1 Dec 2005 17:10:12 +0100 |
Author: grumbel
Date: 2005-12-01 17:10:05 +0100 (Thu, 01 Dec 2005)
New Revision: 2517
Added:
trunk/SConstruct
trunk/src/SConscript
Modified:
trunk/src/editor/editor_panel.cxx
trunk/src/editor/editor_panel.hxx
trunk/src/editor/editor_screen.cxx
trunk/src/editor/editor_screen.hxx
trunk/src/editor/editor_viewport.cxx
trunk/src/editor/editor_viewport.hxx
trunk/src/editor/level_impl.hxx
trunk/src/editor/level_objs.cxx
trunk/src/editor/level_objs.hxx
trunk/src/editor/panel_buttons.cxx
trunk/src/editor/panel_buttons.hxx
trunk/src/editor/xml_level.cxx
trunk/src/editor/xml_level.hxx
trunk/src/file_dialog.cxx
trunk/src/file_dialog_item.cxx
trunk/src/file_dialog_item.hxx
trunk/src/file_writer.hxx
trunk/src/global_event.hxx
trunk/src/gui/combobox.cxx
trunk/src/gui/component.hxx
trunk/src/pingu_action_factory.hxx
trunk/src/pingus_main.cxx
trunk/src/spot_map.cxx
trunk/src/theme_selector.hxx
trunk/src/tinygettext.cxx
trunk/src/worldobj_factory.hxx
Log:
- fixed a bunch of compile errors (missing newline at end of file, DOS line
endings, incorrect case in includes, etc.)
Added: trunk/SConstruct
===================================================================
--- trunk/SConstruct 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/SConstruct 2005-12-01 16:10:05 UTC (rev 2517)
@@ -0,0 +1,23 @@
+## -*- python -*-
+## $Id: pingus_main.hxx,v 1.14 2003/10/18 12:11:30 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.
+
+SConscript('src/SConscript')
+
+## EOF ##
Added: trunk/src/SConscript
===================================================================
--- trunk/src/SConscript 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/SConscript 2005-12-01 16:10:05 UTC (rev 2517)
@@ -0,0 +1,275 @@
+## -*- python -*-
+## $Id: pingus_main.hxx,v 1.14 2003/10/18 12:11:30 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.
+
+import os
+
+env = Environment(# ENV = {'PKG_CONFIG_PATH' : os.getenv('PKG_CONFIG_PATH')},
+ CC = 'gcc',
+ CCFLAGS = ['-O2', '-Wall', '-Werror', '-g'])
+
+# env.Copy(LIBS = ['a', 'b'])
+
+# FIXME: Make this configurable
+# env['ENV']['PKG_CONFIG_PATH'] =
'/home/ingo/run/ClanLib-0.8-2005-12-01/lib/pkgconfig/'
+env.ParseConfig('PKG_CONFIG_PATH=/home/ingo/run/ClanLib-0.8-2005-12-01/lib/pkgconfig/
pkg-config --cflags --libs \
+ clanCore-0.8 ">=" 0.8.0 \
+ clanApp-0.8 ">=" 0.8.0 \
+ clanDisplay-0.8 ">=" 0.8.0 \
+ clanGL-0.8 ">=" 0.8.0 \
+ clanSDL-0.8 ">=" 0.8.0 \
+ clanGUI-0.8 ">=" 0.8.0 \
+ clanGUIStyleSilver-0.8 ">=" 0.8.0 \
+ clanSound-0.8 ">=" 0.8.0 \
+ clanVorbis-0.8 ">=" 0.8.0 \
+ clanMikMod-0.8 ">=" 0.8.0')
+
+env.Program('../pingus', [
+'action_button.cxx',
+'action_holder.cxx',
+'actions/angel.cxx',
+'actions/basher.cxx',
+'actions/blocker.cxx',
+'actions/boarder.cxx',
+'actions/bomber.cxx',
+'actions/bridger.cxx',
+'actions/climber.cxx',
+'actions/digger.cxx',
+'actions/drown.cxx',
+'actions/exiter.cxx',
+'actions/faller.cxx',
+'actions/floater.cxx',
+'actions/jumper.cxx',
+'actions/laser_kill.cxx',
+'actions/miner.cxx',
+'actions/rocket_launcher.cxx',
+'actions/slider.cxx',
+'actions/smashed.cxx',
+'actions/splashed.cxx',
+'actions/superman.cxx',
+'actions/teleported.cxx',
+'actions/waiter.cxx',
+'actions/walker.cxx',
+'blitter.cxx',
+'blitter_test.cxx',
+'button_panel.cxx',
+'capture_rectangle.cxx',
+'cheat.cxx',
+'client.cxx',
+'collider.cxx',
+'colliders/pingu_collider.cxx',
+'col_map.cxx',
+'config.cxx',
+'console.cxx',
+'credits.cxx',
+'debug.cxx',
+'debug_stream.cxx',
+'demo_player.cxx',
+'demo_recorder.cxx',
+'demo_session.cxx',
+'direction.cxx',
+'display/drawing_context.cxx',
+'display/scene_context.cxx',
+'editor/editor_panel.cxx',
+'editor/editor_screen.cxx',
+'editor/editor_viewport.cxx',
+'editor/level_objs.cxx',
+'editor/panel_buttons.cxx',
+'editor/xml_level.cxx',
+'exit_menu.cxx',
+'file_dialog.cxx',
+'file_dialog_item.cxx',
+'file_reader.cxx',
+'fonts.cxx',
+'fps_counter.cxx',
+'game_counter.cxx',
+'game_session.cxx',
+'game_session_result.cxx',
+'game_time.cxx',
+'gettext.cxx',
+'global_event.cxx',
+'globals.cxx',
+'goal_manager.cxx',
+'graphic_context_state.cxx',
+'groundtype.cxx',
+# 'gui/buffer_graphic_context.cxx',
+'gui/combobox.cxx',
+'gui/cursor.cxx',
+'gui/display.cxx',
+'gui/gui_manager.cxx',
+'gui/gui_screen.cxx',
+'gui/input_debug_screen.cxx',
+'gui_obj.cxx',
+'gui/root_gui_manager.cxx',
+'gui/screen.cxx',
+'gui/screen_manager.cxx',
+'gui/screen_ptr.cxx',
+'gui/surface_button.cxx',
+'html_browser.cxx',
+'hurry_up.cxx',
+# 'indexed_canvas.cxx',
+'input/axes/button_axis.cxx',
+'input/axes/inverted_axis.cxx',
+'input/axes/joystick_axis.cxx',
+# 'input/axes/mouse_axis.cxx',
+'input/axes/multiple_axis.cxx',
+'input/axis_factory.cxx',
+'input/button_factory.cxx',
+'input/buttons/double_button.cxx',
+'input/buttons/joystick_button.cxx',
+'input/buttons/key_button.cxx',
+'input/buttons/mouse_button.cxx',
+'input/buttons/multiple_button.cxx',
+'input/buttons/triple_button.cxx',
+'input/controller.cxx',
+'input/pointer_factory.cxx',
+'input/pointers/axis_pointer.cxx',
+'input/pointers/mouse_pointer.cxx',
+'input/pointers/multiple_pointer.cxx',
+'input/scroller_factory.cxx',
+'input/scrollers/axis_scroller.cxx',
+'input/scrollers/inverted_scroller.cxx',
+'input/scrollers/joystick_scroller.cxx',
+'input/scrollers/mouse_scroller.cxx',
+'input/scrollers/multiple_scroller.cxx',
+'input/scrollers/pointer_scroller.cxx',
+'layer_manager.cxx',
+# 'level_desc.cxx',
+'level_interrupt.cxx',
+# 'level_result.cxx',
+'loading.cxx',
+'main_menu.cxx',
+'menu_background.cxx',
+'menu_button.cxx',
+'mover.cxx',
+'movers/linear_mover.cxx',
+'multiline_text.cxx',
+'particles/explosive_particle.cxx',
+'particles/ground_particle.cxx',
+'particles/pingu_particle_holder.cxx',
+'particles/rain_particle_holder.cxx',
+'particles/smoke_particle_holder.cxx',
+'particles/snow_particle_holder.cxx',
+'path_manager.cxx',
+'pingu_action.cxx',
+'pingu_action_factory.cxx',
+'pingu.cxx',
+'pingu_enums.cxx',
+'pingu_holder.cxx',
+'pingu_map.cxx',
+'pingus_counter_bar.cxx',
+'pingus_counter.cxx',
+'pingus_error.cxx',
+'pingus_level.cxx',
+# 'pingus_level_test.cxx',
+'pingus_main.cxx',
+'pingus_map_manager.cxx',
+'pingus_menu.cxx',
+'pingus_menu_manager.cxx',
+'pingus_sub_menu.cxx',
+'playfield.cxx',
+'plf_res_mgr.cxx',
+'plt_xml.cxx',
+'preview_renderer.cxx',
+'range.cxx',
+'res_descriptor.cxx',
+'resource.cxx',
+'resource_modifier.cxx',
+'result.cxx',
+'result_screen.cxx',
+'savegame.cxx',
+'savegame_manager.cxx',
+'screenshot.cxx',
+'server.cxx',
+'server_event.cxx',
+'smallmap.cxx',
+'smallmap_image.cxx',
+# 'sound/slot_manager.cxx',
+'sound/sound.cxx',
+'sound/sound_dummy.cxx',
+'sound/sound_real.cxx',
+'sound/sound_res_mgr.cxx',
+'spot_map.cxx',
+'start_screen.cxx',
+'state_sprite.cxx',
+'stat_manager.cxx',
+'story.cxx',
+'story_screen.cxx',
+'string_format.cxx',
+'system.cxx',
+# 'target_provider.cxx',
+# 'theme.cxx',
+# 'theme_selector.cxx',
+'time_display.cxx',
+'timer.cxx',
+'tinygettext.cxx',
+'true_server.cxx',
+'vector.cxx',
+'world.cxx',
+'worldmap/dot.cxx',
+'worldmap/dot_factory.cxx',
+'worldmap/drawable.cxx',
+'worldmap/drawable_factory.cxx',
+'worldmap/graph.cxx',
+'worldmap/level_dot.cxx',
+'worldmap/manager.cxx',
+'worldmap/path.cxx',
+'worldmap/path_drawable.cxx',
+'worldmap/path_graph.cxx',
+'worldmap/pingus.cxx',
+'worldmap/sprite_drawable.cxx',
+'worldmap/surface_drawable.cxx',
+'worldmap/worldmap.cxx',
+'worldobj.cxx',
+'worldobj_factory.cxx',
+'worldobjs/conveyor_belt.cxx',
+'worldobjs/entrance.cxx',
+'worldobjs/exit.cxx',
+'worldobjs/fake_exit.cxx',
+'worldobjs/groundpiece.cxx',
+'worldobjs/guillotine.cxx',
+'worldobjs/hammer.cxx',
+'worldobjs/hotspot.cxx',
+'worldobjs/ice_block.cxx',
+'worldobjs/info_box.cxx',
+'worldobjs/laser_exit.cxx',
+'worldobjs/liquid.cxx',
+'worldobjs/rain_generator.cxx',
+'worldobjs/smasher.cxx',
+'worldobjs/snow_generator.cxx',
+'worldobjs/solid_color_background.cxx',
+'worldobjs/spike.cxx',
+'worldobjs/starfield_background.cxx',
+'worldobjs/starfield_background_stars.cxx',
+'worldobjs/surface_background.cxx',
+'worldobjs/switch_door.cxx',
+'worldobjs/teleporter.cxx',
+'worldobjs/thunderstorm_background.cxx',
+'worldobjs/woodthing.cxx',
+# 'xml_eval.cxx',
+'xml_file_reader.cxx',
+'xml_file_writer.cxx',
+'xml_pdf.cxx',
+'xml_pingus_level.cxx'
+],
+LIBS = env['LIBS'],
+LIBPATH = env['LIBPATH'],
+CPPPATH = env['CPPPATH'] + ['..'])
+
+## EOF ##
Modified: trunk/src/editor/editor_panel.cxx
===================================================================
--- trunk/src/editor/editor_panel.cxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/editor/editor_panel.cxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -104,4 +104,5 @@
}
} // Editor namespace
-} // Pingus namespace
\ No newline at end of file
+} // Pingus namespace
+
Modified: trunk/src/editor/editor_panel.hxx
===================================================================
--- trunk/src/editor/editor_panel.hxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/editor/editor_panel.hxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -78,4 +78,5 @@
} // Pingus namespace
#endif
-/* EOF */
\ No newline at end of file
+
+/* EOF */
Modified: trunk/src/editor/editor_screen.cxx
===================================================================
--- trunk/src/editor/editor_screen.cxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/editor/editor_screen.cxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -121,4 +121,4 @@
}
} // Editor namespace
-} // Pingus namespace
\ No newline at end of file
+} // Pingus namespace
Modified: trunk/src/editor/editor_screen.hxx
===================================================================
--- trunk/src/editor/editor_screen.hxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/editor/editor_screen.hxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -90,4 +90,5 @@
} // Pingus namespace
#endif
-/* EOF */
\ No newline at end of file
+
+/* EOF */
Modified: trunk/src/editor/editor_viewport.cxx
===================================================================
--- trunk/src/editor/editor_viewport.cxx 2005-12-01 15:43:45 UTC (rev
2516)
+++ trunk/src/editor/editor_viewport.cxx 2005-12-01 16:10:05 UTC (rev
2517)
@@ -34,15 +34,15 @@
// Constructor
EditorViewport::EditorViewport(EditorScreen* e) :
+ state((int)(end_pos.x - start_pos.x), (int)(end_pos.y - start_pos.y)),
+ scene_context(new SceneContext()),
+ translate(0),
editor(e),
bg_surface(0),
start_pos(Vector(10.0f, 60.0f)),
end_pos(Vector((float)(CL_Display::get_width() - 10),
-
(float)(CL_Display::get_height() - 10))),
- scene_context(new SceneContext()),
- autoscroll(true),
- translate(0),
- state((int)(end_pos.x - start_pos.x), (int)(end_pos.y - start_pos.y))
+
(float)(CL_Display::get_height() - 10))),
+ autoscroll(true)
{
state.set_limit(CL_Rect((int)start_pos.x, (int)start_pos.y,
(int)end_pos.x, (int)end_pos.y));
@@ -145,4 +145,4 @@
} // Editor namespace
} // Pingus namespace
-/* EOF */
\ No newline at end of file
+/* EOF */
Modified: trunk/src/editor/editor_viewport.hxx
===================================================================
--- trunk/src/editor/editor_viewport.hxx 2005-12-01 15:43:45 UTC (rev
2516)
+++ trunk/src/editor/editor_viewport.hxx 2005-12-01 16:10:05 UTC (rev
2517)
@@ -106,4 +106,4 @@
#endif
-/* EOF */
\ No newline at end of file
+/* EOF */
Modified: trunk/src/editor/level_impl.hxx
===================================================================
--- trunk/src/editor/level_impl.hxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/editor/level_impl.hxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -85,4 +85,5 @@
#endif
-/* EOF */
\ No newline at end of file
+/* EOF */
+
Modified: trunk/src/editor/level_objs.cxx
===================================================================
--- trunk/src/editor/level_objs.cxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/editor/level_objs.cxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -32,11 +32,10 @@
// Default constructor
LevelObj::LevelObj(std::string obj_name) :
section_name(obj_name),
- width(0),
speed(0),
parallax(0.0),
+ width(0),
owner_id(-1),
- color(0,0,0,0),
scroll_x(0),
scroll_y(0),
stretch_x(false),
@@ -44,6 +43,7 @@
keep_aspect(false),
para_x(0),
para_y(0),
+ color(0,0,0,0),
attribs(get_attributes(obj_name))
{
@@ -148,4 +148,4 @@
} // Editor namespace
} // Pingus namespace
-/* EOF */
\ No newline at end of file
+/* EOF */
Modified: trunk/src/editor/level_objs.hxx
===================================================================
--- trunk/src/editor/level_objs.hxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/editor/level_objs.hxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -46,7 +46,7 @@
const unsigned HAS_SURFACE = 2048;
/** Returns a number representing which attributes this object
possesses */
- static unsigned get_attributes(std::string obj_type)
+ inline unsigned int get_attributes(std::string obj_type)
{
unsigned val;
if (obj_type == "groundpiece")
@@ -277,4 +277,4 @@
#endif
-/* EOF */
\ No newline at end of file
+/* EOF */
Modified: trunk/src/editor/panel_buttons.cxx
===================================================================
--- trunk/src/editor/panel_buttons.cxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/editor/panel_buttons.cxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -34,8 +34,8 @@
// Constructor
PanelButton::PanelButton(EditorPanel* p) :
- panel(p),
- hover(false)
+ hover(false),
+ panel(p)
{
button = Resource::load_sprite("core/editor/button");
button_pressed = Resource::load_sprite("core/editor/button_pressed");
Modified: trunk/src/editor/panel_buttons.hxx
===================================================================
--- trunk/src/editor/panel_buttons.hxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/editor/panel_buttons.hxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -1,88 +1,88 @@
-// $Id: editor_panel.hxx,v 1.00 2005/11/07 23:41:12 Jave27 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_PANEL_BUTTONS_HXX
-#define HEADER_PINGUS_PANEL_BUTTONS_HXX
-
-#include <ClanLib/Display/sprite.h>
-#include "../gui/component.hxx"
-#include "../vector.hxx"
-
-namespace Pingus {
-
-class DrawingContext;
-
-namespace Editor {
-
-class EditorPanel;
-
-/** Generic PanelButton class - all buttons in the Editor should inherit from
this */
-class PanelButton : public GUI::Component
-{
-private:
- /** Whether or not the mouse is over the button */
- bool hover;
-
-protected:
- /** The actual button image */
- CL_Sprite sur;
-
- /** The button background image when not pressed */
- CL_Sprite button;
-
- /** The button background image while pressed */
- CL_Sprite button_pressed;
-
- /** The panel to which this button belongs */
- EditorPanel* panel;
-
- /** The string that appears when the mouse is hovering over this button
*/
- std::string tooltip;
-
- /** The location of this button on the screen (set by the EditorPanel)
*/
- Vector pos;
-
-public:
- /** Constructor
- @param p The EditorPanel to which this button belongs */
- PanelButton(EditorPanel* p);
-
- /** Destructor - nothing really happens here */
- 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);
-
- /** Returns the Vector of this button's location */
- Vector get_pos () { return pos; }
-
- /** Returns the width of the sur sprite */
- int get_width() { return sur.get_width(); }
-
- /** Returns the height of the sur sprite */
- int get_height() { return sur.get_height(); }
-
- /** Draws the button */
- void draw(DrawingContext& gc);
-
- /** Return true if the button is located at this x,y coordinate */
+// $Id: editor_panel.hxx,v 1.00 2005/11/07 23:41:12 Jave27 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_PANEL_BUTTONS_HXX
+#define HEADER_PINGUS_PANEL_BUTTONS_HXX
+
+#include <ClanLib/Display/sprite.h>
+#include "../gui/component.hxx"
+#include "../vector.hxx"
+
+namespace Pingus {
+
+class DrawingContext;
+
+namespace Editor {
+
+class EditorPanel;
+
+/** Generic PanelButton class - all buttons in the Editor should inherit from
this */
+class PanelButton : public GUI::Component
+{
+private:
+ /** Whether or not the mouse is over the button */
+ bool hover;
+
+protected:
+ /** The actual button image */
+ CL_Sprite sur;
+
+ /** The button background image when not pressed */
+ CL_Sprite button;
+
+ /** The button background image while pressed */
+ CL_Sprite button_pressed;
+
+ /** The panel to which this button belongs */
+ EditorPanel* panel;
+
+ /** The string that appears when the mouse is hovering over this button
*/
+ std::string tooltip;
+
+ /** The location of this button on the screen (set by the EditorPanel)
*/
+ Vector pos;
+
+public:
+ /** Constructor
+ @param p The EditorPanel to which this button belongs */
+ PanelButton(EditorPanel* p);
+
+ /** Destructor - nothing really happens here */
+ 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);
+
+ /** Returns the Vector of this button's location */
+ Vector get_pos () { return pos; }
+
+ /** Returns the width of the sur sprite */
+ int get_width() { return sur.get_width(); }
+
+ /** Returns the height of the sur sprite */
+ int get_height() { return sur.get_height(); }
+
+ /** Draws the button */
+ void draw(DrawingContext& gc);
+
+ /** Return true if the button is located at this x,y coordinate */
bool is_at(int x, int y);
/** Action taken when the mouse enters the button area */
@@ -90,12 +90,12 @@
/** Action taken when the mouse leaves the button area */
virtual void on_pointer_leave () { hover = false; }
-
-private:
- PanelButton (const PanelButton&);
- PanelButton& operator= (const PanelButton&);
-}; // PanelButton class
-
+
+private:
+ PanelButton (const PanelButton&);
+ PanelButton& operator= (const PanelButton&);
+}; // PanelButton class
+
/** Standard exit button */
class PanelButtonExit : PanelButton
{
@@ -111,8 +111,8 @@
PanelButtonExit ();
PanelButtonExit (const PanelButtonExit&);
PanelButtonExit& operator= (const PanelButtonExit&);
-}; // PanelButtonExit class
-
+}; // PanelButtonExit class
+
/** Standard load button */
class PanelButtonLoad : PanelButton
{
@@ -128,8 +128,8 @@
PanelButtonLoad ();
PanelButtonLoad (const PanelButtonLoad&);
PanelButtonLoad& operator= (const PanelButtonLoad&);
-}; // PanelButtonLoad class
-
+}; // PanelButtonLoad class
+
/** Standard save button */
class PanelButtonSave : PanelButton
{
@@ -145,10 +145,11 @@
PanelButtonSave ();
PanelButtonSave (const PanelButtonSave&);
PanelButtonSave& operator= (const PanelButtonSave&);
-}; // PanelButtonSave class
-
-} // Editor namespace
-} // Pingus namespace
-
-#endif
-/* EOF */
\ No newline at end of file
+}; // PanelButtonSave class
+
+} // Editor namespace
+} // Pingus namespace
+
+#endif
+
+/* EOF */
Modified: trunk/src/editor/xml_level.cxx
===================================================================
--- trunk/src/editor/xml_level.cxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/editor/xml_level.cxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -230,4 +230,4 @@
}
} // Editor namespace
-} // Pingus namespace
\ No newline at end of file
+} // Pingus namespace
Modified: trunk/src/editor/xml_level.hxx
===================================================================
--- trunk/src/editor/xml_level.hxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/editor/xml_level.hxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -63,4 +63,4 @@
#endif
-/* EOF */
\ No newline at end of file
+/* EOF */
Modified: trunk/src/file_dialog.cxx
===================================================================
--- trunk/src/file_dialog.cxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/file_dialog.cxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -49,8 +49,8 @@
ResDescriptor("core/menu/exit_button_pressed"),
ResDescriptor("core/menu/exit_button_hover")),
manager (m),
+ file_dialog(f),
label (l),
- file_dialog(f),
is_hidden(true)
{
}
@@ -139,10 +139,10 @@
public:
FileDialogScrollButton (FileDialog* f, int d, int height_offset)
- : pos(Vector((float)CL_Display::get_width()/2 + 210,
- (float)CL_Display::get_height()/2 + height_offset)),
- file_dialog(f),
- direction(d)
+ : file_dialog(f),
+ pos(Vector((float)CL_Display::get_width()/2 + 210,
+ (float)CL_Display::get_height()/2 +
height_offset)),
+ direction(d)
{
std::string str_direction = d==0 ? "up" : "down";
sprite = Resource::load_sprite("core/menu/" +
str_direction + "_arrow");
@@ -168,9 +168,9 @@
FileDialog::FileDialog (PingusMenuManager* manager_, const std::string
filemask_,
const std::string searchpath_, bool for_load)
: PingusSubMenu (manager_),
- file_mask(filemask_),
- current_path(searchpath_),
- for_loading(for_load)
+ for_loading(for_load),
+ file_mask(filemask_),
+ current_path(searchpath_)
{
// Initialize the buttons
ok_button = new FileDialogOkButton(manager, this,
Modified: trunk/src/file_dialog_item.cxx
===================================================================
--- trunk/src/file_dialog_item.cxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/file_dialog_item.cxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -30,7 +30,7 @@
// Only Constructor
FileDialogItem::FileDialogItem(FileDialog* f, Vector p)
- : file_dialog(f), mouse_over(false), is_hidden(true),
+ : mouse_over(false), is_hidden(true), file_dialog(f),
pos(p),
sprite(Resource::load_sprite("core/misc/404sprite"))
{
}
@@ -103,4 +103,4 @@
}
}
-/* EOF */
\ No newline at end of file
+/* EOF */
Modified: trunk/src/file_dialog_item.hxx
===================================================================
--- trunk/src/file_dialog_item.hxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/file_dialog_item.hxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -72,12 +72,12 @@
private:
FileDialogItem();
- FileDialogItem (const FileDialogItem&);
- FileDialogItem& operator= (const FileDialogItem&);
+ FileDialogItem (const FileDialogItem&);
+ FileDialogItem& operator= (const FileDialogItem&);
}; // FileDialogItem class
} // Pingus namespace
#endif
-/* EOF */
\ No newline at end of file
+/* EOF */
Modified: trunk/src/file_writer.hxx
===================================================================
--- trunk/src/file_writer.hxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/file_writer.hxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -32,6 +32,8 @@
{
private:
public:
+ virtual ~FileWriter() {}
+
virtual void begin_section (const char* name) =0;
virtual void end_section () =0;
Modified: trunk/src/global_event.hxx
===================================================================
--- trunk/src/global_event.hxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/global_event.hxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -31,6 +31,7 @@
{
public:
GlobalEvent ();
+ virtual ~GlobalEvent() {}
virtual void on_button_press(const CL_InputEvent& event);
virtual void on_button_release(const CL_InputEvent& event);
Modified: trunk/src/gui/combobox.cxx
===================================================================
--- trunk/src/gui/combobox.cxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/gui/combobox.cxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -147,4 +147,4 @@
} // GUI namespace
} // Pingus namespace
-/* EOF */
\ No newline at end of file
+/* EOF */
Modified: trunk/src/gui/component.hxx
===================================================================
--- trunk/src/gui/component.hxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/gui/component.hxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -36,6 +36,7 @@
public:
Component () { }
+ virtual ~Component() {}
virtual void draw (DrawingContext& gc) =0;
virtual void update (float delta) { UNUSED_ARG(delta);}
Modified: trunk/src/pingu_action_factory.hxx
===================================================================
--- trunk/src/pingu_action_factory.hxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/pingu_action_factory.hxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -69,6 +69,7 @@
PinguActionAbstractFactory (Actions::ActionName id) {
PinguActionFactory::instance ()-> register_factory (id, this);
}
+ virtual ~PinguActionAbstractFactory() {}
virtual PinguAction* create (Pingu* p) =0;
Modified: trunk/src/pingus_main.cxx
===================================================================
--- trunk/src/pingus_main.cxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/pingus_main.cxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -1,11 +1,11 @@
// $Id: pingus_main.cxx,v 1.104 2004/04/01 15:18:05 torangan Exp $
// ___
-// | _ \ | ,--.
-// | /_ _ _ ___ _ _ ___ | ,-/ o \
-// | || || \ || _ || |_| ||_ -' | `-. /
-// |__||_||_\_||_ ||_____||___| | /\ \
-// _| | | | |_| |
-// |___| | o\/____\
+// | _ \ | ,--. |
+// | /_ _ _ ___ _ _ ___ | ,-/ o \ |
+// | || || \ || _ || |_| ||_ -' | `-. / |
+// |__||_||_\_||_ ||_____||___| | /\ \ |
+// _| | | | |_| | |
+// |___| | o\/____\ |
//
// Copyright (C) 1998 Ingo Ruhnke <address@hidden>
//
Modified: trunk/src/spot_map.cxx
===================================================================
--- trunk/src/spot_map.cxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/spot_map.cxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -36,265 +36,265 @@
namespace Pingus {
-MapTile::MapTile ()
-{
-}
+ MapTile::MapTile ()
+ {
+ }
-MapTile::~MapTile()
-{
-}
+ MapTile::~MapTile()
+ {
+ }
-void
-MapTile::prepare()
-{
- if (!pixelbuffer)
- {
- pixelbuffer = CL_PixelBuffer(tile_size, tile_size, tile_size*4,
CL_PixelFormat::rgba8888);
- Blitter::clear_canvas(pixelbuffer);
- }
-}
+ void
+ MapTile::prepare()
+ {
+ if (!pixelbuffer)
+ {
+ pixelbuffer = CL_PixelBuffer(tile_size, tile_size,
tile_size*4, CL_PixelFormat::rgba8888);
+ Blitter::clear_canvas(pixelbuffer);
+ }
+ }
-void
-MapTile::remove(CL_PixelBuffer obj, int x, int y,
- int real_x, int
real_y, PingusSpotMap* parent)
-{
- if (surface)
- {
- parent->put_alpha_surface(pixelbuffer, obj, x, y, real_x, real_y);
- surface = CL_Surface(pixelbuffer);
- }
-}
+ void
+ MapTile::remove(CL_PixelBuffer obj, int x, int y,
+ int real_x, int real_y,
PingusSpotMap* parent)
+ {
+ if (surface)
+ {
+ parent->put_alpha_surface(pixelbuffer, obj, x, y,
real_x, real_y);
+ surface = CL_Surface(pixelbuffer);
+ }
+ }
-void
-MapTile::put(CL_PixelBuffer obj, int x, int y)
-{
- prepare();
- Blitter::put_surface(pixelbuffer, obj, x, y);
- surface = CL_Surface(pixelbuffer);
-}
+ void
+ MapTile::put(CL_PixelBuffer obj, int x, int y)
+ {
+ prepare();
+ Blitter::put_surface(pixelbuffer, obj, x, y);
+ surface = CL_Surface(pixelbuffer);
+ }
-PingusSpotMap::PingusSpotMap(const PingusLevel& plf)
-{
- width = plf.get_size().width;
- height = plf.get_size().height;
+ PingusSpotMap::PingusSpotMap(const PingusLevel& plf)
+ {
+ width = plf.get_size().width;
+ height = plf.get_size().height;
- colmap = new ColMap(width, height);
+ colmap = new ColMap(width, height);
- // Checking that the map has the correct size, only multiples of
- // tile_size are allowed, anything else wouldn't fit very well on
- // the colmap
- if ((width % tile_size) != 0)
- {
- width += (tile_size - (width % tile_size));
- }
+ // Checking that the map has the correct size, only multiples of
+ // tile_size are allowed, anything else wouldn't fit very well
on
+ // the colmap
+ if ((width % tile_size) != 0)
+ {
+ width += (tile_size - (width % tile_size));
+ }
- if ((height % tile_size) != 0)
- {
- height += (tile_size - (height % tile_size));
- }
+ if ((height % tile_size) != 0)
+ {
+ height += (tile_size - (height % tile_size));
+ }
- tile_width = width/tile_size;
- tile_height = height/tile_size;
+ tile_width = width/tile_size;
+ tile_height = height/tile_size;
- // Allocating tile map
- tile.resize(tile_width);
- for(unsigned int i=0; i < tile.size(); ++i)
- tile[i].resize(tile_height);
+ // Allocating tile map
+ tile.resize(tile_width);
+ for(unsigned int i=0; i < tile.size(); ++i)
+ tile[i].resize(tile_height);
- // fix the height back to the correct values
- width = plf.get_size().width;
- height = plf.get_size().height;
-}
+ // fix the height back to the correct values
+ width = plf.get_size().width;
+ height = plf.get_size().height;
+ }
-PingusSpotMap::~PingusSpotMap(void)
-{
- delete colmap;
-}
+ PingusSpotMap::~PingusSpotMap(void)
+ {
+ delete colmap;
+ }
-void
-PingusSpotMap::draw_colmap(SceneContext& gc)
-{
- colmap->draw(gc.color());
-}
+ void
+ PingusSpotMap::draw_colmap(SceneContext& gc)
+ {
+ colmap->draw(gc.color());
+ }
// Draws the map with a offset, needed for scrolling
-void
-PingusSpotMap::draw(SceneContext& gc)
-{
- const CL_Rect& display = gc.color().get_clip_rect();
+ void
+ PingusSpotMap::draw(SceneContext& gc)
+ {
+ const CL_Rect& display = gc.color().get_clip_rect();
- // FIXME: delete the next four lines and replace them with gc.get_clip_rect()
- if (draw_collision_map)
- {
- draw_colmap(gc);
- }
- else
- {
- // Trying to calc which parts of the tilemap needs to be drawn
- int start_x = Math::max(0, display.left/tile_size);
- int start_y = Math::max(0, display.top/tile_size);
- int tilemap_width = display.get_width() / tile_size + 1;
- int tilemap_height = display.get_height() / tile_size + 1;
+ // FIXME: delete the next four lines and replace them with
gc.get_clip_rect()
+ if (draw_collision_map)
+ {
+ draw_colmap(gc);
+ }
+ else
+ {
+ // Trying to calc which parts of the tilemap needs to
be drawn
+ int start_x = Math::max(0, display.left/tile_size);
+ int start_y = Math::max(0, display.top/tile_size);
+ int tilemap_width = display.get_width() / tile_size +
1;
+ int tilemap_height = display.get_height() / tile_size +
1;
- // drawing the stuff
- for (int x = start_x; x <= (start_x + tilemap_width) && x <
int(tile.size()); ++x)
- for (int y = start_y; y <= start_y + tilemap_height && y <
int(tile[x].size()); ++y)
- {
- if (tile[x][y].get_surface())
- {
- gc.color().draw(tile[x][y].get_surface(),
- Vector(static_cast<float>(x * tile_size),
-
static_cast<float>(y *
tile_size)));
- }
- else
- {
- if (pingus_debug_flags & PINGUS_DEBUG_TILES)
- gc.color().draw_fillrect(static_cast<float>(x * tile_size),
-
static_cast<float>(y * tile_size),
- static_cast<float>(x * tile_size +
tile_size),
-
static_cast<float>(y * tile_size + tile_size),
- CL_Color(255, 0, 0, 75));
- }
- }
- }
-}
+ // drawing the stuff
+ for (int x = start_x; x <= (start_x + tilemap_width) &&
x < int(tile.size()); ++x)
+ for (int y = start_y; y <= start_y +
tilemap_height && y < int(tile[x].size()); ++y)
+ {
+ if (tile[x][y].get_surface())
+ {
+
gc.color().draw(tile[x][y].get_surface(),
+
Vector(static_cast<float>(x * tile_size),
+
static_cast<float>(y * tile_size)));
+ }
+ else
+ {
+ if (pingus_debug_flags &
PINGUS_DEBUG_TILES)
+
gc.color().draw_fillrect(static_cast<float>(x * tile_size),
+
static_cast<float>(y * tile_size),
+
static_cast<float>(x * tile_size +
tile_size),
+
static_cast<float>(y * tile_size +
tile_size),
+
CL_Color(255, 0, 0, 75));
+ }
+ }
+ }
+ }
// Returns the width of the map, it is read directly from the *.psm file
-int
-PingusSpotMap::get_width(void)
-{
- return width;
-}
+ int
+ PingusSpotMap::get_width(void)
+ {
+ return width;
+ }
// Returns the height of the map, it is read directly from the *.psm file
-int
-PingusSpotMap::get_height(void)
-{
- return height;
-}
+ int
+ PingusSpotMap::get_height(void)
+ {
+ return height;
+ }
-void
-PingusSpotMap::remove(CL_PixelBuffer sprovider, int x, int y)
-{
- // Get the start tile and end tile
- int start_x = Math::max(x / tile_size, 0);
- int start_y = Math::max(y / tile_size, 0);
- int end_x = Math::min((x + sprovider.get_width()) / tile_size,
- (width - 1) / tile_size);
- int end_y = Math::min((y + sprovider.get_height()) / tile_size,
- (height - 1) / tile_size);
+ void
+ PingusSpotMap::remove(CL_PixelBuffer sprovider, int x, int y)
+ {
+ // Get the start tile and end tile
+ int start_x = Math::max(x / tile_size, 0);
+ int start_y = Math::max(y / tile_size, 0);
+ int end_x = Math::min((x + sprovider.get_width()) / tile_size,
+
(width - 1) / tile_size);
+ int end_y = Math::min((y + sprovider.get_height()) /
tile_size,
+
(height - 1) / tile_size);
- for(int ix = start_x; ix <= end_x; ++ix)
- for(int iy = start_y; iy <= end_y; ++iy)
- {
- tile[ix][iy].remove(sprovider, x - (ix * tile_size),
- y - (iy * tile_size), x, y, this);
- }
-}
+ for(int ix = start_x; ix <= end_x; ++ix)
+ for(int iy = start_y; iy <= end_y; ++iy)
+ {
+ tile[ix][iy].remove(sprovider, x - (ix *
tile_size),
+
y - (iy * tile_size), x, y, this);
+ }
+ }
-void
-PingusSpotMap::put_alpha_surface(CL_PixelBuffer provider, CL_PixelBuffer
sprovider,
- int x_pos, int y_pos, int real_x_arg, int
real_y_arg)
-{
- if (sprovider.get_format().get_depth() != 8)
- {
+ void
+ PingusSpotMap::put_alpha_surface(CL_PixelBuffer provider,
CL_PixelBuffer sprovider,
+
int x_pos, int y_pos, int real_x_arg, int real_y_arg)
+ {
+ if (sprovider.get_format().get_depth() != 8)
+ {
PingusError::raise(std::string("SpotMap::put_alpha_surface: Image has wrong
color depth: "
- + sprovider.get_format().get_depth()));
- }
+
+ sprovider.get_format().get_depth()));
+ }
- provider.lock();
- sprovider.lock();
+ provider.lock();
+ sprovider.lock();
- int swidth = sprovider.get_width();
- int twidth = provider.get_width();
+ int swidth = sprovider.get_width();
+ int twidth = provider.get_width();
- int start_x = std::max(0, -x_pos);
- int start_y = std::max(0, -y_pos);
+ int start_x = std::max(0, -x_pos);
+ int start_y = std::max(0, -y_pos);
- int end_x = std::min(swidth, twidth - x_pos);
- int end_y = std::min(sprovider.get_height(), provider.get_height() - y_pos);
+ int end_x = std::min(swidth, twidth - x_pos);
+ int end_y = std::min(sprovider.get_height(),
provider.get_height() - y_pos);
- if (end_x - start_x <= 0 || end_y - start_y <= 0)
- return;
+ if (end_x - start_x <= 0 || end_y - start_y <= 0)
+ return;
- cl_uint8* target_buf = static_cast<cl_uint8*>(provider.get_data());
- cl_uint8* source_buf = static_cast<cl_uint8*>(sprovider.get_data());
+ cl_uint8* target_buf =
static_cast<cl_uint8*>(provider.get_data());
+ cl_uint8* source_buf =
static_cast<cl_uint8*>(sprovider.get_data());
- CL_Palette palette = sprovider.get_palette();
+ CL_Palette palette = sprovider.get_palette();
- if (sprovider.get_format().has_colorkey())
- {
- unsigned int colorkey = sprovider.get_format().get_colorkey();
+ if (sprovider.get_format().has_colorkey())
+ {
+ unsigned int colorkey =
sprovider.get_format().get_colorkey();
- for (int y = start_y; y < end_y; ++y)
- {
- cl_uint8* tptr = target_buf + 4*((twidth*(y+y_pos)) + x_pos +
start_x);
- cl_uint8* sptr = source_buf + swidth*y + start_x;
+ for (int y = start_y; y < end_y; ++y)
+ {
+ cl_uint8* tptr = target_buf +
4*((twidth*(y+y_pos)) + x_pos + start_x);
+ cl_uint8* sptr = source_buf + swidth*y +
start_x;
- for (int x = start_x; x < end_x; ++x)
+ for (int x = start_x; x < end_x; ++x)
{
- if (*sptr != colorkey && colmap->getpixel(real_x_arg+x,
real_y_arg+y) != Groundtype::GP_SOLID)
- {
+ if (*sptr != colorkey &&
colmap->getpixel(real_x_arg+x, real_y_arg+y) != Groundtype::GP_SOLID)
+ { // FIXME: Slow?! if inside a blit
loop probally not such a good idea
if (!CL_Endian::is_system_big())
- *tptr = 0;
+ *tptr = 0;
else
- tptr[3] = 0;
- }
+ tptr[3] = 0;
+ }
- tptr += 4;
- sptr += 1;
+ tptr += 4;
+ sptr += 1;
}
- }
- }
- else
- {
- for (int y = start_y; y < end_y; ++y)
- {
- cl_uint8* tptr = target_buf + 4*((twidth*(y+y_pos)) + x_pos +
start_x);
- cl_uint8* sptr = source_buf + swidth*y + start_x;
+ }
+ }
+ else
+ {
+ for (int y = start_y; y < end_y; ++y)
+ {
+ cl_uint8* tptr = target_buf +
4*((twidth*(y+y_pos)) + x_pos + start_x);
+ cl_uint8* sptr = source_buf + swidth*y +
start_x;
- for (int x = start_x; x < end_x; ++x)
+ for (int x = start_x; x < end_x; ++x)
{
- if (colmap->getpixel(real_x_arg+x, real_y_arg+y) !=
Groundtype::GP_SOLID)
- {
- if (!CL_Endian::is_system_big())
- *tptr = 0;
- else
- tptr[3] = 0;
- }
+ if
(colmap->getpixel(real_x_arg+x, real_y_arg+y) != Groundtype::GP_SOLID)
+ { // FIXME: if inside blit loop
might not be such a good idea
+ if
(!CL_Endian::is_system_big())
+ *tptr = 0;
+ else
+ tptr[3] = 0;
+ }
- tptr += 4;
- sptr += 1;
+
tptr += 4;
+ sptr += 1;
}
- }
- }
+ }
+ }
- sprovider.unlock();
- provider.unlock();
-}
+ sprovider.unlock();
+ provider.unlock();
+ }
-void
-PingusSpotMap::put(CL_PixelBuffer sprovider, int x, int y)
-{
- // Get the start tile and end tile
- int start_x = std::max(0, x / tile_size);
- int start_y = std::max(0, y / tile_size);
- int end_x = std::min(tile_width, (x + sprovider.get_width()) / tile_size
+ 1);
- int end_y = std::min(tile_height, (y + sprovider.get_height()) / tile_size
+ 1);
+ void
+ PingusSpotMap::put(CL_PixelBuffer sprovider, int x, int y)
+ {
+ // Get the start tile and end tile
+ int start_x = std::max(0, x / tile_size);
+ int start_y = std::max(0, y / tile_size);
+ int end_x = std::min(tile_width, (x + sprovider.get_width())
/ tile_size + 1);
+ int end_y = std::min(tile_height, (y +
sprovider.get_height()) / tile_size + 1);
- for(int ix = start_x; ix < end_x; ++ix)
- for(int iy = start_y; iy < end_y; ++iy)
- {
- tile[ix][iy].put(sprovider,
- x - (ix * tile_size), y - (iy * tile_size));
- }
-}
+ for(int ix = start_x; ix < end_x; ++ix)
+ for(int iy = start_y; iy < end_y; ++iy)
+ {
+ tile[ix][iy].put(sprovider,
+ x -
(ix * tile_size), y - (iy * tile_size));
+ }
+ }
-ColMap*
-PingusSpotMap::get_colmap(void)
-{
- return colmap;
-}
+ ColMap*
+ PingusSpotMap::get_colmap(void)
+ {
+ return colmap;
+ }
} // namespace Pingus
Modified: trunk/src/theme_selector.hxx
===================================================================
--- trunk/src/theme_selector.hxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/theme_selector.hxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -82,6 +82,7 @@
public:
Event () { }
+ virtual ~Event () { }
virtual void on_button_press(const CL_InputEvent& event);
virtual void on_button_release(const CL_InputEvent& event);
Modified: trunk/src/tinygettext.cxx
===================================================================
--- trunk/src/tinygettext.cxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/tinygettext.cxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -17,6 +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 <config.h>
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#else
@@ -29,7 +30,6 @@
#include <iostream>
#include <ctype.h>
#include <errno.h>
-#include <config.h>
#include "tinygettext.hxx"
#include "pingus_error.hxx"
@@ -92,7 +92,7 @@
size_t in_size = text.size();
size_t out_size = 4*in_size; // Worst case scenario: ASCII ->
UTF-32?
std::string result(out_size, ' ');
- ICONV_CONST char* in_str = &text[0];
+ char* in_str = &text[0];
char* out_str = &result[0];
// Try to convert the text.
@@ -146,7 +146,7 @@
}
iconv_close(cd);
- /*
+
<dolphin> your code is also buggy
<dolphin> there will be extra spaces at the end of the string
<dolphin> the lenght of the final string should be: out_str - out_orig
Modified: trunk/src/worldobj_factory.hxx
===================================================================
--- trunk/src/worldobj_factory.hxx 2005-12-01 15:43:45 UTC (rev 2516)
+++ trunk/src/worldobj_factory.hxx 2005-12-01 16:10:05 UTC (rev 2517)
@@ -65,6 +65,8 @@
WorldObjFactory::instance ()->register_factory (id, this);
}
+ virtual ~WorldObjAbstractFactory() {}
+
virtual WorldObj* create(const FileReader& reader) =0;
private:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2517 - in trunk: . src src/editor src/gui,
grumbel at BerliOS <=