aboutsummaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-10-22 14:52:16 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-10-22 14:52:16 +0000
commitd58efe052081f5cfc2bb5c211d9129c5d7d9aab7 (patch)
tree57fb556e9ab4d2cf0903295ae7b0f3f5a5578d7e /src/base
parent24619128289bcd497d59a2fba9645f1052714dac (diff)
downloadusdx-d58efe052081f5cfc2bb5c211d9129c5d7d9aab7.tar.gz
usdx-d58efe052081f5cfc2bb5c211d9129c5d7d9aab7.tar.xz
usdx-d58efe052081f5cfc2bb5c211d9129c5d7d9aab7.zip
disable blending after drawing of particles
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2688 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/base')
-rw-r--r--src/base/UGraphicClasses.pas28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/base/UGraphicClasses.pas b/src/base/UGraphicClasses.pas
index cdaa238e..55d91e39 100644
--- a/src/base/UGraphicClasses.pas
+++ b/src/base/UGraphicClasses.pas
@@ -356,25 +356,31 @@ procedure TParticle.Draw;
var
L: cardinal;
begin
- if ScreenAct = Screen then
+ if (ScreenAct = Screen) then
+ begin
+ glEnable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, Tex);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
+
// this draws (multiple) texture(s) of our particle
for L := 0 to High(Col) do
begin
glColor4f(Col[L].r, Col[L].g, Col[L].b, Alpha);
- glBindTexture(GL_TEXTURE_2D, Tex);
- glEnable(GL_TEXTURE_2D);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
glBegin(GL_QUADS);
- glTexCoord2f((1/16) * Frame, 0); glVertex2f(X-W*Scale[L]*SizeMod, Y-H*Scale[L]*SizeMod);
- glTexCoord2f((1/16) * Frame + (1/16), 0); glVertex2f(X-W*Scale[L]*SizeMod, Y+H*Scale[L]*SizeMod);
- glTexCoord2f((1/16) * Frame + (1/16), 1); glVertex2f(X+W*Scale[L]*SizeMod, Y+H*Scale[L]*SizeMod);
- glTexCoord2f((1/16) * Frame, 1); glVertex2f(X+W*Scale[L]*SizeMod, Y-H*Scale[L]*SizeMod);
+ glTexCoord2f((1/16) * Frame, 0); glVertex2f(X-W*Scale[L]*SizeMod, Y-H*Scale[L]*SizeMod);
+ glTexCoord2f((1/16) * Frame + (1/16), 0); glVertex2f(X-W*Scale[L]*SizeMod, Y+H*Scale[L]*SizeMod);
+ glTexCoord2f((1/16) * Frame + (1/16), 1); glVertex2f(X+W*Scale[L]*SizeMod, Y+H*Scale[L]*SizeMod);
+ glTexCoord2f((1/16) * Frame, 1); glVertex2f(X+W*Scale[L]*SizeMod, Y-H*Scale[L]*SizeMod);
glEnd;
end;
- glcolor4f(1,1,1,1);
+
+ glDisable(GL_BLEND);
+ glDisable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, 0);
+ glcolor4f(1,1,1,1);
+ end;
end;
// end of TParticle