[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r4079 - in trunk/pingus/src: engine/display engine/screen e
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r4079 - in trunk/pingus/src: engine/display engine/screen engine/sound pingus pingus/actions pingus/components pingus/particles pingus/screens pingus/worldmap pingus/worldobjs util |
Date: |
Sun, 8 Nov 2009 15:55:24 +0100 |
Author: grumbel
Date: 2009-11-08 15:55:19 +0100 (Sun, 08 Nov 2009)
New Revision: 4079
Modified:
trunk/pingus/src/engine/display/display.cpp
trunk/pingus/src/engine/screen/screen_manager.cpp
trunk/pingus/src/engine/sound/sound.cpp
trunk/pingus/src/engine/sound/sound_real.cpp
trunk/pingus/src/pingus/actions/angel.cpp
trunk/pingus/src/pingus/capture_rectangle.cpp
trunk/pingus/src/pingus/components/check_box.cpp
trunk/pingus/src/pingus/components/choice_box.cpp
trunk/pingus/src/pingus/components/label.cpp
trunk/pingus/src/pingus/components/playfield.cpp
trunk/pingus/src/pingus/components/slider_box.cpp
trunk/pingus/src/pingus/components/time_display.cpp
trunk/pingus/src/pingus/config_manager.cpp
trunk/pingus/src/pingus/game_time.cpp
trunk/pingus/src/pingus/global_event.cpp
trunk/pingus/src/pingus/globals.cpp
trunk/pingus/src/pingus/globals.hpp
trunk/pingus/src/pingus/ground_map.cpp
trunk/pingus/src/pingus/layer_manager.hpp
trunk/pingus/src/pingus/particles/rain_particle_holder.cpp
trunk/pingus/src/pingus/pingus_main.cpp
trunk/pingus/src/pingus/screens/game_session.cpp
trunk/pingus/src/pingus/screens/level_menu.cpp
trunk/pingus/src/pingus/screens/pingus_menu.cpp
trunk/pingus/src/pingus/screens/start_screen.cpp
trunk/pingus/src/pingus/screens/story_screen.cpp
trunk/pingus/src/pingus/worldmap/level_dot.cpp
trunk/pingus/src/pingus/worldmap/path_graph.cpp
trunk/pingus/src/pingus/worldmap/worldmap.cpp
trunk/pingus/src/pingus/worldobjs/snow_generator.cpp
trunk/pingus/src/pingus/worldobjs/starfield_background_stars.cpp
trunk/pingus/src/pingus/worldobjs/surface_background.cpp
trunk/pingus/src/util/debug_stream.cpp
trunk/pingus/src/util/system.cpp
Log:
Moved stuff in pingus/debug.hpp into globals namespace
Modified: trunk/pingus/src/engine/display/display.cpp
===================================================================
--- trunk/pingus/src/engine/display/display.cpp 2009-11-08 13:45:53 UTC (rev
4078)
+++ trunk/pingus/src/engine/display/display.cpp 2009-11-08 14:55:19 UTC (rev
4079)
@@ -65,7 +65,7 @@
// FIXME: Calling this causes horrible flicker, since the screen
// goes black on a size change. Seems to be an SDL issue.
// This call also shouldn't be part of ScreenManager, but
Framebuffer/Display internal
- Display::set_video_mode(size, fullscreen_enabled);
+ Display::set_video_mode(size, globals::fullscreen_enabled);
if (ScreenManager::instance())
ScreenManager::instance()->resize(size);
@@ -76,7 +76,7 @@
{
if (!framebuffer.get())
{
- switch (framebuffer_type)
+ switch (globals::framebuffer_type)
{
case OPENGL_FRAMEBUFFER:
#ifdef HAVE_OPENGL
@@ -91,7 +91,7 @@
break;
case DELTA_FRAMEBUFFER:
- static_graphics = true;
+ globals::static_graphics = true;
framebuffer = std::auto_ptr<Framebuffer>(new DeltaFramebuffer());
break;
Modified: trunk/pingus/src/engine/screen/screen_manager.cpp
===================================================================
--- trunk/pingus/src/engine/screen/screen_manager.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/engine/screen/screen_manager.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -149,11 +149,11 @@
input_manager = std::auto_ptr<Input::Manager>(new Input::Manager());
- if (controller_file.empty())
+ if (globals::controller_file.empty())
input_controller =
std::auto_ptr<Input::Controller>(input_manager->create_controller(Pathname("controller/default.scm",
Pathname::DATA_PATH)));
else
- input_controller =
std::auto_ptr<Input::Controller>(input_manager->create_controller(Pathname(controller_file,
+ input_controller =
std::auto_ptr<Input::Controller>(input_manager->create_controller(Pathname(globals::controller_file,
Pathname::SYSTEM_PATH)));
cursor = Sprite("core/cursors/animcross");
@@ -168,7 +168,7 @@
void
ScreenManager::display()
{
- show_swcursor(swcursor_enabled);
+ show_swcursor(globals::swcursor_enabled);
Uint32 last_ticks = SDL_GetTicks();
float previous_frame_time;
@@ -208,13 +208,13 @@
write_events(std::cerr, events);
}
- if (swcursor_enabled)
+ if (globals::swcursor_enabled)
cursor.update(previous_frame_time);
// previous frame took more than one second
if (previous_frame_time > 1.0)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "ScreenManager: previous frame took longer than 1 second
(" << previous_frame_time
<< " sec.), ignoring and doing frameskip" << std::endl;
}
@@ -227,8 +227,8 @@
float current_frame_time = float(SDL_GetTicks() - last_ticks) / 1000.0f;
// idly delay if this frame didn't last long enough to
// achieve <desired_fps> frames per second
- if (current_frame_time < 1.0f / desired_fps) {
- Uint32 sleep_time = static_cast<Uint32>(1000 *((1.0f / desired_fps) -
current_frame_time));
+ if (current_frame_time < 1.0f / globals::desired_fps) {
+ Uint32 sleep_time = static_cast<Uint32>(1000 *((1.0f /
globals::desired_fps) - current_frame_time));
// std::cout << "Sleep: " << sleep_time << std::endl;
SDL_Delay(sleep_time);
}
@@ -276,11 +276,11 @@
display_gc->clear();
// Draw the mouse pointer
- if (swcursor_enabled)
+ if (globals::swcursor_enabled)
cursor.render(mouse_pos.x, mouse_pos.y, Display::get_framebuffer());
// Draw FPS Counter
- if (print_fps)
+ if (globals::print_fps)
fps_counter->draw();
Display::flip_display();
@@ -386,8 +386,9 @@
void
ScreenManager::show_swcursor(bool visible)
{
- swcursor_enabled = visible;
- if (swcursor_enabled)
+ globals::swcursor_enabled = visible;
+
+ if (globals::swcursor_enabled)
{
SDL_ShowCursor(SDL_DISABLE);
}
Modified: trunk/pingus/src/engine/sound/sound.cpp
===================================================================
--- trunk/pingus/src/engine/sound/sound.cpp 2009-11-08 13:45:53 UTC (rev
4078)
+++ trunk/pingus/src/engine/sound/sound.cpp 2009-11-08 14:55:19 UTC (rev
4079)
@@ -33,7 +33,7 @@
{
if (s == 0)
{
- if (sound_enabled || music_enabled)
+ if (globals::sound_enabled || globals::music_enabled)
{
try {
PingusSound::init (new PingusSoundReal ());
Modified: trunk/pingus/src/engine/sound/sound_real.cpp
===================================================================
--- trunk/pingus/src/engine/sound/sound_real.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/engine/sound/sound_real.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -56,7 +56,7 @@
void
PingusSoundReal::real_play_sound(const std::string& name, float volume, float
panning)
{
- if (!sound_enabled)
+ if (!globals::sound_enabled)
return;
SoundHandle chunk;
@@ -100,7 +100,7 @@
filename = arg_filename;
- if (!music_enabled)
+ if (!globals::music_enabled)
return;
pout(PINGUS_DEBUG_SOUND) << "PingusSoundReal: Playing music: " << filename
<< std::endl;
Modified: trunk/pingus/src/pingus/actions/angel.cpp
===================================================================
--- trunk/pingus/src/pingus/actions/angel.cpp 2009-11-08 13:45:53 UTC (rev
4078)
+++ trunk/pingus/src/pingus/actions/angel.cpp 2009-11-08 14:55:19 UTC (rev
4079)
@@ -35,7 +35,7 @@
{
sprite.update ();
- counter += static_cast<float>(game_speed);
+ counter += static_cast<float>(globals::game_speed);
pingu->set_pos(x_pos + 20 * Math::sin(counter * 3.0f), pingu->get_y() -
50.0f * 0.025f);
// Out of screen, let the pingu die
Modified: trunk/pingus/src/pingus/capture_rectangle.cpp
===================================================================
--- trunk/pingus/src/pingus/capture_rectangle.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/capture_rectangle.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -96,7 +96,7 @@
action_str += "]";
}
- if (maintainer_mode)
+ if (globals::maintainer_mode)
{
action_str += " Id: ";
action_str += StringUtil::to_string(pingu->get_id());
Modified: trunk/pingus/src/pingus/components/check_box.cpp
===================================================================
--- trunk/pingus/src/pingus/components/check_box.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/components/check_box.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -37,7 +37,7 @@
void
CheckBox::draw(DrawingContext& gc)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
gc.draw_rect(rect, Color(0, 255, 255));
if (state)
Modified: trunk/pingus/src/pingus/components/choice_box.cpp
===================================================================
--- trunk/pingus/src/pingus/components/choice_box.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/components/choice_box.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -31,7 +31,7 @@
void
ChoiceBox::draw(DrawingContext& gc)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
gc.draw_rect(rect, Color(0, 255, 255));
if (!choices.empty())
Modified: trunk/pingus/src/pingus/components/label.cpp
===================================================================
--- trunk/pingus/src/pingus/components/label.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/components/label.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -29,7 +29,7 @@
void
Label::draw(DrawingContext& gc)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
gc.draw_rect(rect, Color(0, 255, 255));
gc.print_left(Fonts::chalk_normal, Vector2i(rect.left, rect.top), label);
Modified: trunk/pingus/src/pingus/components/playfield.cpp
===================================================================
--- trunk/pingus/src/pingus/components/playfield.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/components/playfield.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -72,7 +72,7 @@
gc.push_modelview();
gc.translate(rect.left, rect.top);
// Draw the scrolling band
- if (mouse_scrolling && !drag_drop_scrolling)
+ if (mouse_scrolling && !globals::drag_drop_scrolling)
{
gc.draw_line(mouse_pos, scroll_center - Vector2i(0, 15),
Color(0, 255, 0));
@@ -128,7 +128,7 @@
}
else
{
- if (drag_drop_scrolling)
+ if (globals::drag_drop_scrolling)
{
state.set_pos(old_state_pos + (scroll_center - mouse_pos));
}
@@ -139,7 +139,7 @@
}
}
- if (auto_scrolling && (fullscreen_enabled ||
SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON))
+ if (globals::auto_scrolling && (globals::fullscreen_enabled ||
SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON))
{
scroll_speed = static_cast<int>(800 * delta);
@@ -212,7 +212,7 @@
mouse_pos.x = x;
mouse_pos.y = y;
- if (maintainer_mode)
+ if (globals::maintainer_mode)
{ // Some fun stuff that lets you draw directly on the level
Uint8 *keystate = SDL_GetKeyState(NULL);
if (keystate[SDLK_r])
Modified: trunk/pingus/src/pingus/components/slider_box.cpp
===================================================================
--- trunk/pingus/src/pingus/components/slider_box.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/components/slider_box.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -31,7 +31,7 @@
void
SliderBox::draw(DrawingContext& gc)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
gc.draw_rect(rect, Color(0, 255, 255));
if (value == 0)
Modified: trunk/pingus/src/pingus/components/time_display.cpp
===================================================================
--- trunk/pingus/src/pingus/components/time_display.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/components/time_display.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -40,7 +40,8 @@
int time_value = server->get_plf().get_time() -
server->get_world()->get_time();
std::string time_string;
- if (server->get_plf().get_time() == -1 && !(pingus_debug_flags &
PINGUS_DEBUG_GAMETIME))
+ if (server->get_plf().get_time() == -1 &&
+ !(globals::pingus_debug_flags & PINGUS_DEBUG_GAMETIME))
{
// No need for this
//gc.draw(infinity_symbol, static_cast<float>(Display::get_width()
@@ -48,7 +49,7 @@
}
else
{
- if (!(pingus_debug_flags & PINGUS_DEBUG_GAMETIME))
+ if (!(globals::pingus_debug_flags & PINGUS_DEBUG_GAMETIME))
time_string = GameTime::ticks_to_realtime_string(time_value);
else
{
Modified: trunk/pingus/src/pingus/config_manager.cpp
===================================================================
--- trunk/pingus/src/pingus/config_manager.cpp 2009-11-08 13:45:53 UTC (rev
4078)
+++ trunk/pingus/src/pingus/config_manager.cpp 2009-11-08 14:55:19 UTC (rev
4079)
@@ -210,7 +210,7 @@
void
ConfigManager::set_master_volume(int v)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "ConfigManager::set_master_volume: " << v << std::endl;
}
@@ -223,7 +223,7 @@
void
ConfigManager::set_sound_volume(int v)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "ConfigManager::set_sound_volume: " << v << std::endl;
}
@@ -236,7 +236,7 @@
void
ConfigManager::set_music_volume(int v)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "ConfigManager::set_music_volume: " << v << std::endl;
}
@@ -249,12 +249,12 @@
void
ConfigManager::set_resolution(const Size& size)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "ConfigManager::set_resolution: " << size.width << "x" <<
size.height << std::endl;
if (size != get_resolution())
{
- Display::set_video_mode(size, fullscreen_enabled);
+ Display::set_video_mode(size, globals::fullscreen_enabled);
on_resolution_change(size);
}
}
@@ -268,14 +268,14 @@
void
ConfigManager::set_fullscreen(bool v)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "ConfigManager::set_fullscreen: " << v << std::endl;
if (v != get_fullscreen())
{
- fullscreen_enabled = v;
+ globals::fullscreen_enabled = v;
Size screen_size = Display::get_size();
- Display::set_video_mode(screen_size, fullscreen_enabled);
+ Display::set_video_mode(screen_size, globals::fullscreen_enabled);
on_fullscreen_change(v);
}
}
@@ -283,13 +283,13 @@
bool
ConfigManager::get_fullscreen()
{
- return fullscreen_enabled;
+ return globals::fullscreen_enabled;
}
void
ConfigManager::set_allow_resize(bool v)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "ConfigManager::set_allow_resize: " << v << std::endl;
if (v != get_allow_resize())
@@ -307,7 +307,7 @@
void
ConfigManager::set_mouse_grab(bool v)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "ConfigManager::set_mouse_grab: " << v << std::endl;
if (v != get_mouse_grab())
@@ -326,12 +326,12 @@
void
ConfigManager::set_print_fps(bool v)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "ConfigManager::set_print_fps: " << v << std::endl;
if (v != get_print_fps())
{
- print_fps = v;
+ globals::print_fps = v;
on_print_fps_change(v);
}
}
@@ -339,13 +339,13 @@
bool
ConfigManager::get_print_fps()
{
- return print_fps;
+ return globals::print_fps;
}
void
ConfigManager::set_language(const tinygettext::Language& v)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "ConfigManager::set_language: '" << v << "'" << std::endl;
if (v != get_language())
@@ -364,7 +364,7 @@
void
ConfigManager::set_swcursor(bool v)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "ConfigManager::set_swcursor: " << v << std::endl;
if (v != get_swcursor())
@@ -377,18 +377,18 @@
bool
ConfigManager::get_swcursor()
{
- return swcursor_enabled;
+ return globals::swcursor_enabled;
}
void
ConfigManager::set_autoscroll(bool v)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "ConfigManager::set_autoscroll: " << v << std::endl;
if (v != get_autoscroll())
{
- auto_scrolling = v;
+ globals::auto_scrolling = v;
on_autoscroll_change(v);
}
}
@@ -396,7 +396,7 @@
bool
ConfigManager::get_autoscroll()
{
- return auto_scrolling;
+ return globals::auto_scrolling;
}
/* EOF */
Modified: trunk/pingus/src/pingus/game_time.cpp
===================================================================
--- trunk/pingus/src/pingus/game_time.cpp 2009-11-08 13:45:53 UTC (rev
4078)
+++ trunk/pingus/src/pingus/game_time.cpp 2009-11-08 14:55:19 UTC (rev
4079)
@@ -33,7 +33,7 @@
const int time_str_size = 20;
char time_str[time_str_size];
- int total_seconds = ticks * game_speed / 1000;
+ int total_seconds = ticks * globals::game_speed / 1000;
int seconds = total_seconds % 60;
int minutes = total_seconds / 60;
Modified: trunk/pingus/src/pingus/global_event.cpp
===================================================================
--- trunk/pingus/src/pingus/global_event.cpp 2009-11-08 13:45:53 UTC (rev
4078)
+++ trunk/pingus/src/pingus/global_event.cpp 2009-11-08 14:55:19 UTC (rev
4079)
@@ -56,7 +56,7 @@
break;
case SDLK_F6:
- if (maintainer_mode)
+ if (globals::maintainer_mode)
if
(!dynamic_cast<AddOnMenu*>(ScreenManager::instance()->get_current_screen().get()))
ScreenManager::instance()->push_screen(new AddOnMenu());
break;
@@ -69,12 +69,12 @@
break;
case SDLK_c:
- if (maintainer_mode)
- draw_collision_map = !draw_collision_map;
+ if (globals::maintainer_mode)
+ globals::draw_collision_map = !globals::draw_collision_map;
break;
case SDLK_k:
- if (maintainer_mode)
+ if (globals::maintainer_mode)
{
std::cout << "Low level screen clear triggered" << std::endl;
SDL_Surface* screen = SDL_GetVideoSurface();
@@ -86,8 +86,8 @@
case SDLK_m:
if (keystate[SDLK_LCTRL] || keystate[SDLK_RCTRL])
{
- std::cout << "Maintainer Mode: " << maintainer_mode << std::endl;
- maintainer_mode = !maintainer_mode;
+ std::cout << "Maintainer Mode: " << globals::maintainer_mode <<
std::endl;
+ globals::maintainer_mode = !globals::maintainer_mode;
}
break;
Modified: trunk/pingus/src/pingus/globals.cpp
===================================================================
--- trunk/pingus/src/pingus/globals.cpp 2009-11-08 13:45:53 UTC (rev 4078)
+++ trunk/pingus/src/pingus/globals.cpp 2009-11-08 14:55:19 UTC (rev 4079)
@@ -16,36 +16,40 @@
#include "pingus/globals.hpp"
-int game_speed = 20;
-float desired_fps = 40;
-bool print_fps = false;
-bool music_enabled = true;
-bool sound_enabled = true;
-int fast_forward_time_scale = 4;
-bool maintainer_mode = false;
+namespace globals {
+
+int game_speed = 20;
+float desired_fps = 40;
+bool print_fps = false;
+bool music_enabled = true;
+bool sound_enabled = true;
+int fast_forward_time_scale = 4;
+bool maintainer_mode = false;
std::string demo_file;
-bool auto_scrolling = true;
-bool drag_drop_scrolling = false;
-int tile_size = 32;
+bool auto_scrolling = true;
+bool drag_drop_scrolling = false;
+int tile_size = 32;
-int default_screen_width = 800;
-int default_screen_height = 600;
-bool draw_collision_map = false;
-bool swcursor_enabled = false;
+int default_screen_width = 800;
+int default_screen_height = 600;
+bool draw_collision_map = false;
+bool swcursor_enabled = false;
std::string controller_file;
std::string global_username;
std::string global_email;
-std::string default_language = "en";
+std::string default_language = "en";
-unsigned int pingus_debug_flags = 0;
+unsigned int pingus_debug_flags = 0;
-bool fullscreen_enabled = false;
-bool delta_drawing = false;
+bool fullscreen_enabled = false;
+bool delta_drawing = false;
-bool static_graphics = false;
+bool static_graphics = false;
FramebufferType framebuffer_type = DELTA_FRAMEBUFFER;
+} // namespace globals
+
/* EOF */
Modified: trunk/pingus/src/pingus/globals.hpp
===================================================================
--- trunk/pingus/src/pingus/globals.hpp 2009-11-08 13:45:53 UTC (rev 4078)
+++ trunk/pingus/src/pingus/globals.hpp 2009-11-08 14:55:19 UTC (rev 4079)
@@ -22,6 +22,35 @@
#include <string>
+enum FramebufferType
+{
+ DELTA_FRAMEBUFFER,
+ SDL_FRAMEBUFFER,
+ NULL_FRAMEBUFFER,
+ OPENGL_FRAMEBUFFER
+};
+
+enum
+{
+ PINGUS_DEBUG_ACTIONS = (1 << 0),
+ PINGUS_DEBUG_SOUND = (1 << 1),
+ PINGUS_DEBUG_GAMETIME = (1 << 2),
+ PINGUS_DEBUG_TILES = (1 << 3),
+ PINGUS_DEBUG_LOADING = (1 << 4),
+
+ PINGUS_DEBUG_BLITTER = (1 << 6),
+ PINGUS_DEBUG_TRANSLATOR = (1 << 7),
+ PINGUS_DEBUG_RESOURCES = (1 << 8),
+ PINGUS_DEBUG_GUI = (1 << 9),
+ PINGUS_DEBUG_INPUT = (1 << 10),
+ PINGUS_DEBUG_WORLDMAP = (1 << 11),
+ PINGUS_DEBUG_PATHMGR = (1 << 12),
+ PINGUS_DEBUG_DIRECTORIES = (1 << 13),
+ PINGUS_DEBUG_ALL = (~0)
+};
+
+namespace globals {
+
extern int game_speed; ///< -t, --set-speed
extern float desired_fps; ///< -k, --set-fps
extern bool print_fps; ///< --print-fps
@@ -50,26 +79,10 @@
extern std::string default_language; ///< The default
language, which is used when the env var LANG is not set
extern unsigned int pingus_debug_flags; ///< Set some bits in
this thing to get debug infos
-enum FramebufferType { DELTA_FRAMEBUFFER, SDL_FRAMEBUFFER, NULL_FRAMEBUFFER,
OPENGL_FRAMEBUFFER };
extern FramebufferType framebuffer_type;
-enum { PINGUS_DEBUG_ACTIONS = (1 << 0),
- PINGUS_DEBUG_SOUND = (1 << 1),
- PINGUS_DEBUG_GAMETIME = (1 << 2),
- PINGUS_DEBUG_TILES = (1 << 3),
- PINGUS_DEBUG_LOADING = (1 << 4),
+} // namespace globals
- PINGUS_DEBUG_BLITTER = (1 << 6),
- PINGUS_DEBUG_TRANSLATOR = (1 << 7),
- PINGUS_DEBUG_RESOURCES = (1 << 8),
- PINGUS_DEBUG_GUI = (1 << 9),
- PINGUS_DEBUG_INPUT = (1 << 10),
- PINGUS_DEBUG_WORLDMAP = (1 << 11),
- PINGUS_DEBUG_PATHMGR = (1 << 12),
- PINGUS_DEBUG_DIRECTORIES = (1 << 13),
- PINGUS_DEBUG_ALL = (~0)
-};
-
#endif
/* EOF */
Modified: trunk/pingus/src/pingus/ground_map.cpp
===================================================================
--- trunk/pingus/src/pingus/ground_map.cpp 2009-11-08 13:45:53 UTC (rev
4078)
+++ trunk/pingus/src/pingus/ground_map.cpp 2009-11-08 14:55:19 UTC (rev
4079)
@@ -64,7 +64,7 @@
MapTile::put(Surface src, int x, int y)
{
if (!surface)
- surface = Surface(tile_size, tile_size);
+ surface = Surface(globals::tile_size, globals::tile_size);
surface.blit(src, x, y);
sprite_needs_update = true;
@@ -94,16 +94,16 @@
{
colmap = new CollisionMap(width, height);
- tile_width = width /tile_size;
- tile_height = height/tile_size;
+ tile_width = width / globals::tile_size;
+ tile_height = height / globals::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)
+ if ((width % globals::tile_size) != 0)
tile_width += 1;
- if ((height % tile_size) != 0)
+ if ((height % globals::tile_size) != 0)
tile_height += 1;
// Allocating tile map
@@ -131,14 +131,14 @@
{
const Rect& display = gc.color().get_world_clip_rect();
- if (draw_collision_map)
+ if (globals::draw_collision_map)
draw_colmap(gc);
// 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;
+ int start_x = Math::max(0, display.left / globals::tile_size);
+ int start_y = Math::max(0, display.top / globals::tile_size);
+ int tilemap_width = display.get_width() / globals::tile_size + 1;
+ int tilemap_height = display.get_height() / globals::tile_size + 1;
// drawing the stuff
for (int x = start_x; x <= (start_x + tilemap_width) && x < tile_width; ++x)
@@ -148,15 +148,15 @@
{
//std::cout << "Drawing GroundMap Tile " << std::endl;
gc.color().draw(get_tile(x, y)->get_sprite(),
- Vector2i(x * tile_size, y * tile_size));
+ Vector2i(x * globals::tile_size, y *
globals::tile_size));
}
else
{
if (0 /*pingus_debug_flags & PINGUS_DEBUG_TILES*/)
- gc.color().draw_fillrect(Rect(x * tile_size,
- y * tile_size,
- x * tile_size + tile_size,
- y * tile_size + tile_size),
+ gc.color().draw_fillrect(Rect(x * globals::tile_size,
+ y * globals::tile_size,
+ x * globals::tile_size +
globals::tile_size,
+ y * globals::tile_size +
globals::tile_size),
Color(255, 0, 0, 75));
}
}
@@ -180,18 +180,19 @@
GroundMap::remove(Surface 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);
+ int start_x = Math::max(x / globals::tile_size, 0);
+ int start_y = Math::max(y / globals::tile_size, 0);
+ int end_x = Math::min((x + sprovider.get_width()) / globals::tile_size,
+ (width - 1) / globals::tile_size);
+ int end_y = Math::min((y + sprovider.get_height()) / globals::tile_size,
+ (height - 1) / globals::tile_size);
for(int ix = start_x; ix <= end_x; ++ix)
for(int iy = start_y; iy <= end_y; ++iy)
{
- get_tile(ix, iy)->remove(sprovider, x - (ix * tile_size),
- y - (iy * tile_size), x, y, this);
+ get_tile(ix, iy)->remove(sprovider,
+ x - (ix * globals::tile_size),
+ y - (iy * globals::tile_size), x, y, this);
}
}
@@ -283,10 +284,10 @@
GroundMap::put(Surface source, 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 + source.get_width()) / tile_size +
1);
- int end_y = std::min(tile_height, (y + source.get_height()) / tile_size +
1);
+ int start_x = std::max(0, x / globals::tile_size);
+ int start_y = std::max(0, y / globals::tile_size);
+ int end_x = std::min(tile_width, (x + source.get_width()) /
globals::tile_size + 1);
+ int end_y = std::min(tile_height, (y + source.get_height()) /
globals::tile_size + 1);
//std::cout << "GroundMap:put: " << source.get_width() << "x" <<
source.get_height() << std::endl;
@@ -294,7 +295,7 @@
for(int iy = start_y; iy < end_y; ++iy)
{
get_tile(ix, iy)->put(source,
- x - (ix * tile_size), y - (iy * tile_size));
+ x - (ix * globals::tile_size), y - (iy *
globals::tile_size));
}
}
Modified: trunk/pingus/src/pingus/layer_manager.hpp
===================================================================
--- trunk/pingus/src/pingus/layer_manager.hpp 2009-11-08 13:45:53 UTC (rev
4078)
+++ trunk/pingus/src/pingus/layer_manager.hpp 2009-11-08 14:55:19 UTC (rev
4079)
@@ -62,7 +62,7 @@
void update (float delta)
{
- if (!static_graphics)
+ if (!globals::static_graphics)
{
x_pos = Math::mod((x_pos + x_update *
delta),(float)Display::get_width());
y_pos = Math::mod((y_pos + y_update *
delta),(float)Display::get_height());
Modified: trunk/pingus/src/pingus/particles/rain_particle_holder.cpp
===================================================================
--- trunk/pingus/src/pingus/particles/rain_particle_holder.cpp 2009-11-08
13:45:53 UTC (rev 4078)
+++ trunk/pingus/src/pingus/particles/rain_particle_holder.cpp 2009-11-08
14:55:19 UTC (rev 4079)
@@ -71,7 +71,7 @@
continue;
}
- it->splash_frame += 10.0f * static_cast<float>(game_speed) / 1000.0f;
+ it->splash_frame += 10.0f * static_cast<float>(globals::game_speed) /
1000.0f;
(it->splash_counter == 3) ? it->alive = false : ++it->splash_counter;
}
else
Modified: trunk/pingus/src/pingus/pingus_main.cpp
===================================================================
--- trunk/pingus/src/pingus/pingus_main.cpp 2009-11-08 13:45:53 UTC (rev
4078)
+++ trunk/pingus/src/pingus/pingus_main.cpp 2009-11-08 14:55:19 UTC (rev
4079)
@@ -164,45 +164,45 @@
// Display
if (options.fullscreen.is_set())
- fullscreen_enabled = options.fullscreen.get();
+ globals::fullscreen_enabled = options.fullscreen.get();
if (options.swcursor.is_set())
- swcursor_enabled = options.swcursor.get();
+ globals::swcursor_enabled = options.swcursor.get();
// FIXME: if (options.geometry.is_set())
// FIXME: config_manager.set_resolution(options.geometry.get());
// Sound
if (options.disable_music.is_set())
- music_enabled = !options.disable_music.get();
+ globals::music_enabled = !options.disable_music.get();
if (options.disable_sound.is_set())
- sound_enabled = !options.disable_sound.get();
+ globals::sound_enabled = !options.disable_sound.get();
// Misc
if (options.language.is_set())
dictionary_manager.set_language(tinygettext::Language::from_name(options.language.get()));
if (options.auto_scrolling.is_set())
- auto_scrolling = options.auto_scrolling.get();
+ globals::auto_scrolling = options.auto_scrolling.get();
if (options.controller.is_set())
- controller_file = options.controller.get();
+ globals::controller_file = options.controller.get();
if (options.maintainer_mode.is_set())
- maintainer_mode = options.maintainer_mode.get();
+ globals::maintainer_mode = options.maintainer_mode.get();
if (options.debug.is_set())
- pingus_debug_flags = options.debug.get();
+ globals::pingus_debug_flags = options.debug.get();
if (options.speed.is_set())
- game_speed = options.speed.get();
+ globals::game_speed = options.speed.get();
if (options.desiredfps.is_set())
- desired_fps = options.desiredfps.get();
+ globals::desired_fps = options.desiredfps.get();
if (options.tile_size.is_set())
- tile_size = options.tile_size.get();
+ globals::tile_size = options.tile_size.get();
}
void
@@ -292,19 +292,19 @@
case 'r': // --renderer
if (argp.get_argument() == "delta")
{
- framebuffer_type = DELTA_FRAMEBUFFER;
+ globals::framebuffer_type = DELTA_FRAMEBUFFER;
}
else if (argp.get_argument() == "opengl")
{
- framebuffer_type = OPENGL_FRAMEBUFFER;
+ globals::framebuffer_type = OPENGL_FRAMEBUFFER;
}
else if (argp.get_argument() == "null")
{
- framebuffer_type = NULL_FRAMEBUFFER;
+ globals::framebuffer_type = NULL_FRAMEBUFFER;
}
else if (argp.get_argument() == "sdl")
{
- framebuffer_type = SDL_FRAMEBUFFER;
+ globals::framebuffer_type = SDL_FRAMEBUFFER;
}
else if (argp.get_argument() == "help")
{
@@ -393,7 +393,7 @@
case 334: // --maintainer-mode
cmd_options.maintainer_mode.set(true);
- maintainer_mode = true;
+ globals::maintainer_mode = true;
break;
case 337:
@@ -472,7 +472,7 @@
}
// Update Pingus debug flags
- pingus_debug_flags = cmd_options.debug.get();
+ globals::pingus_debug_flags = cmd_options.debug.get();
break;
case 360:
@@ -569,7 +569,7 @@
// dictionary_manager.set_language("de");
dictionary_manager.add_directory(path_manager.complete("po/"));
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "BasePath: " << path_manager.get_base_path () << std::endl;
}
@@ -591,12 +591,12 @@
<< ")"
<< std::endl;
- if (sound_enabled)
+ if (globals::sound_enabled)
std::cout << "sound support: enabled" << std::endl;
else
std::cout << "sound support: disabled" << std::endl;
- if (music_enabled)
+ if (globals::music_enabled)
std::cout << "music support: enabled" << std::endl;
else
std::cout << "music support: disabled" << std::endl;
@@ -605,7 +605,7 @@
// FIXME: << config_manager.get_resolution().width << "x"
// FIXME: << config_manager.get_resolution().height << std::endl;
std::cout << "fullscreen: "
- << (fullscreen_enabled ? " enabled" : "disabled")
+ << (globals::fullscreen_enabled ? " enabled" : "disabled")
<< std::endl;
std::cout << std::endl;
@@ -743,7 +743,7 @@
if (cmd_options.geometry.is_set())
screen_size = cmd_options.geometry.get();
- Display::set_video_mode(screen_size, fullscreen_enabled);
+ Display::set_video_mode(screen_size, globals::fullscreen_enabled);
SDL_WM_SetCaption("Pingus " VERSION " - SDL Edition", 0 /* icon */);
Modified: trunk/pingus/src/pingus/screens/game_session.cpp
===================================================================
--- trunk/pingus/src/pingus/screens/game_session.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/screens/game_session.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -133,7 +133,7 @@
// how much time we have to account for while doing world updates
int time_passed = int(delta * 1000) + world_delay;
// how much time each world update represents
- int update_time = game_speed;
+ int update_time = globals::game_speed;
// update the world (and the objects in it) in constant steps to account
// for the time the previous frame took
@@ -148,7 +148,7 @@
{
if (fast_forward)
{
- for (int i = 0; i < fast_forward_time_scale; ++i)
+ for (int i = 0; i < globals::fast_forward_time_scale; ++i)
server->update();
}
else
@@ -319,7 +319,7 @@
{
is_finished = false;
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "Starting Music: " << server->get_plf().get_music() <<
std::endl;
if (server->get_plf().get_music() == "none")
Modified: trunk/pingus/src/pingus/screens/level_menu.cpp
===================================================================
--- trunk/pingus/src/pingus/screens/level_menu.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/screens/level_menu.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -273,7 +273,7 @@
else if (i == current_level)
gc.draw(marker, Vector2i(0, y));
- if (maintainer_mode)
+ if (globals::maintainer_mode)
gc.print_left(Fonts::chalk_small, Vector2i(30, y+4),
levelset->get_level(i)->plf.get_resname());
else
gc.print_left(Fonts::chalk_small, Vector2i(30, y+4),
_(levelset->get_level(i)->plf.get_levelname()));
@@ -355,8 +355,8 @@
};
LevelMenu::LevelMenu() :
- x_pos((Display::get_width() - default_screen_width)/2),
- y_pos((Display::get_height() - default_screen_height)/2),
+ x_pos((Display::get_width() - globals::default_screen_width)/2),
+ y_pos((Display::get_height() - globals::default_screen_height)/2),
background("core/menu/wood"),
blackboard("core/menu/blackboard"),
ok_button(),
@@ -459,8 +459,8 @@
{
GUIScreen::resize(size_);
- x_pos = (size.width - default_screen_width)/2;
- y_pos = (size.height - default_screen_height)/2;
+ x_pos = (size.width - globals::default_screen_width)/2;
+ y_pos = (size.height - globals::default_screen_height)/2;
levelset_selector->set_rect(Rect(Vector2i(x_pos + 100, y_pos + 140),
Size(600, 285)));
level_selector ->set_rect(Rect(Vector2i(x_pos + 100, y_pos + 160),
Size(600, 256)));
Modified: trunk/pingus/src/pingus/screens/pingus_menu.cpp
===================================================================
--- trunk/pingus/src/pingus/screens/pingus_menu.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/screens/pingus_menu.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -221,19 +221,20 @@
// We only need to scale the background main menu images if the screen
// resolution is not default
- if (w != default_screen_width && h != default_screen_height)
+ if (w != globals::default_screen_width &&
+ h != globals::default_screen_height)
{
- layer1 = layer1.scale(w, 185 * h / default_screen_height);
- layer2 = layer2.scale(w, 362 * h / default_screen_height);
- layer3 = layer3.scale(w, 306 * h / default_screen_height);
- layer4 = layer4.scale(w, 171 * h / default_screen_height);
- layer5 = layer5.scale(302 * w / default_screen_width, 104 * h /
default_screen_height);
+ layer1 = layer1.scale(w, 185 * h / globals::default_screen_height);
+ layer2 = layer2.scale(w, 362 * h / globals::default_screen_height);
+ layer3 = layer3.scale(w, 306 * h / globals::default_screen_height);
+ layer4 = layer4.scale(w, 171 * h / globals::default_screen_height);
+ layer5 = layer5.scale(302 * w / globals::default_screen_width, 104 * h /
globals::default_screen_height);
background->add_layer(Sprite(layer1), 0, 0, 12, 0);
- background->add_layer(Sprite(layer2), 0, 150 * static_cast<float>(h) /
static_cast<float>(default_screen_height), 25, 0);
- background->add_layer(Sprite(layer3), 0, 200 * static_cast<float>(h) /
static_cast<float>(default_screen_height), 50, 0);
- background->add_layer(Sprite(layer4), 0, 429 * static_cast<float>(h) /
static_cast<float>(default_screen_height), 100, 0);
- background->add_layer(Sprite(layer5), 0, 500 * static_cast<float>(h) /
static_cast<float>(default_screen_height), 200, 0);
+ background->add_layer(Sprite(layer2), 0, 150 * static_cast<float>(h) /
static_cast<float>(globals::default_screen_height), 25, 0);
+ background->add_layer(Sprite(layer3), 0, 200 * static_cast<float>(h) /
static_cast<float>(globals::default_screen_height), 50, 0);
+ background->add_layer(Sprite(layer4), 0, 429 * static_cast<float>(h) /
static_cast<float>(globals::default_screen_height), 100, 0);
+ background->add_layer(Sprite(layer5), 0, 500 * static_cast<float>(h) /
static_cast<float>(globals::default_screen_height), 200, 0);
}
else
{
Modified: trunk/pingus/src/pingus/screens/start_screen.cpp
===================================================================
--- trunk/pingus/src/pingus/screens/start_screen.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/screens/start_screen.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -180,7 +180,7 @@
gc.get_height()/2 + 215),
_("Author: ") + plf.get_author());
- if (maintainer_mode)
+ if (globals::maintainer_mode)
gc.print_left(Fonts::chalk_small, Vector2i(110, 430), _("Filename: ") +
plf.get_resname());
}
Modified: trunk/pingus/src/pingus/screens/story_screen.cpp
===================================================================
--- trunk/pingus/src/pingus/screens/story_screen.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/screens/story_screen.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -143,7 +143,7 @@
gui_manager->add(continue_button = new StoryScreenContinueButton(story_comp,
Display::get_width()/2 + 220 + 40,
Display::get_height()/2 + 180 + 32));
- if (maintainer_mode)
+ if (globals::maintainer_mode)
gui_manager->add(skip_button = new StoryScreenSkipButton(story_comp,
Display::get_width() - 4,
Display::get_height() - 26));
Modified: trunk/pingus/src/pingus/worldmap/level_dot.cpp
===================================================================
--- trunk/pingus/src/pingus/worldmap/level_dot.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/worldmap/level_dot.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -151,7 +151,7 @@
10000);
}
- if (maintainer_mode)
+ if (globals::maintainer_mode)
{
gc.print_center(Fonts::pingus_small,
Vector2i((int)pos.x, (int)pos.y - 56),
Modified: trunk/pingus/src/pingus/worldmap/path_graph.cpp
===================================================================
--- trunk/pingus/src/pingus/worldmap/path_graph.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/worldmap/path_graph.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -127,7 +127,7 @@
float cost = full_path.length();
// FIXME: Memory leak
- if (worldmap && pingus_debug_flags & PINGUS_DEBUG_WORLDMAP)
+ if (worldmap && globals::pingus_debug_flags & PINGUS_DEBUG_WORLDMAP)
worldmap->add_drawable(new PathDrawable(full_path));
// FIXME: No error checking,
Modified: trunk/pingus/src/pingus/worldmap/worldmap.cpp
===================================================================
--- trunk/pingus/src/pingus/worldmap/worldmap.cpp 2009-11-08 13:45:53 UTC
(rev 4078)
+++ trunk/pingus/src/pingus/worldmap/worldmap.cpp 2009-11-08 14:55:19 UTC
(rev 4079)
@@ -166,7 +166,7 @@
{
Vector2f click_pos = gc_state.screen2world(Vector2i(x, y));
- if (pingus_debug_flags & PINGUS_DEBUG_WORLDMAP)
+ if (globals::pingus_debug_flags & PINGUS_DEBUG_WORLDMAP)
{
std::cout
<< "\n<leveldot>\n"
@@ -185,12 +185,12 @@
Dot* dot = path_graph->get_dot(click_pos.x, click_pos.y);
if (dot)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "Worldmap: Clicked on: " << dot->get_name() << std::endl;
if (path_graph->lookup_node(dot->get_name()) == pingus->get_node())
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "Worldmap: Pingu is on node, issue on_click()" <<
std::endl;
dot->on_click();
}
@@ -200,7 +200,7 @@
{
if (!pingus->walk_to_node(path_graph->lookup_node(dot->get_name())))
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "Worldmap: NO PATH TO NODE FOUND!" << std::endl;
}
else
@@ -219,7 +219,7 @@
void
Worldmap::on_secondary_button_press(int x, int y)
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
{
Vector3f click_pos = gc_state.screen2world(Vector2i(x, y));
@@ -247,7 +247,7 @@
}
else
{
- if (maintainer_mode)
+ if (globals::maintainer_mode)
std::cout << "Worldmap: Pingus not on level" << std::endl;
}
}
Modified: trunk/pingus/src/pingus/worldobjs/snow_generator.cpp
===================================================================
--- trunk/pingus/src/pingus/worldobjs/snow_generator.cpp 2009-11-08
13:45:53 UTC (rev 4078)
+++ trunk/pingus/src/pingus/worldobjs/snow_generator.cpp 2009-11-08
14:55:19 UTC (rev 4079)
@@ -38,17 +38,17 @@
for(int i = 0; i < Math::floor(intensity); ++i)
{
if (rand() % 3 != 0)
- world->get_snow_particle_holder()->add_particle(rand() %
world->get_width(), -tile_size, false);
+ world->get_snow_particle_holder()->add_particle(rand() %
world->get_width(), -globals::tile_size, false);
else
- world->get_snow_particle_holder()->add_particle(rand() %
world->get_width(), -tile_size, true);
+ world->get_snow_particle_holder()->add_particle(rand() %
world->get_width(), -globals::tile_size, true);
}
if ((intensity - static_cast<float>(static_cast<int>(intensity))) >
Math::frand())
{
if (rand() % 3 != 0)
- world->get_snow_particle_holder()->add_particle(rand() %
world->get_width(), -tile_size, false);
+ world->get_snow_particle_holder()->add_particle(rand() %
world->get_width(), -globals::tile_size, false);
else
- world->get_snow_particle_holder()->add_particle(rand() %
world->get_width(), -tile_size, true);
+ world->get_snow_particle_holder()->add_particle(rand() %
world->get_width(), -globals::tile_size, true);
}
}
Modified: trunk/pingus/src/pingus/worldobjs/starfield_background_stars.cpp
===================================================================
--- trunk/pingus/src/pingus/worldobjs/starfield_background_stars.cpp
2009-11-08 13:45:53 UTC (rev 4078)
+++ trunk/pingus/src/pingus/worldobjs/starfield_background_stars.cpp
2009-11-08 14:55:19 UTC (rev 4079)
@@ -57,7 +57,7 @@
if (x_pos > WorldObj::get_world()->get_width())
{
- x_pos = float(-tile_size);
+ x_pos = float(-globals::tile_size);
y_pos = float(rand() % WorldObj::get_world()->get_height());
}
}
Modified: trunk/pingus/src/pingus/worldobjs/surface_background.cpp
===================================================================
--- trunk/pingus/src/pingus/worldobjs/surface_background.cpp 2009-11-08
13:45:53 UTC (rev 4078)
+++ trunk/pingus/src/pingus/worldobjs/surface_background.cpp 2009-11-08
14:55:19 UTC (rev 4079)
@@ -102,7 +102,7 @@
void
SurfaceBackground::update()
{
- if (!bg_sprite || static_graphics)
+ if (!bg_sprite || globals::static_graphics)
return;
if (scroll_x)
Modified: trunk/pingus/src/util/debug_stream.cpp
===================================================================
--- trunk/pingus/src/util/debug_stream.cpp 2009-11-08 13:45:53 UTC (rev
4078)
+++ trunk/pingus/src/util/debug_stream.cpp 2009-11-08 14:55:19 UTC (rev
4079)
@@ -129,7 +129,7 @@
/// returns self if the debug flag is set, else nilstream
ostream & DebugStream::operator () (int component) {
- if (pingus_debug_flags & component) {
+ if (globals::pingus_debug_flags & component) {
return *this;
} else {
return nilstream;
Modified: trunk/pingus/src/util/system.cpp
===================================================================
--- trunk/pingus/src/util/system.cpp 2009-11-08 13:45:53 UTC (rev 4078)
+++ trunk/pingus/src/util/system.cpp 2009-11-08 14:55:19 UTC (rev 4079)
@@ -165,7 +165,7 @@
System::create_dir(std::string directory)
{
#ifndef WIN32
- if (pingus_debug_flags & PINGUS_DEBUG_DIRECTORIES)
+ if (globals::pingus_debug_flags & PINGUS_DEBUG_DIRECTORIES)
{
std::cout << "System::create_dir: " << directory << std::endl;
}
@@ -346,7 +346,7 @@
lang = lang_c;
if (lang.empty() || lang == "C")
- return default_language;
+ return globals::default_language;
else
return lang.substr(0, 2);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r4079 - in trunk/pingus/src: engine/display engine/screen engine/sound pingus pingus/actions pingus/components pingus/particles pingus/screens pingus/worldmap pingus/worldobjs util,
grumbel at BerliOS <=