r80 - trunk/src

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Feb 1 13:55:46 EST 2005


Author: jonas
Date: 2005-02-01 13:55:46 -0500 (Tue, 01 Feb 2005)
New Revision: 80

Modified:
   trunk/src/objects_common.cpp
   trunk/src/objects_common.h
Log:
moved setPos out of the header files

Modified: trunk/src/objects_common.cpp
===================================================================
--- trunk/src/objects_common.cpp	2005-02-01 13:33:04 UTC (rev 79)
+++ trunk/src/objects_common.cpp	2005-02-01 18:55:46 UTC (rev 80)
@@ -40,6 +40,23 @@
     }
 }
 
+bool Object::setPos(Sint16 xcord,Sint16 ycord) {
+    bool ok=true;
+    //Did we hit a maparea?
+    if (xcord < 0) {
+        pos.x=0;
+        ok=false;
+    } else if (xcord > (maparea->w-pos.w)) {
+        pos.x=maparea->w-pos.w;
+        ok=false;
+    } else pos.x=xcord;
+    if (ycord>(maparea->h-pos.h)) {
+        pos.y=maparea->h-pos.h;
+        ok=false;
+    } else pos.y=ycord;
+    return ok;
+}
+
 const Frame& Object::getFrame() const {
     return animation->getFrame();
 }

Modified: trunk/src/objects_common.h
===================================================================
--- trunk/src/objects_common.h	2005-02-01 13:33:04 UTC (rev 79)
+++ trunk/src/objects_common.h	2005-02-01 18:55:46 UTC (rev 80)
@@ -41,24 +41,7 @@
         /// Sets the new position. If the coordinates are not in the map area
         /// they are corrected to fit into it.
         /// \return True if no correction was needed
-        bool setPos(Sint16 xcord,Sint16 ycord) {
-            bool ok=true;
-            //Did we hit a maparea?
-            if (xcord < 0) {
-                pos.x=0;
-                ok=false;
-            } else if (xcord > (maparea->w-pos.w)) {
-                pos.x=maparea->w-pos.w;
-                ok=false;
-            } else pos.x=xcord;
-
-            if (ycord>(maparea->h-pos.h)) {
-                pos.y=maparea->h-pos.h;
-                ok=false;
-            } else pos.y=ycord;
-
-            return ok;
-        }
+        bool setPos(Sint16 xcord,Sint16 ycord);
         /// \brief Returns the center of an object
         /// \return Center position of the object with width=height=0
         SDL_Rect getCenter() {




More information about the lostpenguins-commits mailing list