[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2812 - branches/pingus_sdl/src
From: |
jave27 |
Subject: |
[Pingus-CVS] r2812 - branches/pingus_sdl/src |
Date: |
Sun, 5 Aug 2007 19:59:52 +0200 |
Author: jave27
Date: 2007-08-05 19:59:48 +0200 (Sun, 05 Aug 2007)
New Revision: 2812
Modified:
branches/pingus_sdl/src/font.cpp
branches/pingus_sdl/src/fps_counter.cpp
branches/pingus_sdl/src/pingus_main.cpp
Log:
- Enable the fps_counter option.
- Move the fps counter over a bit so it's visible.
- If a target isn't specified in the Font::draw() function, use the default
display screen.
Modified: branches/pingus_sdl/src/font.cpp
===================================================================
--- branches/pingus_sdl/src/font.cpp 2007-08-05 16:24:26 UTC (rev 2811)
+++ branches/pingus_sdl/src/font.cpp 2007-08-05 17:59:48 UTC (rev 2812)
@@ -29,6 +29,7 @@
#include "SDL_image.h"
#include "font.hpp"
#include "font_description.hpp"
+#include "gui/display.hpp"
static bool vline_empty(SDL_Surface* surface, int x, Uint8 threshold)
{
@@ -171,6 +172,8 @@
int dstx = x - offset.x;
int dsty = y - offset.y;
+ if (!target) target = Display::get_screen();
+
for(std::string::size_type i = 0; i < text.size(); ++i)
{
if (text[i] == ' ')
Modified: branches/pingus_sdl/src/fps_counter.cpp
===================================================================
--- branches/pingus_sdl/src/fps_counter.cpp 2007-08-05 16:24:26 UTC (rev
2811)
+++ branches/pingus_sdl/src/fps_counter.cpp 2007-08-05 17:59:48 UTC (rev
2812)
@@ -70,7 +70,7 @@
odd_frame = true;
}
- font.draw(Display::get_width(),
+ font.draw(Display::get_width() - 100,
Display::get_height() - font.get_height(),
fps_string);
}
Modified: branches/pingus_sdl/src/pingus_main.cpp
===================================================================
--- branches/pingus_sdl/src/pingus_main.cpp 2007-08-05 16:24:26 UTC (rev
2811)
+++ branches/pingus_sdl/src/pingus_main.cpp 2007-08-05 17:59:48 UTC (rev
2812)
@@ -58,7 +58,7 @@
// #include "global_event.hpp"
#include "config.hpp"
#include "console.hpp"
-// #include "fps_counter.hpp"
+#include "fps_counter.hpp"
#include "plf_res_mgr.hpp"
#include "game_session.hpp"
#include "story_screen.hpp"
@@ -684,8 +684,8 @@
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)
{
@@ -894,14 +894,14 @@
Credits::init();
WorldMapNS::WorldMapManager::instance();
-//// fps_counter.init();
+ fps_counter.init();
console.init();
}
void
PingusMain::deinit_pingus()
{
-//// fps_counter.deinit();
+ fps_counter.deinit();
console.deinit();
Fonts::deinit();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2812 - branches/pingus_sdl/src,
jave27 <=