X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_gfx.pas;h=e4c46f199d17a9bf74a2180be95d1ff5e4fc0c4c;hb=d8cb72ed4297af2d519c52270f8f32ddfd7fc58b;hp=878c45acf560339b232bcb0db62bc52a2993378c;hpb=f4fc3b435118e5d9e4085da37014436d2e063259;p=d2df-sdl.git diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas index 878c45a..e4c46f1 100644 --- a/src/game/g_gfx.pas +++ b/src/game/g_gfx.pas @@ -26,6 +26,8 @@ uses const BLOOD_NORMAL = 0; BLOOD_SPARKS = 1; + BLOOD_CSPARKS = 2; + BLOOD_COMBINE = 3; ONCEANIM_NONE = 0; ONCEANIM_SMOKE = 1; @@ -78,11 +80,7 @@ function awmIsSetHolmes (x, y: Integer): Boolean; inline; implementation uses -{$IFDEF USE_NANOGL} - nanoGL, -{$ELSE} - GL, GLExt, -{$ENDIF} + {$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; @@ -925,6 +923,11 @@ begin begin g_GFX_SparkVel(fX, fY, 2+Random(2), -vx div 2, -vy div 2, devX, devY); exit; + end + else if (kind = BLOOD_CSPARKS) OR (kind = BLOOD_COMBINE) then + begin + g_GFX_SparkVel(fX, fY, count, -vx div 2, -vy div 2, devX, devY); + if kind <> BLOOD_COMBINE then exit end; l := Length(Particles); @@ -1624,8 +1627,18 @@ 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; @@ -1640,6 +1653,34 @@ begin 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); @@ -1657,6 +1698,7 @@ begin end; glEnd(); +{$ENDIF} glDisable(GL_BLEND); end;