hedgewars/uTypes.pas
changeset 7080 dbf43c07a507
parent 7034 e3639ce1d4f8
child 7111 5ba5a92d74fb
--- a/hedgewars/uTypes.pas	Mon May 14 22:47:56 2012 +0400
+++ b/hedgewars/uTypes.pas	Mon May 14 19:26:50 2012 +0200
@@ -199,13 +199,28 @@
             X, Y: GLint;
             end;
 
+    PAtlas = ^TAtlas;
     PTexture = ^TTexture;
+
+    TAtlas = record
+                id: GLuint;
+                w, h: LongInt;
+                priority: GLfloat;
+            end;
+
+    PVertexRect = ^TVertexRect;
+    TVertexRect = array[0..3] of TVertex2f;
+    
     TTexture = record
-            id: GLuint;
+            atlas: PAtlas;
             w, h, scale: LongInt;
-            rx, ry: GLfloat;
-            priority: GLfloat;
-            vb, tb: array [0..3] of TVertex2f;
+
+            x, y: LongInt; // Offset in the texture atlas
+            isRotated: boolean; // if true sprite is flipped in the atlas taking w pixels along the y and h pixels along the x axis
+
+            // Cached values for texel coordinates and vertex coordinates            
+            vb, tb: TVertexRect;
+
             PrevTexture, NextTexture: PTexture;
             end;