Respect alpha channel
authorunc0rr
Fri, 25 Jan 2008 23:55:03 +0000
changeset 756 2b307457fd68
parent 755 edf26e9554ac
child 757 ddbff94153e8
Respect alpha channel
hedgewars/hwengine.dpr
hedgewars/uStore.pas
hedgewars/uWorld.pas
--- a/hedgewars/hwengine.dpr	Fri Jan 25 23:33:35 2008 +0000
+++ b/hedgewars/hwengine.dpr	Fri Jan 25 23:55:03 2008 +0000
@@ -101,13 +101,11 @@
               end;
      gsGame : begin
               ProcessKbd;
-              glClear(GL_COLOR_BUFFER_BIT);
               DoGameTick(Lag);
               DrawWorld(Lag, SDLPrimSurface);
               end;
    gsConsole: begin
               DoGameTick(Lag);
-              glClear(GL_COLOR_BUFFER_BIT);
 //              DrawWorld(Lag, SDLPrimSurface);
 //              DrawConsole(SDLPrimSurface);
               end;
--- a/hedgewars/uStore.pas	Fri Jan 25 23:33:35 2008 +0000
+++ b/hedgewars/uStore.pas	Fri Jan 25 23:55:03 2008 +0000
@@ -495,14 +495,11 @@
 begin
 aspect:= cScreenWidth / cScreenHeight;
 
+glLoadIdentity;
 glViewport(0, 0, cScreenWidth, cScreenHeight);
 glScalef(2.0 / cScreenWidth, -2.0 / cScreenHeight, 1.0);
 glTranslatef(-cScreenWidth / 2, -cScreenHeight / 2, 0);
-//glMatrixMode(GL_PROJECTION);
-//glLoadIdentity();
-
-//gluPerspective(60.0, aspect, 0.1, 100.0);
-
+glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 glMatrixMode(GL_MODELVIEW)
 end;
 
--- a/hedgewars/uWorld.pas	Fri Jan 25 23:33:35 2008 +0000
+++ b/hedgewars/uWorld.pas	Fri Jan 25 23:55:03 2008 +0000
@@ -38,7 +38,7 @@
     Frames: Longword = 0;
 
 implementation
-uses uStore, uMisc, uTeams, uIO, uConsole, uKeys, uLocale, uSound;
+uses uStore, uMisc, uTeams, uIO, uConsole, uKeys, uLocale, uSound, GL;
 const FPS: Longword = 0;
       CountTicks: Longword = 0;
       SoundTimerTicks: Longword = 0;
@@ -169,6 +169,9 @@
     end;
 
 begin
+glClear(GL_COLOR_BUFFER_BIT);
+glEnable(GL_BLEND);
+
 if not isPaused then MoveCamera;
 
 // Sky
@@ -375,7 +378,9 @@
       str(ChangeVolume(cVolumeDelta), s);
       AddCaption(Format(trmsg[sidVolume], s), $FFFFFF, capgrpVolume)
       end
-   end
+   end;
+
+glDisable(GL_BLEND)
 end;
 
 procedure AddCaption(s: string; Color: Longword; Group: TCapGroup);