summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2399d51)
raw | patch | inline | side by side (parent: 2399d51)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 10 Jun 2022 18:33:39 +0000 (21:33 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 08:42:44 +0000 (11:42 +0300) |
src/game/renders/opengl/r_draw.pas | patch | blob | history | |
src/game/renders/opengl/r_map.pas | patch | blob | history |
index 07d805cf45b928df653a611b675c963197dcd1d2..c2bfc245726f040e249c9455835317666c7726a3 100644 (file)
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);
procedure r_Draw_Filter (l, t, r, b: Integer; rr, gg, bb, aa: Byte);
+ procedure r_Draw_FillRect (l, t, r, b: Integer; rr, gg, bb, aa: Byte);
+ procedure r_Draw_InvertRect (l, t, r, b: Integer; rr, gg, bb, aa: Byte);
implementation
glEnd;
end;
+ procedure r_Draw_FillRect (l, t, r, b: Integer; rr, gg, bb, aa: Byte);
+ begin
+ ASSERT(r >= l);
+ ASSERT(b >= t);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glDisable(GL_TEXTURE_2D);
+ glColor4ub(rr, gg, bb, aa);
+ glBegin(GL_QUADS);
+ glVertex2i(l, t);
+ glVertex2i(r, t);
+ glVertex2i(r, b);
+ glVertex2i(l, b);
+ glEnd;
+ end;
+
+ procedure r_Draw_InvertRect (l, t, r, b: Integer; rr, gg, bb, aa: Byte);
+ begin
+ ASSERT(r >= l);
+ ASSERT(b >= t);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
+ glDisable(GL_TEXTURE_2D);
+ glColor4ub(rr, gg, bb, aa);
+ glBegin(GL_QUADS);
+ glVertex2i(l, t);
+ glVertex2i(r, t);
+ glVertex2i(r, b);
+ glVertex2i(l, b);
+ glEnd;
+ end;
+
end.
index 3364f1f3ddd94830a9bb4d387d58168302527ad6..c974664acf4e043c7f1f96edfb988b8878b8b556 100644 (file)
begin
if (drawed <> nil) and ((p = drawed) or ((p.Team = drawed.Team) and (gGameSettings.GameMode <> GM_DM))) then
begin
- if (p.FMegaRulez[MR_INVIS] - gTime <= 2100) and not ODD((p.FMegaRulez[MR_INVIS] - gTime) div 300) then
+ if (p.FMegaRulez[MR_INVIS] - gTime > 2100) or not ODD((p.FMegaRulez[MR_INVIS] - gTime) div 300) then
alpha := 55;
end
else
if y < -svh then y := -svh;
end;
+ procedure r_Map_DrawScreenEffect (x, y, w, h, level: Integer; r, g, b: Byte);
+ var i: Integer;
+ begin
+ if level > 0 then
+ begin
+ case level of
+ 0..14: i := 0;
+ 15..34: i := 1;
+ 35..54: i := 2;
+ 55..74: i := 3;
+ 75..94: i := 4;
+ else i := 5
+ end;
+ r_Draw_FillRect(x, y, x + w, y + h, r, g, b, i * 50)
+ end;
+ end;
+
+ procedure r_Map_DrawScreenEffects (x, y, w, h: Integer; p: TPlayer);
+ var i: Integer;
+ begin
+ if p <> nil then
+ begin
+ r_Map_DrawScreenEffect(x, y, w, h, p.pain, 255, 0, 0);
+ r_Map_DrawScreenEffect(x, y, w, h, p.pickup, 150, 200, 150);
+ if (p.FMegaRulez[MR_INVUL] >= gTime) and (p.SpawnInvul < gTime) then
+ begin
+ if ((p.FMegaRulez[MR_INVUL] - gTime) > 2100) or not ODD((p.FMegaRulez[MR_INVUL] - gTime) div 300) then
+ r_Draw_InvertRect(x, y, x + w, y + h, 191, 191, 191, 255);
+ end;
+ if p.FMegaRulez[MR_SUIT] >= gTime then
+ begin
+ if ((p.FMegaRulez[MR_SUIT] - gTime) > 2100) or not ODD((p.FMegaRulez[MR_SUIT] - gTime) div 300) then
+ r_Draw_FillRect(x, y, x + w, y + h, 0, 96, 0, 55);
+ end;
+ if (p.Berserk >= 0) and (p.Berserk >= gTime) and (gFlash = 2) then
+ begin
+ r_Draw_FillRect(x, y, x + w, y + h, 255, 0, 0, 55);
+ end;
+ end;
+ end;
+
procedure r_Map_Draw (x, y, w, h, camx, camy: Integer; player: TPlayer);
var iter: TPanelGrid.Iter; p: PPanel; cx, cy, xx, yy, ww, hh: Integer; sx, sy, sw, sh: LongInt;
begin
// TODO draw players indicators
glPopMatrix;
- // TODO draw player pain
- // TODO draw player pickup
- // TODO draw player invul
- // TODO draw minimap
+ r_Map_DrawScreenEffects(x, y, w, h, player);
+
+ // TODO draw minimap (gShowMap)
// TODO draw g_debug_player
end;