[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2660 - in branches/pingus_sdl/src: . gui
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r2660 - in branches/pingus_sdl/src: . gui |
Date: |
Mon, 15 Jan 2007 23:11:34 +0100 |
Author: grumbel
Date: 2007-01-15 23:11:33 +0100 (Mon, 15 Jan 2007)
New Revision: 2660
Modified:
branches/pingus_sdl/src/SConscript
branches/pingus_sdl/src/exit_menu.cxx
branches/pingus_sdl/src/gui/gui_screen.cxx
branches/pingus_sdl/src/gui/gui_screen.hxx
branches/pingus_sdl/src/gui/screen.hxx
branches/pingus_sdl/src/pingus_main.cxx
branches/pingus_sdl/src/pingus_menu_manager.hxx
branches/pingus_sdl/src/plf_res_mgr.cxx
branches/pingus_sdl/src/start_screen.cxx
Log:
- some more code is now compilable
Modified: branches/pingus_sdl/src/SConscript
===================================================================
--- branches/pingus_sdl/src/SConscript 2007-01-15 21:44:34 UTC (rev 2659)
+++ branches/pingus_sdl/src/SConscript 2007-01-15 22:11:33 UTC (rev 2660)
@@ -144,7 +144,7 @@
# 'game_counter.cxx',
# 'game_session.cxx',
# 'game_session_result.cxx',
-# 'game_time.cxx',
+'game_time.cxx',
'gettext.cxx',
# 'global_event.cxx',
'globals.cxx',
@@ -223,7 +223,7 @@
'pingus_menu.cxx',
'pingus_menu_manager.cxx',
'pingus_sub_menu.cxx',
-# 'plf_res_mgr.cxx',
+'plf_res_mgr.cxx',
# 'plt_xml.cxx',
# 'preview_renderer.cxx',
# 'range.cxx',
@@ -244,7 +244,7 @@
# 'sound/sound_real.cxx',
'sound/sound_res_mgr.cxx',
# 'ground_map.cxx',
-# 'start_screen.cxx',
+'start_screen.cxx',
'stat_manager.cxx',
'state_sprite.cxx',
# 'story_screen.cxx',
Modified: branches/pingus_sdl/src/exit_menu.cxx
===================================================================
--- branches/pingus_sdl/src/exit_menu.cxx 2007-01-15 21:44:34 UTC (rev
2659)
+++ branches/pingus_sdl/src/exit_menu.cxx 2007-01-15 22:11:33 UTC (rev
2660)
@@ -103,7 +103,7 @@
}
bool
-ExitMenu::draw (DrawingContext& gc)
+ExitMenu::draw(DrawingContext& gc)
{
//gc.draw_fillrect (0, 0, Display::get_width (), Display::get_height (),
//0, 0, 0, 0.5);
Modified: branches/pingus_sdl/src/gui/gui_screen.cxx
===================================================================
--- branches/pingus_sdl/src/gui/gui_screen.cxx 2007-01-15 21:44:34 UTC (rev
2659)
+++ branches/pingus_sdl/src/gui/gui_screen.cxx 2007-01-15 22:11:33 UTC (rev
2660)
@@ -35,7 +35,7 @@
/** Draw this screen */
bool
-GUIScreen::draw (DrawingContext& gc)
+GUIScreen::draw(DrawingContext& gc)
{
draw_background(gc);
gui_manager->draw(gc);
Modified: branches/pingus_sdl/src/gui/gui_screen.hxx
===================================================================
--- branches/pingus_sdl/src/gui/gui_screen.hxx 2007-01-15 21:44:34 UTC (rev
2659)
+++ branches/pingus_sdl/src/gui/gui_screen.hxx 2007-01-15 22:11:33 UTC (rev
2660)
@@ -43,7 +43,7 @@
/** Draw this screen */
virtual void draw_foreground (DrawingContext& gc) { UNUSED_ARG(gc); }
virtual void draw_background (DrawingContext& gc) { UNUSED_ARG(gc); }
- virtual bool draw (DrawingContext& gc);
+ virtual bool draw(DrawingContext& gc);
/** Pass a game delta to the screen */
virtual void update (const GameDelta& delta);
Modified: branches/pingus_sdl/src/gui/screen.hxx
===================================================================
--- branches/pingus_sdl/src/gui/screen.hxx 2007-01-15 21:44:34 UTC (rev
2659)
+++ branches/pingus_sdl/src/gui/screen.hxx 2007-01-15 22:11:33 UTC (rev
2660)
@@ -20,9 +20,9 @@
#ifndef HEADER_PINGUS_SCREEN_HXX
#define HEADER_PINGUS_SCREEN_HXX
+#include "SDL.h"
#include "game_delta.hxx"
-
class DrawingContext;
/** A interface for screens. A screen is a Pingus 'thing' which gets
@@ -38,7 +38,7 @@
/** Draw this screen @return true if draw was successfull, false if
frameskip has taken place ('causes a skip of flip_display) */
- virtual bool draw (DrawingContext& gc) =0;
+ virtual bool draw(DrawingContext& gc) =0;
/** Pass a delta to the screen */
virtual void update (const GameDelta& delta) =0;
Modified: branches/pingus_sdl/src/pingus_main.cxx
===================================================================
--- branches/pingus_sdl/src/pingus_main.cxx 2007-01-15 21:44:34 UTC (rev
2659)
+++ branches/pingus_sdl/src/pingus_main.cxx 2007-01-15 22:11:33 UTC (rev
2660)
@@ -59,10 +59,11 @@
#include "config.hxx"
#include "console.hxx"
// #include "fps_counter.hxx"
-// #include "plf_res_mgr.hxx"
+#include "plf_res_mgr.hxx"
// #include "game_session.hxx"
// #include "story_screen.hxx"
-// #include "start_screen.hxx"
+
+#include "start_screen.hxx"
// #include "savegame_manager.hxx"
// #include "stat_manager.hxx"
// #include "demo_session.hxx"
@@ -735,9 +736,9 @@
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
Modified: branches/pingus_sdl/src/pingus_menu_manager.hxx
===================================================================
--- branches/pingus_sdl/src/pingus_menu_manager.hxx 2007-01-15 21:44:34 UTC
(rev 2659)
+++ branches/pingus_sdl/src/pingus_menu_manager.hxx 2007-01-15 22:11:33 UTC
(rev 2660)
@@ -25,7 +25,6 @@
#include "pingus_menu.hxx"
#include "file_dialog.hxx"
-
class PingusSubMenu;
class PingusMenuManager : public Screen
Modified: branches/pingus_sdl/src/plf_res_mgr.cxx
===================================================================
--- branches/pingus_sdl/src/plf_res_mgr.cxx 2007-01-15 21:44:34 UTC (rev
2659)
+++ branches/pingus_sdl/src/plf_res_mgr.cxx 2007-01-15 22:11:33 UTC (rev
2660)
@@ -38,18 +38,19 @@
if (i == plf_map.end())
{ // Entry not cached, so load it and add it to cache
pout(PINGUS_DEBUG_LOADING) << "PLFResMgr: Loading level from DISK: '" <<
res_name << "' -> '" << filename << "'" << std::endl;
-
+#if 0
PingusLevel plf = XMLPingusLevel(res_name, filename);
+#endif
PLFEntry entry;
-
- entry.plf = plf;
+ ////entry.plf = plf;
entry.mtime = System::get_mtime(filename);
plf_map[res_name] = entry;
// FIXME: leaking pointers to the outsite work is not such a good
// idea, could lead to throuble sooner or later
+
return PingusLevel (entry.plf);
}
else
@@ -59,12 +60,13 @@
{
pout(PINGUS_DEBUG_LOADING) << "PLFResMgr: level changed on DISK,
reloading: '" << res_name << "' -> '" << filename << "'" << std::endl;
+#if 0
// Reload the file since it has changed on disk
PingusLevel plf = XMLPingusLevel(res_name, filename);
-
+#endif
PLFEntry entry;
- entry.plf = plf;
+ ////entry.plf = plf;
entry.mtime = System::get_mtime(filename);
plf_map[res_name] = entry;
Modified: branches/pingus_sdl/src/start_screen.cxx
===================================================================
--- branches/pingus_sdl/src/start_screen.cxx 2007-01-15 21:44:34 UTC (rev
2659)
+++ branches/pingus_sdl/src/start_screen.cxx 2007-01-15 22:11:33 UTC (rev
2660)
@@ -18,8 +18,6 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <iostream>
-#include <ClanLib/Core/System/clanstring.h>
-#include <ClanLib/Display/sprite_description.h>
#include "gui/gui_manager.hxx"
#include "gui/surface_button.hxx"
#include "gui/component.hxx"
@@ -36,13 +34,13 @@
#include "sound/sound.hxx"
#include "pingus_level.hxx"
#include "string_format.hxx"
+#include "gui/display.hxx"
-
class StartScreenComponent : public GUI::Component
{
private:
PingusLevel plf;
- CL_Sprite background;
+ Sprite background;
std::string time_str;
std::string description;
@@ -61,8 +59,8 @@
StartScreen* parent;
public:
StartScreenOkButton(StartScreen* p)
- : GUI::SurfaceButton(CL_Display::get_width()/2 + 225,
- CL_Display::get_height()/2 + 125,
+ : GUI::SurfaceButton(Display::get_width()/2 + 225,
+ Display::get_height()/2 + 125,
ResDescriptor("core/start/ok"),
ResDescriptor("core/start/ok_clicked"),
ResDescriptor("core/start/ok_hover")),
@@ -97,8 +95,8 @@
StartScreen* parent;
public:
StartScreenAbortButton(StartScreen* p)
- : GUI::SurfaceButton(CL_Display::get_width()/2 - 278,
- CL_Display::get_height()/2 + 144,
+ : GUI::SurfaceButton(Display::get_width()/2 - 278,
+ Display::get_height()/2 + 144,
ResDescriptor("core/start/back"),
ResDescriptor("core/start/back_clicked"),
ResDescriptor("core/start/back_hover")),
@@ -130,37 +128,42 @@
StartScreenComponent::StartScreenComponent(const PingusLevel& p)
: plf(p)
{
- if (CL_Display::get_width() == 800 && CL_Display::get_height() == 600)
- background = Resource::load_sprite("core/menu/startscreenbg");
- else
- {
- CL_PixelBuffer pb =
Blitter::scale_surface_to_canvas(Resource::load_pixelbuffer(
- "core/menu/startscreenbg"), CL_Display::get_width(),
CL_Display::get_height());
- CL_SpriteDescription desc;
- desc.add_frame(pb);
- background = CL_Sprite(desc);
- }
- background.set_alignment(origin_center);
+ if (Display::get_width() == 800 && Display::get_height() == 600)
+ {
+ background = Resource::load_sprite("core/menu/startscreenbg");
+ }
+ else
+ {
+#if 0
+ CL_PixelBuffer pb =
Blitter::scale_surface_to_canvas(Resource::load_pixelbuffer(
+
"core/menu/startscreenbg"), Display::get_width(), Display::get_height());
+ CL_SpriteDescription desc;
+ desc.add_frame(pb);
+ background = CL_Sprite(desc);
+#endif
+ }
+ ////background.set_alignment(origin_center);
time_str = GameTime::ticks_to_realtime_string(plf.get_time());
}
void
StartScreenComponent::draw(DrawingContext& gc)
{
-
background.draw((float)CL_Display::get_width()/2,(float)CL_Display::get_height()/2);
+ gc.draw(background, Display::get_width()/2, Display::get_height()/2);
- int left_x = CL_Display::get_width()/2 - 120;
- int right_x = CL_Display::get_width()/2 + 120;
- int y = CL_Display::get_height()/2 + 40;
+#if 0
+ int left_x = Display::get_width()/2 - 120;
+ int right_x = Display::get_width()/2 + 120;
+ int y = Display::get_height()/2 + 40;
gc.print_center(Fonts::chalk_large,
gc.get_width()/2,
- (float)CL_Display::get_height()/2 - 200,
+ (float)Display::get_height()/2 - 200,
_(plf.get_levelname()));
gc.print_left(Fonts::chalk_normal,
- (float)CL_Display::get_width()/2 - 290,
- (float)CL_Display::get_height()/2 - 140,
+ (float)Display::get_width()/2 - 290,
+ (float)Display::get_height()/2 - 140,
format_description(800 - 230));
gc.print_left (Fonts::chalk_normal, (float)left_x, (float)y, _("Number of
Pingus: "));
@@ -175,13 +178,14 @@
gc.print_left (Fonts::chalk_normal, (float)left_x, float(y += 30),
_("Difficulty:"));
gc.print_right(Fonts::chalk_normal, (float)right_x, (float)y,
CL_String::to(plf.get_difficulty()) + "/100");
- gc.print_center(Fonts::chalk_small, (float)CL_Display::get_width()/2,
- (float)CL_Display::get_height()/2 + 270, _("Author: ") +
plf.get_author());
+ gc.print_center(Fonts::chalk_small, (float)Display::get_width()/2,
+ (float)Display::get_height()/2 + 270, _("Author: ") +
plf.get_author());
if (maintainer_mode)
gc.print_left(Fonts::chalk_small, 110, 430, _("Filename: ") +
plf.get_resname());
CL_System::sleep(30);
+#endif
}
const std::string&
@@ -231,8 +235,10 @@
void
StartScreen::start_game()
{
+#if 0
PingusGameSession* game_session = new PingusGameSession(plf, true);
ScreenManager::instance()->replace_screen(game_session, true);
+#endif
}
void
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2660 - in branches/pingus_sdl/src: . gui,
grumbel at BerliOS <=