X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_gfx.pas;h=4e9cdd89354dc382ed48437bc452b2f20043cf94;hb=92c7868df227201d6914f9f07c9a29ba0e2863cb;hp=9eb3c04dfca5c45ea5219031e1b1364c214b488a;hpb=d7d166dc3cd287276202e862746208892c4cc89f;p=d2df-sdl.git diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas index 9eb3c04..4e9cdd8 100644 --- a/src/game/g_gfx.pas +++ b/src/game/g_gfx.pas @@ -1,4 +1,4 @@ -(* Copyright (C) DooM 2D:Forever Developers +(* Copyright (C) Doom 2D: Forever Developers * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -78,7 +78,8 @@ function awmIsSetHolmes (x, y: Integer): Boolean; inline; implementation uses - g_map, g_panel, g_basic, Math, e_graphics, GL, GLExt, + {$INCLUDE ../nogl/noGLuses.inc} + g_map, g_panel, g_basic, Math, e_graphics, g_options, g_console, SysUtils, g_triggers, MAPDEF, g_game, g_language, g_net, utils, xprofiler; @@ -1619,19 +1620,60 @@ end; procedure g_GFX_Draw (); -var - a, len: Integer; + var + a, len: Integer; +{$IFDEF USE_NANOGL} + type + Vertex = record + x, y: GLfloat; + r, g, b, a: GLfloat; + end; + var + count: Integer; + v: array of Vertex; +{$ENDIF} begin if not gpart_dbg_enabled then exit; if (Particles <> nil) then begin glDisable(GL_TEXTURE_2D); - glPointSize(2); + if (g_dbg_scale < 0.6) then glPointSize(1) + else if (g_dbg_scale > 1.3) then glPointSize(g_dbg_scale+1) + else glPointSize(2); + glDisable(GL_POINT_SMOOTH); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); +{$IFDEF USE_NANOGL} + count := 0; + SetLength(v, Length(Particles)); + for a := 0 to High(Particles) do + begin + with Particles[a] do + begin + if alive and (x >= sX) and (y >= sY) and (x <= sX + sWidth) and (sY <= sY + sHeight) then + begin + v[count].x := x + 0.37; + v[count].y := y + 0.37; + v[count].r := red / 255; + v[count].g := green / 255; + v[count].b := blue / 255; + v[count].a := alpha / 255; + Inc(count); + end; + end; + end; + + glVertexPointer(2, GL_FLOAT, SizeOf(Vertex), @v[0].x); + glColorPointer(4, GL_FLOAT, SizeOf(Vertex), @v[0].r); + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + glDisableClientState(GL_NORMAL_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDrawArrays(GL_POINTS, 0, count); +{$ELSE} glBegin(GL_POINTS); len := High(Particles); @@ -1649,6 +1691,7 @@ begin end; glEnd(); +{$ENDIF} glDisable(GL_BLEND); end;