hedgewars/uTypes.pas
changeset 7304 8b3575750cd2
parent 7297 af64b509725c
child 7374 514138949c76
equal deleted inserted replaced
7301:bea42438a2ec 7304:8b3575750cd2
   211                 priority: GLfloat;
   211                 priority: GLfloat;
   212             end;
   212             end;
   213 
   213 
   214     PVertexRect = ^TVertexRect;
   214     PVertexRect = ^TVertexRect;
   215     TVertexRect = array[0..3] of TVertex2f;
   215     TVertexRect = array[0..3] of TVertex2f;
       
   216 
       
   217     TCropInformation = record
       
   218         l, r, t, b: Integer; // cropped pixels for each side
       
   219         x, y: Integer;       // pivot (center) of the sprite in the cropped image
       
   220     end;
   216     
   221     
   217     TTexture = record
   222     TTexture = record
   218             atlas: PAtlas;
   223             atlas: PAtlas;
   219             w, h, scale: LongInt;
   224             w, h, scale: LongInt;
   220 
   225 
   221             x, y: LongInt; // Offset in the texture atlas
   226             x, y: LongInt; // Offset in the texture atlas
       
   227             cropInfo: TCropInformation;
       
   228 
   222             isRotated: boolean; // if true sprite is flipped in the atlas taking w pixels along the y and h pixels along the x axis
   229             isRotated: boolean; // if true sprite is flipped in the atlas taking w pixels along the y and h pixels along the x axis
   223 
   230 
   224             shared: boolean; // true if in an atlas, false if atlas points to a dedicated texture for this sprite
   231             shared: boolean; // true if in an atlas, false if atlas points to a dedicated texture for this sprite
   225 
   232 
   226             surface: PSDL_Surface; // retained in memory surface
   233             surface: PSDL_Surface; // retained in memory surface
   227 
   234 
   228             // Cached values for texel coordinates and vertex coordinates            
   235             // Cached values for texel coordinates and vertex coordinates            
   229             vb, tb: TVertexRect;
   236             vb, tb: TVertexRect;
   230 
   237 
   231             PrevTexture, NextTexture: PTexture;
   238             nextFrame: PTexture;
   232             end;
   239             end;
   233 
   240 
   234     THogEffect = (heInvulnerable, heResurrectable, hePoisoned, heResurrected, heFrozen);
   241     THogEffect = (heInvulnerable, heResurrectable, hePoisoned, heResurrected, heFrozen);
   235 
   242 
   236     TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite);
   243     TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite);