[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r3880 - in trunk/pingus/src: . display worldobjs
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r3880 - in trunk/pingus/src: . display worldobjs |
Date: |
Sun, 20 Jul 2008 15:22:08 +0200 |
Author: grumbel
Date: 2008-07-20 15:22:07 +0200 (Sun, 20 Jul 2008)
New Revision: 3880
Modified:
trunk/pingus/src/display/display.cpp
trunk/pingus/src/globals.cpp
trunk/pingus/src/globals.hpp
trunk/pingus/src/layer_manager.hpp
trunk/pingus/src/worldobjs/surface_background.cpp
Log:
Added static_graphics flag to disable scrolling in delta-mode
Modified: trunk/pingus/src/display/display.cpp
===================================================================
--- trunk/pingus/src/display/display.cpp 2008-07-20 13:18:51 UTC (rev
3879)
+++ trunk/pingus/src/display/display.cpp 2008-07-20 13:22:07 UTC (rev
3880)
@@ -84,6 +84,7 @@
break;
case DELTA_FRAMEBUFFER:
+ static_graphics = true;
framebuffer = std::auto_ptr<Framebuffer>(new DeltaFramebuffer());
break;
Modified: trunk/pingus/src/globals.cpp
===================================================================
--- trunk/pingus/src/globals.cpp 2008-07-20 13:18:51 UTC (rev 3879)
+++ trunk/pingus/src/globals.cpp 2008-07-20 13:22:07 UTC (rev 3880)
@@ -44,6 +44,8 @@
bool fullscreen_enabled = false;
bool delta_drawing = false;
+bool static_graphics = false;
+
FramebufferType framebuffer_type = DELTA_FRAMEBUFFER;
/* EOF */
Modified: trunk/pingus/src/globals.hpp
===================================================================
--- trunk/pingus/src/globals.hpp 2008-07-20 13:18:51 UTC (rev 3879)
+++ trunk/pingus/src/globals.hpp 2008-07-20 13:22:07 UTC (rev 3880)
@@ -30,6 +30,7 @@
extern bool music_enabled; ///< -m, --enable-music
extern bool sound_enabled; ///< -s, --enable-sound
+extern bool static_graphics; ///< Disables scrolling in
menu and other places to make delta renderer faster
extern bool debug_actions; ///< --debug-actions
extern int fast_forward_time_scale; ///< how much faster the
game runs in FF mode
extern bool maintainer_mode; ///< --maintainer-mode
Modified: trunk/pingus/src/layer_manager.hpp
===================================================================
--- trunk/pingus/src/layer_manager.hpp 2008-07-20 13:18:51 UTC (rev 3879)
+++ trunk/pingus/src/layer_manager.hpp 2008-07-20 13:22:07 UTC (rev 3880)
@@ -18,6 +18,7 @@
#define HEADER_PINGUS_LAYER_MANAGER_HPP
#include "math.hpp"
+#include "globals.hpp"
#include "pingus.hpp"
#include "sprite.hpp"
#include "display/display.hpp"
@@ -62,8 +63,11 @@
void update (float delta)
{
- 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());
+ if (!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/worldobjs/surface_background.cpp
===================================================================
--- trunk/pingus/src/worldobjs/surface_background.cpp 2008-07-20 13:18:51 UTC
(rev 3879)
+++ trunk/pingus/src/worldobjs/surface_background.cpp 2008-07-20 13:22:07 UTC
(rev 3880)
@@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <iostream>
+#include "../globals.hpp"
#include "../display/scene_context.hpp"
#include "../world.hpp"
#include "../resource.hpp"
@@ -102,7 +103,7 @@
void
SurfaceBackground::update()
{
- if (!bg_sprite)
+ if (!bg_sprite || static_graphics)
return;
if (scroll_x)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r3880 - in trunk/pingus/src: . display worldobjs,
grumbel at BerliOS <=