summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2d4aaa4)
raw | patch | inline | side by side (parent: 2d4aaa4)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 20 Feb 2023 13:16:24 +0000 (16:16 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 09:19:11 +0000 (12:19 +0300) |
src/game/renders/opengl/r_draw.pas | patch | blob | history |
index 324d0a2d27be2038802edc1fb9dec6f723e9fcd5..be5d947aaf8365933d5ba226a611b7b51155fe17 100644 (file)
glEnd();
end;
+ procedure DrawTextureError (x, y, w, h: Integer);
+ var w2, h2: Integer;
+ begin
+ w2 := w div 2; h2 := h div 2;
+ r_Draw_FillRect(x, y, x + w2, y + h2, 255, 0, 255, 255);
+ r_Draw_FillRect(x + w2, y, x + w, y + h2, 255, 255, 255, 255);
+ r_Draw_FillRect(x + w2, y + h2, x + w, y + h, 255, 0, 255, 255);
+ r_Draw_FillRect(x, y + h2, x + w2, y + h, 255, 255, 255, 255);
+ if (w > 2) and (h > 2) then
+ r_Draw_Rect(x, y, x + w, y + h, 0, 255, 0, 255);
+ end;
+
procedure DrawTile (tile: TGLAtlasNode; x, y, w, h: Integer; flip: Boolean; rr, gg, bb, aa: Byte; blend: Boolean);
var nw, nh, ax, bx, ay, by: GLfloat; l, t, r, b: Integer;
begin
if tile = nil then
begin
- r_Draw_SetColor(rr, gg, bb, aa);
- if blend then glBlendFunc(GL_SRC_ALPHA, GL_ONE) else glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- r_Draw_EnableTexture2D(false);
- glEnable(GL_BLEND);
- DrawQuad(x, y, w, h);
+ DrawTextureError(x, y, w, h);
end
else
begin
ASSERT(w >= 0);
ASSERT(h >= 0);
if img = nil then
- DrawTile(nil, x, y, w, h, flip, NTR, NTB, NTG, NTA, blend)
+ DrawTextureError(x, y, w, h)
else
begin
if flip then first := img.cols - 1 else first := 0;
ASSERT(w >= 0);
ASSERT(h >= 0);
if img = nil then
- r_Draw_Texture(nil, x, y, w, h, flip, NTR, NTG, NTB, NTB, blend)
+ DrawTextureError(x, y, w, h)
else if r_Draw_IsHWRepeatable(img) then
DrawHWTexture(img.GetTile(0, 0).base.id, img.width, img.height, x, y, w, h, flip, r, g, b, a, blend)
else
begin
ASSERT(anim.IsValid());
if m = nil then
- r_Draw_TextureRepeat(nil, x, y, w, h, flip, NTR, NTG, NTB, NTB, blend)
+ DrawTextureError(x, y, w, h)
else
begin
g_Anim_GetFrameFromState(anim, backanim, frame);