summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c903425)
raw | patch | inline | side by side (parent: c903425)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 8 Jun 2022 11:20:57 +0000 (14:20 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 08:40:08 +0000 (11:40 +0300) |
src/game/renders/opengl/r_draw.pas | patch | blob | history | |
src/game/renders/opengl/r_map.pas | patch | blob | history |
index d76f493e3ed590f9ec3122b60b90731271ba5a14..379080004e5c0a2f5f68711ee12eba48bc6b3546 100644 (file)
procedure r_Draw_TextureRepeat (img: TGLTexture; x, y, w, h: Integer; flip: Boolean);
procedure r_Draw_MultiTextureRepeat (m: TGLMultiTexture; const a: TAnimState; x, y, w, h: Integer; flip: Boolean);
+ procedure r_Draw_MultiTextureRepeatRotate (img: TGLMultiTexture; const anim: TAnimState; x, y, w, h: Integer; flip: Boolean; rx, ry, a: Integer);
procedure r_Draw_Filter (l, t, r, b: Integer; rr, gg, bb, aa: Byte);
end
end;
+ procedure r_Draw_MultiTextureRepeatRotate (img: TGLMultiTexture; const anim: TAnimState; x, y, w, h: Integer; flip: Boolean; rx, ry, a: Integer);
+ var i, j: Integer;
+ begin
+ ASSERT(w >= 0);
+ ASSERT(h >= 0);
+ if a <> 0 then
+ begin
+ glPushMatrix;
+ glTranslatef(x + rx, y + ry, 0);
+ glRotatef(a, 0, 0, 1);
+ glTranslatef(-(x + rx), -(y + ry), 0);
+ r_Draw_MultiTextureRepeat(img, anim, x, y, w, h, flip);
+ glPopMatrix;
+ end
+ else
+ r_Draw_MultiTextureRepeat(img, anim, x, y, w, h, flip);
+ end;
+
procedure r_Draw_Filter (l, t, r, b: Integer; rr, gg, bb, aa: Byte);
begin
ASSERT(r >= l);
index 4837e1b8c4c71654c8c30f37ccc5c6d1cd3f3fdd..0588f0da35ed92c1b2bbda5f26b9b1fe85dce29f 100644 (file)
typ := Shots[i].ShotType;
if typ <> 0 then
begin
- e_logwritefln('draw shot %s typ %s', [i, typ]);
tex := ShotTextures[typ];
if tex <> nil then
begin
- e_logwritefln('draw shot %s typ %s <> nil', [i, typ]);
a := 0;
case typ of
WEAPON_ROCKETLAUNCHER, WEAPON_BARON_FIRE, WEAPON_MANCUB_FIRE, WEAPON_SKEL_FIRE:
Shots[i].Obj.Lerp(gLerpFactor, fX, fY);
pX := Shots[i].Obj.Rect.Width div 2;
pY := Shots[i].Obj.Rect.Height div 2;
- // TODO fix this
+ // TODO fix this hack
if Shots[i].Animation.IsValid() then anim := @Shots[i].Animation else anim := @StubShotAnim;
- // TODO: change angle and base point
- r_Draw_MultiTextureRepeat(tex, anim^, fX, fY, tex.width, tex.height, false);
+ r_Draw_MultiTextureRepeatRotate(tex, anim^, fX, fY, tex.width, tex.height, false, pX, pY, a);
end;
end;
end;