X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Frenders%2Fopengl%2Fr_draw.pas;h=e836b30d1190e7923f536587de66c616106fd3e0;hb=0a015427343163d4b6e7939c9a07f34d386f7a88;hp=ef2a38bfc31563affc81ba53864e615469e406b1;hpb=99e8b41f80c372df968e5a10586667f856a66a87;p=d2df-sdl.git diff --git a/src/game/renders/opengl/r_draw.pas b/src/game/renders/opengl/r_draw.pas index ef2a38b..e836b30 100644 --- a/src/game/renders/opengl/r_draw.pas +++ b/src/game/renders/opengl/r_draw.pas @@ -24,6 +24,7 @@ interface procedure r_Draw_Texture (img: TGLTexture; x, y, w, h: Integer; flip: Boolean; r, g, b, a: Byte; blend: Boolean); procedure r_Draw_TextureRepeat (img: TGLTexture; x, y, w, h: Integer; flip: Boolean; r, g, b, a: Byte; blend: Boolean); + procedure r_Draw_TextureRepeatRotate (img: TGLTexture; x, y, w, h: Integer; flip: Boolean; r, g, b, a: Byte; blend: Boolean; rx, ry, angle: Integer); procedure r_Draw_MultiTextureRepeat (m: TGLMultiTexture; const anim: TAnimState; x, y, w, h: Integer; flip: Boolean; r, g, b, a: Byte; blend: Boolean); procedure r_Draw_MultiTextureRepeatRotate (m: TGLMultiTexture; const anim: TAnimState; x, y, w, h: Integer; flip: Boolean; r, g, b, a: Byte; blend: Boolean; rx, ry, angle: Integer); @@ -148,6 +149,23 @@ implementation r_Draw_Texture(img, x + i * img.width, y + j * img.height, img.width, img.height, flip, r, g, b, a, blend); end; + procedure r_Draw_TextureRepeatRotate (img: TGLTexture; x, y, w, h: Integer; flip: Boolean; r, g, b, a: Byte; blend: Boolean; rx, ry, angle: Integer); + begin + ASSERT(w >= 0); + ASSERT(h >= 0); + if a <> 0 then + begin + glPushMatrix; + glTranslatef(x + rx, y + ry, 0); + glRotatef(angle, 0, 0, 1); + glTranslatef(-(x + rx), -(y + ry), 0); + r_Draw_TextureRepeat(img, x, y, w, h, flip, r, g, b, a, blend); + glPopMatrix; + end + else + r_Draw_TextureRepeat(img, x, y, w, h, flip, r, g, b, a, blend); + end; + procedure r_Draw_MultiTextureRepeat (m: TGLMultiTexture; const anim: TAnimState; x, y, w, h: Integer; flip: Boolean; r, g, b, a: Byte; blend: Boolean); var img: TGLTexture; cur, total, i: Integer; begin @@ -170,7 +188,6 @@ implementation end; procedure r_Draw_MultiTextureRepeatRotate (m: TGLMultiTexture; const anim: TAnimState; x, y, w, h: Integer; flip: Boolean; r, g, b, a: Byte; blend: Boolean; rx, ry, angle: Integer); - var i, j: Integer; begin ASSERT(w >= 0); ASSERT(h >= 0);