pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r2773 - in branches/pingus_sdl: . data/levels/test src


From: jsalmon3
Subject: [Pingus-CVS] r2773 - in branches/pingus_sdl: . data/levels/test src
Date: Thu, 2 Aug 2007 06:15:25 +0200

Author: jsalmon3
Date: 2007-08-02 06:15:17 +0200 (Thu, 02 Aug 2007)
New Revision: 2773

Modified:
   branches/pingus_sdl/data/levels/test/rotation.scm
   branches/pingus_sdl/pingus.vcproj
   branches/pingus_sdl/src/blitter_impl.hpp
Log:
Fixed rotations. colmap works correctly now

Modified: branches/pingus_sdl/data/levels/test/rotation.scm
===================================================================
--- branches/pingus_sdl/data/levels/test/rotation.scm   2007-08-02 03:53:49 UTC 
(rev 2772)
+++ branches/pingus_sdl/data/levels/test/rotation.scm   2007-08-02 04:15:17 UTC 
(rev 2773)
@@ -28,7 +28,7 @@
       (type "ground")
       (surface 
         (image "hotspots/signposts/danger")
-        (modifier "ROT0"))
+        (modifier "ROT90"))
       (position 366 260 0))
     (groundpiece 
       (type "ground")

Modified: branches/pingus_sdl/pingus.vcproj
===================================================================
--- branches/pingus_sdl/pingus.vcproj   2007-08-02 03:53:49 UTC (rev 2772)
+++ branches/pingus_sdl/pingus.vcproj   2007-08-02 04:15:17 UTC (rev 2773)
@@ -511,14 +511,6 @@
                                >
                        </File>
                        <File
-                               RelativePath=".\src\hierHeader.inc"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\src\indexHeader.inc"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\src\input_event.hpp"
                                >
                        </File>

Modified: branches/pingus_sdl/src/blitter_impl.hpp
===================================================================
--- branches/pingus_sdl/src/blitter_impl.hpp    2007-08-02 03:53:49 UTC (rev 
2772)
+++ branches/pingus_sdl/src/blitter_impl.hpp    2007-08-02 04:15:17 UTC (rev 
2773)
@@ -31,8 +31,8 @@
 /** Rotate a surface 90 degree */
 struct transform_rot90
 {
-  static inline int get_index(int width, int height, int pitch, int x, int y) {
-    return (x * height) + (height - y - 1);
+  static inline int get_index(int width, int height, int spitch, int tpitch, 
int x, int y) {
+    return (x * tpitch) + (height - y - 1);
   }
 
   static inline int get_x(int width, int height, int x, int y) {
@@ -50,8 +50,8 @@
 /** Rotate a surface 180 degree */
 struct transform_rot180
 {
-  static inline int get_index(int width, int height, int pitch, int x, int y) {
-    return (pitch * height) - (y * pitch + x) - 1;
+  static inline int get_index(int width, int height, int spitch, int tpitch, 
int x, int y) {
+    return (spitch * height) - (y * spitch + x) - 1;
   }
 
   static inline int get_x(int width, int height, int x, int y) { 
UNUSED_ARG(height); UNUSED_ARG(y);
@@ -69,8 +69,8 @@
 /** Rotate a surface 270 degree */
 struct transform_rot270
 {
-  static inline int get_index(int width, int height, int pitch, int x, int y) {
-    return ((width - x - 1) * height) + y;
+  static inline int get_index(int width, int height, int spitch, int tpitch, 
int x, int y) {
+    return ((width - x - 1) * tpitch) + y;
   }
 
   static inline int get_x(int width, int height, int x, int y) {
@@ -92,9 +92,9 @@
 /** flip a surface  */
 struct transform_flip
 {
-  static inline int get_index(int width, int height, int pitch, int x, int y) {
+  static inline int get_index(int width, int height, int spitch, int tpitch, 
int x, int y) {
     UNUSED_ARG(height);
-    return (y * pitch) + (width - x - 1);
+    return (y * spitch) + (width - x - 1);
   }
 
   static inline int get_x(int width, int height, int x, int y) {
@@ -114,9 +114,9 @@
 /** Rotate a surface 90 degree and then flip it */
 struct transform_rot90_flip
 {
-  static inline int get_index(int width, int height, int pitch, int x, int y) {
+  static inline int get_index(int width, int height, int spitch, int tpitch, 
int x, int y) {
     UNUSED_ARG(width);
-    return (x * height) + y;
+    return (x * tpitch) + y;
   }
 
   static inline int get_x(int width, int height, int x, int y) {
@@ -136,8 +136,8 @@
 /** Rotate a surface 180 degree and then flip it */
 struct transform_rot180_flip
 {
-  static inline int get_index(int width, int height, int pitch, int x, int y) {
-    return ((height - y - 1) * pitch) + x;
+  static inline int get_index(int width, int height, int spitch, int tpitch, 
int x, int y) {
+    return ((height - y - 1) * spitch) + x;
   }
 
   static inline int get_x(int width, int height, int x, int y) {
@@ -157,8 +157,8 @@
 /** Rotate a surface 270 degree and then flip it */
 struct transform_rot270_flip
 {
-  static inline int get_index(int width, int height, int pitch, int x, int y) {
-    return ((width - x - 1) * height) + height - y - 1;
+  static inline int get_index(int width, int height, int spitch, int tpitch, 
int x, int y) {
+    return ((width - x - 1) * tpitch) + height - y - 1;
   }
 
   static inline int get_x(int width, int height, int x, int y) {
@@ -196,7 +196,7 @@
       for (int y = 0; y < source->h; ++y)
         for (int x = 0; x < source->w; ++x)
           {
-            target_buf[TransF::get_index(source->w, source->h, source->pitch, 
x, y)] = source_buf[y * source->pitch + x];
+            target_buf[TransF::get_index(source->w, source->h, source->pitch, 
target->pitch, x, y)] = source_buf[y * source->pitch + x];
           }
      
       SDL_UnlockSurface(source);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]