[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2852 - branches/pingus_sdl/src/worldmap
From: |
jsalmon3 |
Subject: |
[Pingus-CVS] r2852 - branches/pingus_sdl/src/worldmap |
Date: |
Sun, 12 Aug 2007 08:26:38 +0200 |
Author: jsalmon3
Date: 2007-08-12 08:26:34 +0200 (Sun, 12 Aug 2007)
New Revision: 2852
Modified:
branches/pingus_sdl/src/worldmap/worldmap.cpp
Log:
Fixed Math::mid call
Modified: branches/pingus_sdl/src/worldmap/worldmap.cpp
===================================================================
--- branches/pingus_sdl/src/worldmap/worldmap.cpp 2007-08-12 00:43:53 UTC
(rev 2851)
+++ branches/pingus_sdl/src/worldmap/worldmap.cpp 2007-08-12 06:26:34 UTC
(rev 2852)
@@ -152,14 +152,31 @@
WorldMap::draw (DrawingContext& gc)
{
Vector3f pingu_pos = pingus->get_pos();
+ float min, max;
- pingu_pos.x = Math::mid(float(gc.get_width()/2),
- pingu_pos.x,
- float(width - gc.get_width()/2));
+ if (width >= gc.get_width())
+ {
+ min = float(gc.get_width()/2);
+ max = float(width - gc.get_width()/2);
+ }
+ else
+ {
+ min = float(width - gc.get_width()/2);
+ max = float(gc.get_width()/2);
+ }
+ pingu_pos.x = Math::mid(min, pingu_pos.x, max);
- pingu_pos.y = Math::mid(float(gc.get_height()/2),
- pingu_pos.y,
- float(height - gc.get_height()/2));
+ if (height >= gc.get_height())
+ {
+ min = float(gc.get_height()/2);
+ max = float(height - gc.get_height()/2);
+ }
+ else
+ {
+ min = float(height - gc.get_height()/2);
+ max = float(gc.get_height()/2);
+ }
+ pingu_pos.y = Math::mid(min, pingu_pos.x, max);
DrawingContext* display_gc = new DrawingContext();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2852 - branches/pingus_sdl/src/worldmap,
jsalmon3 <=