[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2636 - in branches/pingus_sdl/src: . actions display edito
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r2636 - in branches/pingus_sdl/src: . actions display editor gui input |
Date: |
Sat, 13 Jan 2007 11:37:01 +0100 |
Author: grumbel
Date: 2007-01-13 11:36:59 +0100 (Sat, 13 Jan 2007)
New Revision: 2636
Modified:
branches/pingus_sdl/src/SConscript
branches/pingus_sdl/src/actions/bomber.cxx
branches/pingus_sdl/src/console.cxx
branches/pingus_sdl/src/console.hxx
branches/pingus_sdl/src/delta_manager.hxx
branches/pingus_sdl/src/display/drawing_context.hxx
branches/pingus_sdl/src/display/drawing_request.hxx
branches/pingus_sdl/src/display/scene_graph.cxx
branches/pingus_sdl/src/display/scene_graph.hxx
branches/pingus_sdl/src/display/scene_node.hxx
branches/pingus_sdl/src/display/sprite_node.cxx
branches/pingus_sdl/src/display/sprite_node.hxx
branches/pingus_sdl/src/editor/level_objs.cxx
branches/pingus_sdl/src/file_reader.hxx
branches/pingus_sdl/src/fonts.hxx
branches/pingus_sdl/src/fps_counter.hxx
branches/pingus_sdl/src/gui/cursor.cxx
branches/pingus_sdl/src/gui/cursor.hxx
branches/pingus_sdl/src/gui/display.cxx
branches/pingus_sdl/src/gui/display.hxx
branches/pingus_sdl/src/gui/screen_manager.cxx
branches/pingus_sdl/src/input/button.hxx
branches/pingus_sdl/src/input/controller.cxx
branches/pingus_sdl/src/input/controller.hxx
branches/pingus_sdl/src/level_result.cxx
branches/pingus_sdl/src/pingus_main.cxx
branches/pingus_sdl/src/pingus_main.hxx
branches/pingus_sdl/src/resource.cxx
branches/pingus_sdl/src/system.cxx
Log:
- made pingus compile with SDL (only compile, *not* run)
Modified: branches/pingus_sdl/src/SConscript
===================================================================
--- branches/pingus_sdl/src/SConscript 2006-04-24 04:00:19 UTC (rev 2635)
+++ branches/pingus_sdl/src/SConscript 2007-01-13 10:36:59 UTC (rev 2636)
@@ -23,253 +23,276 @@
env = Environment(# ENV = {'PKG_CONFIG_PATH' : os.getenv('PKG_CONFIG_PATH')},
CC = 'gcc',
CCFLAGS = ['-O2', '-Wall', '-Werror', '-g'])
+sdl_env = Environment(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.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.ParseConfig('sdl-config --cflags --libs')
+
+sdl_env.ParseConfig('sdl-config --cflags --libs')
+sdl_env['LIBS'] += ['SDL_image']
+sdl_env.Program('display/scene_test', [
+ 'display/scene_graph.cxx',
+ 'display/sprite_node.cxx',
+ 'display/scene_node.cxx',
+ 'math/rect.cpp',
+ 'math/origin.cpp',
+ 'display/scene_test.cxx'])
+
env.Program('../pingus', [
-# 'gui/buffer_graphic_context.cxx',
-# 'indexed_canvas.cxx',
-# 'input/axes/mouse_axis.cxx',
-# 'level_desc.cxx',
-# 'level_result.cxx',
-# 'pingus_level_test.cxx',
-# 'sound/slot_manager.cxx',
-# 'target_provider.cxx',
-# 'theme.cxx',
-# 'theme_selector.cxx',
-# 'xml_eval.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',
-'capture_rectangle.cxx',
+
+# # 'gui/buffer_graphic_context.cxx',
+# # 'indexed_canvas.cxx',
+# # 'input/axes/mouse_axis.cxx',
+# # 'level_desc.cxx',
+# # 'level_result.cxx',
+# # 'pingus_level_test.cxx',
+# # 'sound/slot_manager.cxx',
+# # 'target_provider.cxx',
+# # 'theme.cxx',
+# # 'theme_selector.cxx',
+# # 'xml_eval.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',
+# 'capture_rectangle.cxx',
'cheat.cxx',
-'client.cxx',
-'col_map.cxx',
-'collider.cxx',
-'colliders/pingu_collider.cxx',
-'components/action_button.cxx',
-'components/button_panel.cxx',
-'components/hurry_up.cxx',
-'components/pingus_counter.cxx',
-'components/playfield.cxx',
-'components/smallmap.cxx',
-'components/time_display.cxx',
+# 'client.cxx',
+# 'col_map.cxx',
+# 'collider.cxx',
+# 'colliders/pingu_collider.cxx',
+# 'components/action_button.cxx',
+# 'components/button_panel.cxx',
+# 'components/hurry_up.cxx',
+# 'components/pingus_counter.cxx',
+# 'components/playfield.cxx',
+# 'components/smallmap.cxx',
+# 'components/time_display.cxx',
'config.cxx',
'console.cxx',
-'credits.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/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',
-'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',
+# 'demo_player.cxx',
+# 'demo_recorder.cxx',
+# 'demo_session.cxx',
+# 'direction.cxx',
+# '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',
+
+'command_line.cpp',
+'command_line_generic.cpp',
+
+# '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',
+# 'global_event.cxx',
'globals.cxx',
-'goal_manager.cxx',
-'graphic_context_state.cxx',
-'groundtype.cxx',
-'gui/checkbox.cxx',
-'gui/combobox.cxx',
-'gui/cursor.cxx',
+# 'goal_manager.cxx',
+# 'graphic_context_state.cxx',
+# 'groundtype.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_debug_screen.cxx',
-'gui/root_gui_manager.cxx',
-'gui/screen.cxx',
+# 'gui/gui_manager.cxx',
+# 'gui/gui_screen.cxx',
+# 'gui/input_box.cxx',
+# 'gui/input_debug_screen.cxx',
+# 'gui/root_gui_manager.cxx',
+# 'gui/screen.cxx',
'gui/screen_manager.cxx',
'gui/screen_ptr.cxx',
-'gui/surface_button.cxx',
-'input/axes/button_axis.cxx',
-'input/axes/inverted_axis.cxx',
-'input/axes/joystick_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',
+# 'gui/surface_button.cxx',
+
+# # 'input/axes/button_axis.cxx',
+# # 'input/axes/inverted_axis.cxx',
+# # 'input/axes/joystick_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_interrupt.cxx',
-'loading.cxx',
-'components/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',
+# # '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_interrupt.cxx',
+# 'loading.cxx',
+# 'components/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.cxx',
-'pingu_action.cxx',
-'pingu_action_factory.cxx',
-'pingu_enums.cxx',
-'pingu_holder.cxx',
+# 'pingu.cxx',
+# 'pingu_action.cxx',
+# 'pingu_action_factory.cxx',
+# 'pingu_enums.cxx',
+# 'pingu_holder.cxx',
'pingus_error.cxx',
-'pingus_level.cxx',
+# 'pingus_level.cxx',
'pingus_main.cxx',
-'pingus_map_manager.cxx',
-'pingus_menu.cxx',
-'pingus_menu_manager.cxx',
-'pingus_sub_menu.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_image.cxx',
-'sound/sound.cxx',
-'sound/sound_dummy.cxx',
-'sound/sound_real.cxx',
-'sound/sound_res_mgr.cxx',
-'ground_map.cxx',
-'start_screen.cxx',
-'stat_manager.cxx',
-'state_sprite.cxx',
-'story_screen.cxx',
-'string_format.cxx',
+# 'pingus_map_manager.cxx',
+# 'pingus_menu.cxx',
+# 'pingus_menu_manager.cxx',
+# 'pingus_sub_menu.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_image.cxx',
+# 'sound/sound.cxx',
+# 'sound/sound_dummy.cxx',
+# 'sound/sound_real.cxx',
+# 'sound/sound_res_mgr.cxx',
+# 'ground_map.cxx',
+# 'start_screen.cxx',
+# 'stat_manager.cxx',
+# 'state_sprite.cxx',
+# 'story_screen.cxx',
+# 'string_format.cxx',
'system.cxx',
-'timer.cxx',
+# 'timer.cxx',
'tinygettext/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/metamap.cxx',
-'worldmap/path.cxx',
-'worldmap/path_drawable.cxx',
-'worldmap/path_graph.cxx',
-'worldmap/pingus.cxx',
-'worldmap/sprite_drawable.cxx',
-'worldmap/surface_drawable.cxx',
-'worldmap/world_dot.cxx',
-'worldmap/worldmap.cxx',
-'worldmap/worldmap_story.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_file_reader.cxx',
-'xml_file_writer.cxx',
-'xml_pdf.cxx',
-'xml_pingus_level.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/metamap.cxx',
+# 'worldmap/path.cxx',
+# 'worldmap/path_drawable.cxx',
+# 'worldmap/path_graph.cxx',
+# 'worldmap/pingus.cxx',
+# 'worldmap/sprite_drawable.cxx',
+# 'worldmap/surface_drawable.cxx',
+# 'worldmap/world_dot.cxx',
+# 'worldmap/worldmap.cxx',
+# 'worldmap/worldmap_story.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_file_reader.cxx',
+# 'xml_file_writer.cxx',
+# 'xml_pdf.cxx',
+# 'xml_pingus_level.cxx'
],
LIBS = env['LIBS'],
LIBPATH = env['LIBPATH'],
-CPPPATH = env['CPPPATH'] + ['..'])
+CPPPATH = env['CPPPATH'] + ['..'] + ['.'])
## EOF ##
Modified: branches/pingus_sdl/src/actions/bomber.cxx
===================================================================
--- branches/pingus_sdl/src/actions/bomber.cxx 2006-04-24 04:00:19 UTC (rev
2635)
+++ branches/pingus_sdl/src/actions/bomber.cxx 2007-01-13 10:36:59 UTC (rev
2636)
@@ -132,7 +132,6 @@
static_cast<int>(pingu->get_y () - 16 - (bomber_radius.get_width()/2)));
}
-
// The pingu explode
if (sprite[pingu->direction].is_finished ())
{
Modified: branches/pingus_sdl/src/console.cxx
===================================================================
--- branches/pingus_sdl/src/console.cxx 2006-04-24 04:00:19 UTC (rev 2635)
+++ branches/pingus_sdl/src/console.cxx 2007-01-13 10:36:59 UTC (rev 2636)
@@ -19,8 +19,6 @@
#include <config.h>
#include <assert.h>
-#include <ClanLib/Display/display.h>
-#include <ClanLib/Display/font.h>
#include "fonts.hxx"
#include "console.hxx"
#include "math.hxx"
@@ -142,7 +140,7 @@
Console::init()
{
// std::cout << "Console: Init..." << std::endl;
- font = Fonts::xterm;
+ ////font = Fonts::xterm;
// (*this) << "Pingus Output Console (hide/show it with F1)\n"
// << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
@@ -155,23 +153,24 @@
void
Console::deinit()
{
- font = CL_Font();
+ ////font = CL_Font();
}
void
Console::draw()
{
+#if 0
assert(is_init);
/** Callculate the position of the first line on the screen */
- int start_y_pos =
- CL_Display::get_height() - (font.get_height() * (number_of_lines + 3));
+ ////int start_y_pos =
+ //// CL_Display::get_height() - (font.get_height() * (number_of_lines +
3));
// The background of the console
- CL_Display::fill_rect(CL_Rect(0, start_y_pos - 15,
- CL_Display::get_width(),
- CL_Display::get_height()),
- CL_Color(0, 0, 0, 128));
+ ////CL_Display::fill_rect(CL_Rect(0, start_y_pos - 15,
+ //// CL_Display::get_width(),
+ ////CL_Display::get_height()),
+ ////CL_Color(0, 0, 0, 128));
const std::list<std::string>& buffer = streambuf.get_buffer ();
@@ -192,6 +191,7 @@
it->c_str()
);
}
+#endif
}
void
Modified: branches/pingus_sdl/src/console.hxx
===================================================================
--- branches/pingus_sdl/src/console.hxx 2006-04-24 04:00:19 UTC (rev 2635)
+++ branches/pingus_sdl/src/console.hxx 2007-01-13 10:36:59 UTC (rev 2636)
@@ -22,11 +22,8 @@
#include <string>
#include <iostream>
-#include <ClanLib/Display/font.h>
#include "gui/display.hxx"
-class CL_Font;
-
namespace Pingus {
class ConsoleBuffer :
@@ -66,7 +63,7 @@
ConsoleBuffer streambuf;
public:
- CL_Font font;
+ ////CL_Font font;
bool is_init;
unsigned int current_pos;
Modified: branches/pingus_sdl/src/delta_manager.hxx
===================================================================
--- branches/pingus_sdl/src/delta_manager.hxx 2006-04-24 04:00:19 UTC (rev
2635)
+++ branches/pingus_sdl/src/delta_manager.hxx 2007-01-13 10:36:59 UTC (rev
2636)
@@ -20,9 +20,9 @@
#ifndef HEADER_PINGUS_DELTA_MANAGER_HXX
#define HEADER_PINGUS_DELTA_MANAGER_HXX
+#include "SDL.h"
#include <assert.h>
#include <iostream>
-#include <ClanLib/Core/System/system.h>
#include "pingus.hxx"
namespace Pingus {
@@ -35,7 +35,7 @@
public:
DeltaManager ()
: absolute_time(0),
- last_time (CL_System::get_time ())
+ last_time (SDL_GetTicks())
{}
float getset ()
@@ -47,13 +47,13 @@
void set ()
{
- last_time = CL_System::get_time ();
+ last_time = SDL_GetTicks();
absolute_time += last_time;
}
float get () const
{
- unsigned int t = CL_System::get_time ();
+ unsigned int t = SDL_GetTicks();
if (t < last_time)
{ // catching time travel
std::cout << "Time Travel: first: " << last_time << " second: " << t
<< std::endl;
@@ -61,7 +61,7 @@
}
else
{
- return (CL_System::get_time () - last_time) / 1000.0f;
+ return (SDL_GetTicks() - last_time) / 1000.0f;
}
}
Modified: branches/pingus_sdl/src/display/drawing_context.hxx
===================================================================
--- branches/pingus_sdl/src/display/drawing_context.hxx 2006-04-24 04:00:19 UTC
(rev 2635)
+++ branches/pingus_sdl/src/display/drawing_context.hxx 2007-01-13 10:36:59 UTC
(rev 2636)
@@ -20,8 +20,8 @@
#ifndef HEADER_DRAWING_CONTEXT_HXX
#define HEADER_DRAWING_CONTEXT_HXX
-#include <ClanLib/Core/Math/rect.h>
-#include <ClanLib/Display/color.h>
+//#include <ClanLib/Core/Math/rect.h>
+//#include <ClanLib/Display/color.h>
#include <vector>
#include "drawing_request.hxx"
#include "../vector.hxx"
@@ -44,7 +44,7 @@
typedef std::vector<DrawingRequest*> DrawingRequests;
DrawingRequests drawingrequests;
- std::vector<CL_Pointf> translate_stack;
+ std::vector<Vector> translate_stack;
public:
DrawingContext();
@@ -56,6 +56,7 @@
/** Empties the drawing context */
void clear();
+#if 0
/** Fills the screen with a given color, this is different from
clear() in that it doesn't remove other DrawingRequest from the
queue */
@@ -92,7 +93,8 @@
void draw_arc (float x_pos, float y_pos, float radius, float angle_start,
float angle_end,
const CL_Color& color);
/*} */
-
+#endif
+
/** Translate the drawing context */
void translate(float x, float y);
@@ -107,7 +109,7 @@
void reset_modelview();
/** Return the area of the screen that will be visible*/
- CL_Rect get_clip_rect();
+ ////CL_Rect get_clip_rect();
float get_width() const;
float get_height() const;
Modified: branches/pingus_sdl/src/display/drawing_request.hxx
===================================================================
--- branches/pingus_sdl/src/display/drawing_request.hxx 2006-04-24 04:00:19 UTC
(rev 2635)
+++ branches/pingus_sdl/src/display/drawing_request.hxx 2007-01-13 10:36:59 UTC
(rev 2636)
@@ -20,7 +20,8 @@
#ifndef HEADER_DRAWING_REQUEST_HXX
#define HEADER_DRAWING_REQUEST_HXX
-#include <ClanLib/Core/Math/cl_vector.h>
+///#include <ClanLib/Core/Math/cl_vector.h>
+#include "math/vector3.hpp"
class CL_GraphicContext;
@@ -29,9 +30,10 @@
class DrawingRequest
{
protected:
- CL_Vector pos;
+ Vector3 pos;
+
public:
- DrawingRequest(const CL_Vector& pos_) : pos(pos_) {}
+ DrawingRequest(const Vector3& pos_) : pos(pos_) {}
virtual ~DrawingRequest() {};
virtual void draw(CL_GraphicContext* gc) = 0;
Modified: branches/pingus_sdl/src/display/scene_graph.cxx
===================================================================
--- branches/pingus_sdl/src/display/scene_graph.cxx 2006-04-24 04:00:19 UTC
(rev 2635)
+++ branches/pingus_sdl/src/display/scene_graph.cxx 2007-01-13 10:36:59 UTC
(rev 2636)
@@ -23,11 +23,15 @@
** 02111-1307, USA.
*/
-#include "scene_graph.hpp"
+#include <SDL.h>
+#include "scene_node.hxx"
+#include "scene_graph.hxx"
+extern SDL_Surface* global_screen;
+
SceneGraph::SceneGraph()
{
- screen = Field(800/32, 600/32); // could use microtiles instead
+ screen.resize(800/32, 600/32); // could use microtiles instead
}
SceneGraph::~SceneGraph()
@@ -43,11 +47,19 @@
void
SceneGraph::render()
{
- screen.clear(false);
+ for(Nodes::iterator i = nodes.begin(); i != nodes.end(); ++i)
+ { // could limit this to stuff that has changed
+ (*i)->render(this);
+ }
+
+ return;
+
+
+ screen.clear();
// Find out what regions of the screen have changed
for(Nodes::iterator i = nodes.begin(); i != nodes.end(); ++i)
{ // could limit this to stuff that has changed
- mark_screen_region(i, i->get_screen_rect());
+ (*i)->mark(this);
}
// Redraw said regions
@@ -71,9 +83,9 @@
clip_rect.w = 32*width;
clip_rect.h = 32;
- SDL_SetClipRect(screen, &rect);
+ SDL_SetClipRect(global_screen, &clip_rect);
- (*i)->render(screen);
+ (*i)->render(this);
}
x += width;
Modified: branches/pingus_sdl/src/display/scene_graph.hxx
===================================================================
--- branches/pingus_sdl/src/display/scene_graph.hxx 2006-04-24 04:00:19 UTC
(rev 2635)
+++ branches/pingus_sdl/src/display/scene_graph.hxx 2007-01-13 10:36:59 UTC
(rev 2636)
@@ -25,6 +25,10 @@
#define MICROTILE(x0, y0, x1, y1) (((x0) << 24) | ((y0) << 16) | ((x1) << 8) |
(y1))
+#include <vector>
+#include "../field.hpp"
+
+class Rect;
class SceneNode;
/** */
@@ -32,7 +36,7 @@
{
private:
/** true if the region needs a refresh, false otherwise */
- Field<bool> screen;
+ Field<uint32_t> screen;
typedef std::vector<SceneNode*> Nodes;
Nodes nodes;
@@ -41,7 +45,7 @@
SceneGraph();
~SceneGraph();
- void add(SceneGroup* );
+ void add(SceneNode* );
/** Draw the SceneGraph to the screen */
void render();
Modified: branches/pingus_sdl/src/display/scene_node.hxx
===================================================================
--- branches/pingus_sdl/src/display/scene_node.hxx 2006-04-24 04:00:19 UTC
(rev 2635)
+++ branches/pingus_sdl/src/display/scene_node.hxx 2007-01-13 10:36:59 UTC
(rev 2636)
@@ -20,19 +20,26 @@
#ifndef HEADER_SCENE_NODE_HPP
#define HEADER_SCENE_NODE_HPP
+#include "../math/rect.hpp"
+
+class SceneGraph;
+
/** */
class SceneNode
{
private:
public:
SceneNode();
- ~SceneNode();
+ virtual ~SceneNode();
/** Return the area that the SceneNode covers on the screen */
virtual Rect get_screen_rect() const =0;
- virtual bool has_changed() const =0;
+ /** Mark regions for update */
+ virtual void mark(SceneGraph* graph) =0;
+ virtual void render(SceneGraph* graph) =0;
+
private:
SceneNode (const SceneNode&);
SceneNode& operator= (const SceneNode&);
Modified: branches/pingus_sdl/src/display/sprite_node.cxx
===================================================================
--- branches/pingus_sdl/src/display/sprite_node.cxx 2006-04-24 04:00:19 UTC
(rev 2635)
+++ branches/pingus_sdl/src/display/sprite_node.cxx 2007-01-13 10:36:59 UTC
(rev 2636)
@@ -18,8 +18,13 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <SDL.h>
+#include <SDL_image.h>
+#include <string>
+#include "scene_graph.hxx"
#include "sprite_node.hxx"
+extern SDL_Surface* global_screen;
+
SpriteNode::SpriteNode(const std::string resourcename)
{
surface = IMG_Load(resourcename.c_str());
@@ -31,27 +36,27 @@
}
void
-SpriteNode::set_pos(const Vector2& pos_)
+SpriteNode::set_pos(const Point& pos_)
{
+ if (pos != pos_) has_changed_ = true;
pos = pos_;
}
-Vector2
+Point
SpriteNode::get_pos() const
{
return pos;
}
void
-SpriteNode::render(SDL_Surface* screen)
+SpriteNode::render(SceneGraph* graph)
{
SDL_Rect dest;
dest.x = pos.x;
dest.y = pos.y;
- SDL_BlitSurface(surface, NULL
- screen, dest);
+ SDL_BlitSurface(surface, NULL, global_screen, &dest);
has_changed_ = false;
old_repeat = repeat;
@@ -83,10 +88,13 @@
}
void
-SpriteNode::set_pos(const Vector2& pos_)
+SpriteNode::mark(SceneGraph* graph)
{
- if (pos != pos_) has_changed_ = true;
- pos = pos_;
+ if (has_changed_)
+ {
+ graph->mark_screen_region(this, get_old_screen_rect());
+ graph->mark_screen_region(this, get_screen_rect());
+ }
}
void
Modified: branches/pingus_sdl/src/display/sprite_node.hxx
===================================================================
--- branches/pingus_sdl/src/display/sprite_node.hxx 2006-04-24 04:00:19 UTC
(rev 2635)
+++ branches/pingus_sdl/src/display/sprite_node.hxx 2007-01-13 10:36:59 UTC
(rev 2636)
@@ -17,16 +17,16 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#include "vector2.hxx"
+#include "../math/point.hpp"
#include "scene_node.hxx"
class SpriteNode : public SceneNode
{
private:
- Vector2 pos;
+ Point pos;
Rect repeat;
- Vector2 old_pos;
+ Point old_pos;
Rect old_repeat;
SDL_Surface* surface;
@@ -39,9 +39,11 @@
bool has_changed() const;
Rect get_screen_rect() const;
Rect get_old_screen_rect() const;
+
+ void mark(SceneGraph* graph);
- void set_pos(const Vector2& pos);
- Vector2 get_pos() const;
+ void set_pos(const Point& pos);
+ Point get_pos() const;
void set_left_repeat(int left);
void set_right_repeat(int right);
@@ -56,7 +58,7 @@
int get_bottom_repeat(int bottom) const;
/** Draw the SDL_Surface to the screen */
- void render(SDL_Surface* screen);
+ void render(SceneGraph* graph);
};
/* EOF */
Modified: branches/pingus_sdl/src/editor/level_objs.cxx
===================================================================
--- branches/pingus_sdl/src/editor/level_objs.cxx 2006-04-24 04:00:19 UTC
(rev 2635)
+++ branches/pingus_sdl/src/editor/level_objs.cxx 2007-01-13 10:36:59 UTC
(rev 2636)
@@ -160,8 +160,11 @@
h = (float)CL_Display::get_height();
}
- pb = Blitter::scale_surface_to_canvas(
- sprite.get_frame_pixeldata(0), (int)w, (int)h);
+ //FIXME: Sat Jan 13 10:26:15 2007
+ assert(0);
+ // pb = Blitter::scale_surface_to_canvas(
+ // sprite.get_frame_pixeldata(0), (int)w, (int)h);
+
}
else // No stretch involved
pb = Resource::load_pixelbuffer(desc);
Modified: branches/pingus_sdl/src/file_reader.hxx
===================================================================
--- branches/pingus_sdl/src/file_reader.hxx 2006-04-24 04:00:19 UTC (rev
2635)
+++ branches/pingus_sdl/src/file_reader.hxx 2007-01-13 10:36:59 UTC (rev
2636)
@@ -22,7 +22,7 @@
#include <string>
#include <vector>
-#include <ClanLib/Core/System/sharedptr.h>
+#include "shared_ptr.hxx"
class CL_Size;
class CL_Sizef;
@@ -39,7 +39,7 @@
class FileReader
{
public:
- FileReader(CL_SharedPtr<FileReaderImpl> impl_);
+ FileReader(SharedPtr<FileReaderImpl> impl_);
FileReader();
/** Name of the current section, ie. in the case of
@@ -73,7 +73,7 @@
std::vector<std::string> get_section_names() const;
std::vector<FileReader> get_sections() const;
private:
- CL_SharedPtr<FileReaderImpl> impl;
+ SharedPtr<FileReaderImpl> impl;
};
} // namespace Pingus
Modified: branches/pingus_sdl/src/fonts.hxx
===================================================================
--- branches/pingus_sdl/src/fonts.hxx 2006-04-24 04:00:19 UTC (rev 2635)
+++ branches/pingus_sdl/src/fonts.hxx 2007-01-13 10:36:59 UTC (rev 2636)
@@ -20,7 +20,6 @@
#ifndef HEADER_PINGUS_FONTS_HXX
#define HEADER_PINGUS_FONTS_HXX
-#include <ClanLib/Display/font.h>
#include "display/drawing_context.hxx"
namespace Pingus {
@@ -28,20 +27,20 @@
extern std::string encoding;
-extern CL_Font chalk_large;
-extern CL_Font chalk_normal;
-extern CL_Font chalk_small;
+// extern CL_Font chalk_large;
+// extern CL_Font chalk_normal;
+// extern CL_Font chalk_small;
-extern CL_Font courier_small;
+// extern CL_Font courier_small;
-extern CL_Font pingus_small;
-extern CL_Font pingus_small_fix_num;
-extern CL_Font pingus_large;
+// extern CL_Font pingus_small;
+// extern CL_Font pingus_small_fix_num;
+// extern CL_Font pingus_large;
-extern CL_Font smallfont;
-extern CL_Font smallfont_h;
-extern CL_Font xterm;
-extern CL_Font lcd;
+// extern CL_Font smallfont;
+// extern CL_Font smallfont_h;
+// extern CL_Font xterm;
+// extern CL_Font lcd;
/** Load all fonts */
void init ();
Modified: branches/pingus_sdl/src/fps_counter.hxx
===================================================================
--- branches/pingus_sdl/src/fps_counter.hxx 2006-04-24 04:00:19 UTC (rev
2635)
+++ branches/pingus_sdl/src/fps_counter.hxx 2007-01-13 10:36:59 UTC (rev
2636)
@@ -20,7 +20,6 @@
#ifndef HEADER_PINGUS_FPS_COUNTER_HXX
#define HEADER_PINGUS_FPS_COUNTER_HXX
-#include <ClanLib/Display/font.h>
#include "gui/display.hxx"
namespace Pingus {
Modified: branches/pingus_sdl/src/gui/cursor.cxx
===================================================================
--- branches/pingus_sdl/src/gui/cursor.cxx 2006-04-24 04:00:19 UTC (rev
2635)
+++ branches/pingus_sdl/src/gui/cursor.cxx 2007-01-13 10:36:59 UTC (rev
2636)
@@ -25,7 +25,7 @@
namespace Pingus {
Cursor::Cursor(const std::string& ident)
- : sprite(Resource::load_sprite(ident))
+// : sprite(Resource::load_sprite(ident))
{
}
@@ -43,8 +43,8 @@
Cursor::on_event()
{
const Input::Pointer* pointer =
Input::Controller::get_current()->get_pointer();
- sprite.draw(pointer->get_x_pos (),
- pointer->get_y_pos ());
+ // sprite.draw(pointer->get_x_pos (),
+ // pointer->get_y_pos ());
}
} // namespace Pingus
Modified: branches/pingus_sdl/src/gui/cursor.hxx
===================================================================
--- branches/pingus_sdl/src/gui/cursor.hxx 2006-04-24 04:00:19 UTC (rev
2635)
+++ branches/pingus_sdl/src/gui/cursor.hxx 2007-01-13 10:36:59 UTC (rev
2636)
@@ -21,7 +21,6 @@
#define HEADER_PINGUS_CURSOR_HXX
#include <string>
-#include <ClanLib/Display/sprite.h>
#include "display.hxx"
namespace Pingus {
@@ -32,7 +31,7 @@
class Cursor : public DisplayHook
{
private:
- CL_Sprite sprite;
+ ///CL_Sprite sprite;
public:
Cursor (const std::string& ident);
Modified: branches/pingus_sdl/src/gui/display.cxx
===================================================================
--- branches/pingus_sdl/src/gui/display.cxx 2006-04-24 04:00:19 UTC (rev
2635)
+++ branches/pingus_sdl/src/gui/display.cxx 2007-01-13 10:36:59 UTC (rev
2636)
@@ -20,7 +20,6 @@
#include <algorithm>
#include <stdio.h>
#include <iostream>
-#include <ClanLib/Display/display.h>
#include "../globals.hxx"
#include "display.hxx"
@@ -46,10 +45,12 @@
void
Display::draw_rect(int x1, int y1, int x2, int y2, float r, float g, float b,
float a)
{
+#if 0
CL_Display::draw_line(x1, y1, x2, y1, CL_Color(CL_Colorf(r, g, b, a)));
CL_Display::draw_line(x1, y2, x2, y2, CL_Color(CL_Colorf(r, g, b, a)));
CL_Display::draw_line(x1, y1, x1, y2, CL_Color(CL_Colorf(r, g, b, a)));
CL_Display::draw_line(x2, y1, x2, y2, CL_Color(CL_Colorf(r, g, b, a)));
+#endif
}
void
@@ -62,7 +63,7 @@
(*i)->on_event();
}
- CL_Display::flip();
+ ////CL_Display::flip();
}
void
Modified: branches/pingus_sdl/src/gui/display.hxx
===================================================================
--- branches/pingus_sdl/src/gui/display.hxx 2006-04-24 04:00:19 UTC (rev
2635)
+++ branches/pingus_sdl/src/gui/display.hxx 2007-01-13 10:36:59 UTC (rev
2636)
@@ -21,7 +21,6 @@
#define HEADER_PINGUS_DISPLAY_HXX
#include "../pingus.hxx"
-#include <ClanLib/Display/color.h>
#include <list>
namespace Pingus {
Modified: branches/pingus_sdl/src/gui/screen_manager.cxx
===================================================================
--- branches/pingus_sdl/src/gui/screen_manager.cxx 2006-04-24 04:00:19 UTC
(rev 2635)
+++ branches/pingus_sdl/src/gui/screen_manager.cxx 2007-01-13 10:36:59 UTC
(rev 2636)
@@ -18,8 +18,6 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <iostream>
-#include <ClanLib/display.h>
-
#include "../globals.hxx"
#include "cursor.hxx"
#include "display.hxx"
@@ -42,28 +40,30 @@
display_gc = new DisplayGraphicContext(0, 0, CL_Display::get_width (),
CL_Display::get_height (),
0, 0);
#endif
- display_gc = new DrawingContext();
+//// display_gc = new DrawingContext();
cached_action = CA_NONE;
}
ScreenManager::~ScreenManager ()
{
- delete display_gc;
+//// delete display_gc;
}
void
ScreenManager::display ()
{
- Input::Controller* input_controller;
-
+#if 0
+ Input::Controller* input_controller = 0;
+#if 0
if (controller_file.empty())
input_controller = new
Input::Controller(path_manager.complete("controller/default.xml"));
else
input_controller = new Input::Controller(controller_file);
-
+#endif
Input::Controller::set_current(input_controller);
+#if 0
Cursor* cursor = 0;
if (swcursor_enabled)
{
@@ -71,6 +71,7 @@
Display::add_flip_screen_hook(cursor);
//CL_MouseCursor::hide();
}
+#endif
DeltaManager delta_manager;
@@ -88,7 +89,7 @@
}
// Let ClanLib fetch events
- CL_System::keep_alive ();
+ ///CL_System::keep_alive ();
// Get new events from ClanLib
input_controller->update(time_delta);
@@ -104,8 +105,10 @@
// Most likly the screen will get changed in this update call
get_current_screen()->update (delta);
+#if 0
if (cursor)
cursor->update(time_delta);
+#endif
// Last screen has poped, so we are going to end here
if (screens.empty ())
@@ -139,9 +142,9 @@
{
if (get_current_screen()->draw(*display_gc))
{
- display_gc->render(CL_Display::get_current_window()->get_gc());
+
////display_gc->render(CL_Display::get_current_window()->get_gc());
Display::flip_display ();
- display_gc->clear();
+ ////display_gc->clear();
}
}
else
@@ -151,12 +154,13 @@
}
// Stupid hack to make this thing take less CPU
- CL_System::keep_alive(5);
+ ////CL_System::keep_alive(5);
}
- Display::remove_flip_screen_hook(cursor);
- delete cursor;
+//// Display::remove_flip_screen_hook(cursor);
+//// delete cursor;
delete input_controller;
+#endif
}
ScreenPtr&
@@ -241,46 +245,48 @@
void
ScreenManager::fade_over (ScreenPtr& old_screen, ScreenPtr& new_screen)
{
- // FIXME: This entire function doesn't work very well.
- if (0)
- {
- DeltaManager delta_manager;
- float passed_time = 0;
+ // FIXME: This entire function doesn't work very well.
+#if 0
+ if (0)
+ {
+ DeltaManager delta_manager;
+ float passed_time = 0;
- //Input::EventLst events;
+ //Input::EventLst events;
- int screen_width = CL_Display::get_width ();
- int screen_height = CL_Display::get_height ();
- float progress = 0.0f;
- while (progress <= 1.0f)
- {
- float time_delta = delta_manager.getset ();
- passed_time += time_delta;
+ int screen_width = CL_Display::get_width ();
+ int screen_height = CL_Display::get_height ();
+ float progress = 0.0f;
+ while (progress <= 1.0f)
+ {
+ float time_delta = delta_manager.getset ();
+ passed_time += time_delta;
- int border_x = int((screen_width/2) * (1.0f - progress));
- int border_y = int((screen_height/2) * (1.0f - progress));
+ int border_x = int((screen_width/2) * (1.0f - progress));
+ int border_y = int((screen_height/2) * (1.0f - progress));
- old_screen->draw(*display_gc);
- CL_Display::get_current_window()->get_gc()
- ->push_cliprect(CL_Rect(0 + border_x,
- 0 + border_y,
- screen_width - border_x,
- screen_height - border_y));
- new_screen->draw(*display_gc);
+ old_screen->draw(*display_gc);
+ CL_Display::get_current_window()->get_gc()
+ ->push_cliprect(CL_Rect(0 + border_x,
+ 0 + border_y,
+ screen_width - border_x,
+ screen_height - border_y));
+ new_screen->draw(*display_gc);
- //GameDelta delta (time_delta, CL_System::get_time(), events);
- // FIXME: Animation looks nifty but doesn't work all that good
- //new_screen->update (delta);
- //old_screen->update (delta);
+ //GameDelta delta (time_delta, CL_System::get_time(), events);
+ // FIXME: Animation looks nifty but doesn't work all that good
+ //new_screen->update (delta);
+ //old_screen->update (delta);
- CL_Display::get_current_window()->get_gc()->pop_cliprect ();
+ CL_Display::get_current_window()->get_gc()->pop_cliprect ();
- Display::flip_display ();
- CL_System::keep_alive (5);
+ Display::flip_display ();
+ CL_System::keep_alive (5);
- progress = passed_time/1.0f;
+ progress = passed_time/1.0f;
+ }
}
- }
+#endif
}
void
Modified: branches/pingus_sdl/src/input/button.hxx
===================================================================
--- branches/pingus_sdl/src/input/button.hxx 2006-04-24 04:00:19 UTC (rev
2635)
+++ branches/pingus_sdl/src/input/button.hxx 2007-01-13 10:36:59 UTC (rev
2636)
@@ -20,7 +20,6 @@
#ifndef HEADER_PINGUS_INPUT_BUTTON_HXX
#define HEADER_PINGUS_INPUT_BUTTON_HXX
-#include <ClanLib/signals.h>
#include "../pingus.hxx"
namespace Pingus {
Modified: branches/pingus_sdl/src/input/controller.cxx
===================================================================
--- branches/pingus_sdl/src/input/controller.cxx 2006-04-24 04:00:19 UTC
(rev 2635)
+++ branches/pingus_sdl/src/input/controller.cxx 2007-01-13 10:36:59 UTC
(rev 2636)
@@ -20,24 +20,21 @@
#include "../debug.hxx"
#include "../pingus_error.hxx"
-#include <ClanLib/core.h>
-#include <ClanLib/display.h>
-#include <ClanLib/signals.h>
#include "controller.hxx"
#include "axes/dummy_axis.hxx"
-#include "buttons/dummy_button.hxx"
+////#include "buttons/dummy_button.hxx"
#include "pointers/dummy_pointer.hxx"
#include "scrollers/dummy_scroller.hxx"
#include "pointer_factory.hxx"
-#include "../xml_file_reader.hxx"
+////#include "../xml_file_reader.hxx"
#include "scroller_factory.hxx"
-#include "button_factory.hxx"
+////#include "button_factory.hxx"
namespace Pingus {
namespace Input {
using namespace Axes;
-using namespace Buttons;
+////using namespace Buttons;
using namespace Pointers;
using namespace Scrollers;
@@ -49,6 +46,7 @@
std_pointer_x(0),
std_pointer_y(0)
{
+#if 0
CL_InputSourceProvider_File provider(".");
CL_DomDocument doc(provider.open_source(configfile), true);
@@ -177,20 +175,24 @@
// Catch all keyboard input
CL_InputDevice keyboard =
CL_Display::get_current_window()->get_ic()->get_keyboard();
slots.push_back(keyboard.sig_key_down().connect(this,
&Controller::key_pressed));
+#endif
}
Controller::~Controller ()
{
+#if 0
delete scroller;
delete standard_pointer;
for (std::map<ButtonName, Button*>::iterator it = buttons.begin(); it !=
buttons.end(); ++it)
delete it->second;
+#endif
}
void
Controller::create_action_buttons (FileReader reader)
{
+#if 0
int count = 0;
const std::vector<FileReader>& sections = reader.get_sections();
@@ -205,11 +207,13 @@
+ i->get_name());
count += 1;
}
+#endif
}
void
Controller::update (float delta)
{
+#if 0
scroller ->update(delta);
standard_pointer->update(delta);
@@ -235,6 +239,7 @@
{
events.push_back(makeKeyboardEvent( keys_pressed[i] ));
}
+#endif
}
void
@@ -263,13 +268,13 @@
{
events.push_back(makeButtonEvent(name, released));
}
-
+#if 0
void
Controller::key_pressed(const CL_InputEvent &event)
{
keys += event.str;
}
-
+#endif
std::string
Controller::get_keys_pressed()
{
Modified: branches/pingus_sdl/src/input/controller.hxx
===================================================================
--- branches/pingus_sdl/src/input/controller.hxx 2006-04-24 04:00:19 UTC
(rev 2635)
+++ branches/pingus_sdl/src/input/controller.hxx 2007-01-13 10:36:59 UTC
(rev 2636)
@@ -24,8 +24,6 @@
#include <list>
#include <string>
#include <vector>
-#include <ClanLib/signals.h>
-#include <ClanLib/display.h>
#include "../file_reader.hxx"
#include "event.hxx"
@@ -50,7 +48,7 @@
float std_pointer_x;
float std_pointer_y;
- std::vector<CL_Slot> slots;
+ //// std::vector<CL_Slot> slots;
public:
Controller (const std::string& configfile);
@@ -76,7 +74,7 @@
void on_button_down(ButtonName name);
void on_button_up(ButtonName name);
void create_action_buttons (FileReader reader);
- void key_pressed(const CL_InputEvent &event);
+ ////void key_pressed(const CL_InputEvent &event);
/** Get keyboard keys pressed to handle general keyboard input */
std::string get_keys_pressed();
Modified: branches/pingus_sdl/src/level_result.cxx
===================================================================
--- branches/pingus_sdl/src/level_result.cxx 2006-04-24 04:00:19 UTC (rev
2635)
+++ branches/pingus_sdl/src/level_result.cxx 2007-01-13 10:36:59 UTC (rev
2636)
@@ -31,7 +31,7 @@
#include "pingu_holder.hxx"
#include "fonts.hxx"
#include "gettext.h"
-#include "input\controller.hxx"
+#include "input/controller.hxx"
namespace Pingus {
Modified: branches/pingus_sdl/src/pingus_main.cxx
===================================================================
--- branches/pingus_sdl/src/pingus_main.cxx 2006-04-24 04:00:19 UTC (rev
2635)
+++ branches/pingus_sdl/src/pingus_main.cxx 2007-01-13 10:36:59 UTC (rev
2636)
@@ -28,49 +28,55 @@
#include <stdio.h>
#include <signal.h>
#include <locale.h>
+#include <iostream>
-#include <ClanLib/display.h>
-#include <ClanLib/sound.h>
-#include <ClanLib/core.h>
-#include <ClanLib/sdl.h>
-#include <ClanLib/gl.h>
-#include <ClanLib/gui.h>
+#include "SDL.h"
+//#include <ClanLib/display.h>
+//#include <ClanLib/sound.h>
+//#include <ClanLib/core.h>
+//#include <ClanLib/sdl.h>
+//#include <ClanLib/gl.h>
+//#include <ClanLib/gui.h>
+
#include "gettext.h"
-#include "gui/screen_manager.hxx"
-#include "gui/input_debug_screen.hxx"
+#include "command_line.hpp"
+
+//#include "gui/screen_manager.hxx"
+// #include "gui/input_debug_screen.hxx"
#include "path_manager.hxx"
#include "pingus_main.hxx"
#include "globals.hxx"
#include "system.hxx"
#include "pingus_error.hxx"
-#include "global_event.hxx"
+// #include "global_event.hxx"
#include "config.hxx"
#include "console.hxx"
-#include "fps_counter.hxx"
-#include "plf_res_mgr.hxx"
-#include "game_session.hxx"
-#include "story_screen.hxx"
-#include "start_screen.hxx"
-#include "savegame_manager.hxx"
-#include "stat_manager.hxx"
-#include "demo_session.hxx"
+// #include "fps_counter.hxx"
+// #include "plf_res_mgr.hxx"
+// #include "game_session.hxx"
+// #include "story_screen.hxx"
+// #include "start_screen.hxx"
+// #include "savegame_manager.hxx"
+// #include "stat_manager.hxx"
+// #include "demo_session.hxx"
#include "debug.hxx"
-#include "fonts.hxx"
-#include "pingus_menu_manager.hxx"
-#include "resource.hxx"
-#include "pingu_action_factory.hxx"
-#include "credits.hxx"
-#include "sound/sound.hxx"
-#include "worldmap/manager.hxx"
+//#include "fonts.hxx"
+// #include "pingus_menu_manager.hxx"
+// #include "resource.hxx"
+// #include "pingu_action_factory.hxx"
+// #include "credits.hxx"
+// #include "sound/sound.hxx"
+// #include "worldmap/manager.hxx"
#include "cheat.hxx"
-#include "blitter_test.hxx"
-#include "preview_renderer.hxx"
-#include "worldmap/manager.hxx"
-#include "worldobj_factory.hxx"
-#include "editor/editor_screen.hxx"
+// #include "blitter_test.hxx"
+// #include "preview_renderer.hxx"
+// #include "worldmap/manager.hxx"
+// #include "worldobj_factory.hxx"
+// #include "editor/editor_screen.hxx"
+
#if _MSC_VER >= 1400
// Disable stupid deprecation warnings
#pragma warning( disable : 4996 )
@@ -124,7 +130,7 @@
PingusMain::PingusMain() :
blitter_test(false),
show_credits(false),
- editor(false),
+ editor(false),
refresh_rate(60)
{
}
@@ -186,7 +192,7 @@
cursor_enabled = true;
#endif
- CL_CommandLine argp;
+ CommandLine argp;
argp.add_usage("pingus [OPTIONS]... [FILES]...");
argp.add_doc("Pingus is a puzzle game where you need to guide a bunch of
little penguins around the world.");
@@ -199,7 +205,7 @@
_("Disable intro"));
argp.add_option('G', "use-opengl", "",
_("Use OpenGL"));
- argp.add_option('S', "use-sdl", "",
+ argp.add_option('S', "use-sdl", "",
_("Use SDL"));
argp.add_option('w', "window", "",
_("Start in Window Mode"));
@@ -213,7 +219,7 @@
_("Load a custom level from FILE"));
argp.add_option(358, "worldmap", _("FILE"),
_("Load a custom worldmap from FILE"));
- argp.add_option('e', "editor", "",
+ argp.add_option('e', "editor", "",
_("Loads the level editor"));
argp.add_option('v', "verbose", "",
_("Print some more messages to stdout, can be set multiple
times to increase verbosity"));
@@ -297,9 +303,9 @@
case 'l': // -l, --level
levelfile = argp.get_argument();
break;
-
- case 'e': // -e, --editor
- editor = true;
+
+ case 'e': // -e, --editor
+ editor = true;
case 't': // -t, --set-speed
game_speed = atoi(argp.get_argument().c_str());
@@ -309,9 +315,9 @@
use_opengl = true;
break;
- case 'S':
- use_opengl = false;
- break;
+ case 'S':
+ use_opengl = false;
+ break;
case 's': // -s, --disable-sound
sound_enabled = false;
@@ -518,7 +524,7 @@
exit(EXIT_SUCCESS);
break;
- case CL_CommandLine::REST_ARG:
+ case CommandLine::REST_ARG:
if (levelfile.empty())
{
levelfile = argp.get_argument();
@@ -562,28 +568,28 @@
char resource_path[PATH_MAX];
CFURLRef ref = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle());
if (!ref || !CFURLGetFileSystemRepresentation(ref, true,
(UInt8*)resource_path, PATH_MAX))
- {
- std::cout << "Error: Couldn't get Resources path.\n" << std::endl;
- exit(EXIT_FAILURE);
- }
+ {
+ std::cout << "Error: Couldn't get Resources path.\n" << std::endl;
+ exit(EXIT_FAILURE);
+ }
CFRelease(ref);
- path_manager.add_path(CL_String::get_path(std::string(resource_path) +
"/data/"));
+ //path_manager.add_path(CL_String::get_path(std::string(resource_path) +
"/data/"));
#else
- path_manager.add_path(CL_String::get_path(CL_System::get_exe_path() +
"/data/"));
- path_manager.add_path(CL_String::get_path(CL_System::get_exe_path() +
"/../data/"));
- path_manager.add_path(CL_String::get_path(CL_System::get_exe_path() +
"/../share/games/pingus/"));
+ //path_manager.add_path(CL_String::get_path(CL_System::get_exe_path() +
"/data/"));
+ //path_manager.add_path(CL_String::get_path(CL_System::get_exe_path() +
"/../data/"));
+ //path_manager.add_path(CL_String::get_path(CL_System::get_exe_path() +
"/../share/games/pingus/"));
#endif
std::list<std::string> file_list;
file_list.push_back ("data/core.xml");
- if (!path_manager.find_path (file_list))
- {
- std::cout << "Error: Couldn't find 'data/core.xml', please set the
enviroment variable\n"
- << "PINGUS_DATADIR to the path of the file `data/core.scr' or
use the\n"
- << "-d option." << std::endl;
- exit(EXIT_FAILURE);
- }
+// if (!path_manager.find_path (file_list))
+// {
+// std::cout << "Error: Couldn't find 'data/core.xml', please set the
enviroment variable\n"
+// << "PINGUS_DATADIR to the path of the file `data/core.scr'
or use the\n"
+// << "-d option." << std::endl;
+// exit(EXIT_FAILURE);
+// }
dictionary_manager.add_directory(path_manager.complete("po/"));
// Language is automatically picked from env variable
@@ -593,25 +599,25 @@
if(!lang) lang = getenv("LC_MESSAGES");
if(!lang) lang = getenv("LANG");
if(lang)
- {
- std::string language(lang);
- language.resize(2);
- if(language == "cs" || language == "sr")
{
- dictionary_manager.set_charset("ISO-8859-2");
- Pingus::Fonts::encoding = "ISO-8859-2";
+ std::string language(lang);
+ language.resize(2);
+ if(language == "cs" || language == "sr")
+ {
+ dictionary_manager.set_charset("ISO-8859-2");
+ //Pingus::Fonts::encoding = "ISO-8859-2";
+ }
+ else if(language == "tr")
+ {
+ dictionary_manager.set_charset("ISO-8859-9");
+ //Pingus::Fonts::encoding = "ISO-8859-9";
+ }
+ else
+ {
+ dictionary_manager.set_charset("ISO-8859-1");
+ //Pingus::Fonts::encoding = "ISO-8859-1";
+ }
}
- else if(language == "tr")
- {
- dictionary_manager.set_charset("ISO-8859-9");
- Pingus::Fonts::encoding = "ISO-8859-9";
- }
- else
- {
- dictionary_manager.set_charset("ISO-8859-1");
- Pingus::Fonts::encoding = "ISO-8859-1";
- }
- }
if (maintainer_mode)
std::cout << "BasePath: " << path_manager.get_base_path () << std::endl;
@@ -664,7 +670,7 @@
<< (fullscreen_enabled ? _(" enabled") : _("disabled"))
<< std::endl;
std::cout << _("refresh rate: ") << refresh_rate << std::endl;
- std::cout << _("using OpenGL: ") << use_opengl << std::endl;
+ std::cout << _("using OpenGL: ") << use_opengl << std::endl;
std::cout << std::endl;
}
@@ -673,23 +679,23 @@
PingusMain::start_game ()
{
if (verbose) {
- pout << _("PingusMain: Starting Main: ") << CL_System::get_time() <<
std::endl;
+ pout << _("PingusMain: Starting Main: ") << SDL_GetTicks() << std::endl;
}
- if (print_fps)
- Display::add_flip_screen_hook(&fps_counter);
+ //if (print_fps)
+ // Display::add_flip_screen_hook(&fps_counter);
if (!render_preview)
{
// Register the global event catcher
- on_button_press_slot =
window->get_ic()->get_keyboard().sig_key_down().connect (&global_event,
&GlobalEvent::on_button_press);
- on_button_release_slot =
window->get_ic()->get_keyboard().sig_key_up().connect (&global_event,
&GlobalEvent::on_button_release);
+ //on_button_press_slot =
window->get_ic()->get_keyboard().sig_key_down().connect (&global_event,
&GlobalEvent::on_button_press);
+ //on_button_release_slot =
window->get_ic()->get_keyboard().sig_key_up().connect (&global_event,
&GlobalEvent::on_button_release);
}
// Set the root screen
if (show_input_debug_screen) // show a debug screen
{
- ScreenManager::instance()->push_screen(new InputDebugScreen (), true);
+ //ScreenManager::instance()->push_screen(new InputDebugScreen (), true);
}
else if (render_preview)
{
@@ -699,13 +705,13 @@
}
else
{
- PreviewRenderer::render(PLFResMgr::load_plf_from_filename(levelfile),
- preview_file);
+
//PreviewRenderer::render(PLFResMgr::load_plf_from_filename(levelfile),
+ // preview_file);
}
}
else if (show_credits)
{
- ScreenManager::instance()->push_screen(Credits::instance(), false);
+ //ScreenManager::instance()->push_screen(Credits::instance(), false);
}
else if (!levelfile.empty ())
{
@@ -725,28 +731,28 @@
if (successfull)
{
- ScreenManager::instance()->push_screen
- (new StartScreen(PLFResMgr::load_plf_from_filename(levelfile)),
- true);
+ //ScreenManager::instance()->push_screen
+ //(new StartScreen(PLFResMgr::load_plf_from_filename(levelfile)),
+ // true);
}
}
else if (!demo_file.empty()) // start a demo
{
- ScreenManager::instance()->push_screen(new DemoSession (demo_file));
+ //ScreenManager::instance()->push_screen(new DemoSession (demo_file));
}
else if (!worldmapfile.empty())
{
- WorldMapNS::WorldMapManager::instance()->load(worldmapfile);
-
ScreenManager::instance()->push_screen(WorldMapNS::WorldMapManager::instance());
+ //WorldMapNS::WorldMapManager::instance()->load(worldmapfile);
+
//ScreenManager::instance()->push_screen(WorldMapNS::WorldMapManager::instance());
}
- else if (editor == true)
- {
- ScreenManager::instance()->push_screen (new
Editor::EditorScreen());
- }
+ else if (editor == true)
+ {
+ //ScreenManager::instance()->push_screen (new Editor::EditorScreen());
+ }
else // start a normal game
{
- ScreenManager::instance()->push_screen (PingusMenuManager::instance (),
false);
- //ScreenManager::instance()->push_screen (new StoryScreen(), true);
+ ////ScreenManager::instance()->push_screen (PingusMenuManager::instance
(), false);
+ ////ScreenManager::instance()->push_screen (new StoryScreen(), true);
}
if (!render_preview)
@@ -754,13 +760,13 @@
// show the main menu, the rest of the game is spawn from there
if (maintainer_mode)
std::cout << "PingusMain::start screen manager" << std::endl;
- ScreenManager::instance ()->display ();
+ ////ScreenManager::instance()->display();
if (maintainer_mode)
std::cout << "PingusMain::quit game and screen_manager" << std::endl;
// unregister the global event catcher
-
window->get_ic()->get_keyboard().sig_key_down().disconnect(on_button_press_slot);
-
window->get_ic()->get_keyboard().sig_key_up().disconnect(on_button_release_slot);
+
////window->get_ic()->get_keyboard().sig_key_down().disconnect(on_button_press_slot);
+
////window->get_ic()->get_keyboard().sig_key_up().disconnect(on_button_release_slot);
}
}
@@ -775,12 +781,6 @@
#endif
//signal(SIGINT, signal_handler);
- // Redirect stdout to somewhere where it is readable
-#if defined WIN32 && defined _DEBUG
- CL_ConsoleWindow cl_console(PACKAGE VERSION);
- cl_console.redirect_stdio();
-#endif
-
// Init error/warning/notice streams
pout.add (std::cout);
pout.add (console);
@@ -805,14 +805,14 @@
// Avoid uglyness on window opening
if (!render_preview)
{
- CL_Display::clear();
- CL_Display::flip();
+ ////CL_Display::clear();
+ ////CL_Display::flip();
}
if (blitter_test)
{
- BlitterTest test;
- test.run();
+ ////BlitterTest test;
+ ////test.run();
}
else
{
@@ -820,9 +820,9 @@
}
}
- catch (const CL_Error& err) {
- std::cout << _("Error caught from ClanLib: ") << err.message << std::endl;
- }
+ ////catch (const CL_Error& err) {
+ ////std::cout << _("Error caught from ClanLib: ") << err.message <<
std::endl;
+////}
catch (const PingusError& err) {
std::cout << _("Error caught from Pingus: ") << err.get_message () <<
std::endl;
@@ -851,8 +851,32 @@
}
void
+PingusMain::init_sdl()
+{
+ if (SDL_Init(SDL_INIT_VIDEO) != 0) {
+ std::cout << "Unable to initialize SDL: " << SDL_GetError() << std::endl;
+ exit(1);
+ }
+ atexit(SDL_Quit);
+
+ SDL_Surface *screen;
+
+ screen = SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF | SDL_FULLSCREEN);
+ if (screen == NULL) {
+ printf("Unable to set video mode: %s\n", SDL_GetError());
+ exit(1);
+ }
+}
+
+void
+PingusMain::deinit_sdl()
+{
+}
+
+void
PingusMain::init_clanlib()
{
+#if 0
if (render_preview)
{
CL_SetupCore::init ();
@@ -881,25 +905,27 @@
window_desc.set_refresh_rate(refresh_rate);
window = new CL_DisplayWindow(window_desc);
-
- CL_Display::clear();
- CL_Display::flip();
+
+ //CL_Display::clear();
+ // CL_Display::flip();
}
CL_SetupGUI::init ();
on_exit_press_slot = window->sig_window_close().connect(this,
&PingusMain::on_exit_press);
+#endif
}
void
PingusMain::on_exit_press()
{
std::cout << "Exit pressed" << std::endl;
- ScreenManager::instance()->clear();
+ ////ScreenManager::instance()->clear();
}
void
PingusMain::deinit_clanlib()
{
+#if 0
CL_SetupCore::deinit();
CL_SetupGUI::deinit ();
@@ -909,46 +935,53 @@
CL_SetupSDL::deinit();
CL_SetupDisplay::deinit ();
+#endif
}
void
PingusMain::init_pingus()
{
- SavegameManager::instance();
- StatManager::init();
+//// SavegameManager::instance();
+//// StatManager::init();
- Resource::init();
- Fonts::init();
- ScreenManager::init();
- PingusMenuManager::init();
- Sound::PingusSound::init();
- PinguActionFactory::init();
- Credits::init();
- WorldMapNS::WorldMapManager::instance();
+//// Resource::init();
+//// Fonts::init();
+//// ScreenManager::init();
+//// PingusMenuManager::init();
+//// Sound::PingusSound::init();
+//// PinguActionFactory::init();
+//// Credits::init();
+//// WorldMapNS::WorldMapManager::instance();
- fps_counter.init();
+//// fps_counter.init();
console.init();
}
void
PingusMain::deinit_pingus()
{
- fps_counter.deinit();
- console.deinit();
+//// fps_counter.deinit();
+ console.deinit();
- Fonts::deinit();
- Credits::deinit();
- PinguActionFactory::deinit();
- Sound::PingusSound::deinit();
- PingusMenuManager::deinit();
- WorldObjFactory::deinit();
- WorldMapNS::WorldMapManager::deinit();
- ScreenManager::deinit();
- StatManager::deinit();
- SavegameManager::deinit();
- Resource::deinit();
+//// Fonts::deinit();
+//// Credits::deinit();
+//// PinguActionFactory::deinit();
+//// Sound::PingusSound::deinit();
+//// PingusMenuManager::deinit();
+//// WorldObjFactory::deinit();
+//// WorldMapNS::WorldMapManager::deinit();
+//// ScreenManager::deinit();
+//// StatManager::deinit();
+//// SavegameManager::deinit();
+//// Resource::deinit();
}
} // namespace Pingus
+int main(int argc, char** argv)
+{
+ Pingus::PingusMain app;
+ return app.main(argc, argv);
+}
+
/* EOF */
Modified: branches/pingus_sdl/src/pingus_main.hxx
===================================================================
--- branches/pingus_sdl/src/pingus_main.hxx 2006-04-24 04:00:19 UTC (rev
2635)
+++ branches/pingus_sdl/src/pingus_main.hxx 2007-01-13 10:36:59 UTC (rev
2636)
@@ -21,18 +21,17 @@
#define HEADER_PINGUS_PINGUS_MAIN_HXX
#include <string>
-#include <ClanLib/Signals/slot.h>
-#include <ClanLib/application.h>
#include "pingus.hxx"
+#include "SDL.h"
void segfault_handler(int);
namespace Pingus {
-class PingusMain : public CL_ClanApplication
+class PingusMain
{
private:
- CL_DisplayWindow* window;
+ SDL_Surface* screen;
bool blitter_test;
bool no_config_file;
@@ -50,10 +49,6 @@
std::string resolution;
int refresh_rate;
- CL_Slot on_button_press_slot;
- CL_Slot on_button_release_slot;
-
- CL_Slot on_exit_press_slot;
public:
PingusMain();
virtual ~PingusMain();
@@ -78,6 +73,9 @@
void init_clanlib();
void deinit_clanlib();
+ void init_sdl();
+ void deinit_sdl();
+
void init_pingus();
void init_path_finder();
void deinit_pingus();
Modified: branches/pingus_sdl/src/resource.cxx
===================================================================
--- branches/pingus_sdl/src/resource.cxx 2006-04-24 04:00:19 UTC (rev
2635)
+++ branches/pingus_sdl/src/resource.cxx 2007-01-13 10:36:59 UTC (rev
2636)
@@ -74,10 +74,10 @@
std::vector<std::string>
Resource::get_resources(const std::string& type, const std::string& section)
{
- if (section == "")
- return resmgr.get_resources_of_type(type);
- else
- return resmgr.get_resources_of_type(type, section);
+ if (section == "")
+ return resmgr.get_resources_of_type(type);
+ else
+ return resmgr.get_resources_of_type(type, section);
}
@@ -85,17 +85,17 @@
std::vector<std::string>
Resource::get_sections(const std::string& section)
{
- if (section == std::string())
- return resmgr.get_all_sections();
- else
- return resmgr.get_sections(section);
+ if (section == std::string())
+ return resmgr.get_all_sections();
+ else
+ return resmgr.get_sections(section);
}
void
Resource::deinit()
{
- cleanup();
+ cleanup();
surface_map.clear();
}
@@ -311,45 +311,45 @@
void
Resource::cleanup ()
{
- CL_Resource res;
- std::vector<std::string> resources = resmgr.get_all_resources();
- for (std::vector<std::string>::iterator i = resources.begin(); i !=
resources.end(); i++)
- {
- res = resmgr.get_resource(*i);
- while (res.get_reference_count() > 0)
- res.unload();
- }
+ CL_Resource res;
+ std::vector<std::string> resources = resmgr.get_all_resources();
+ for (std::vector<std::string>::iterator i = resources.begin(); i !=
resources.end(); i++)
+ {
+ res = resmgr.get_resource(*i);
+ while (res.get_reference_count() > 0)
+ res.unload();
+ }
}
unsigned int
Resource::get_mtime (const std::string& res_name)
{
- /*
- try
+ /*
+ try
{
- CL_ResourceManager res_man = Resource::get(datafile);
+ CL_ResourceManager res_man = Resource::get(datafile);
- CL_Resource& res = res_man->get_resource(res_name);
+ CL_Resource& res = res_man->get_resource(res_name);
- std::string filename = res.get_full_location();
+ std::string filename = res.get_full_location();
-#ifndef WIN32
- struct stat stat_buf;
- if (stat(filename.c_str(), &stat_buf) == 0)
- return stat_buf.st_mtime;
- else
- return 0;
-#else
- // FIXME: Win32 mtime getter not implemented
- return 0;
+ #ifndef WIN32
+ struct stat stat_buf;
+ if (stat(filename.c_str(), &stat_buf) == 0)
+ return stat_buf.st_mtime;
+ else
+ return 0;
+ #else
+ // FIXME: Win32 mtime getter not implemented
+ return 0;
}
- catch (CL_Error& err)
+ catch (CL_Error& err)
{
- std::cout << "Resource::get_mtime: CL_Error: " << err.message <<
std::endl;
- return 0;
+ std::cout << "Resource::get_mtime: CL_Error: " << err.message << std::endl;
+ return 0;
}
-#endif
- */
+ #endif
+ */
return 0;
}
Modified: branches/pingus_sdl/src/system.cxx
===================================================================
--- branches/pingus_sdl/src/system.cxx 2006-04-24 04:00:19 UTC (rev 2635)
+++ branches/pingus_sdl/src/system.cxx 2007-01-13 10:36:59 UTC (rev 2636)
@@ -35,7 +35,7 @@
#endif
#include <iostream>
-#include <ClanLib/Core/System/clanstring.h>
+#include <sstream>
#include "pingus_error.hxx"
#include "globals.hxx"
@@ -454,8 +454,10 @@
while (bytes_read != 0);
fclose (in);
-
- return CL_String::to (checksum);
+
+ std::ostringstream str;
+ str << checksum;
+ return str.str();
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2636 - in branches/pingus_sdl/src: . actions display editor gui input,
grumbel at BerliOS <=