From 2f698c3df4efe80c228b0367c49fceab07e25ba9 Mon Sep 17 00:00:00 2001 From: driAn Date: Mon, 19 May 2008 20:55:37 +0000 Subject: [PATCH] fixed underwater projection git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2057 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/rendergl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/src/rendergl.cpp b/source/src/rendergl.cpp index 4e681d2c..ed537c0b 100644 --- a/source/src/rendergl.cpp +++ b/source/src/rendergl.cpp @@ -780,9 +780,6 @@ void gl_drawframe(int w, int h, float changelod, float curfps) glMatrixMode(GL_PROJECTION); glLoadIdentity(); - farplane = fog*5/2; - gluPerspective(fovy, aspect, 0.15f, farplane); - glMatrixMode(GL_MODELVIEW); if(underwater) { @@ -793,7 +790,12 @@ void gl_drawframe(int w, int h, float changelod, float curfps) glFogi(GL_FOG_START, 0); glFogi(GL_FOG_END, (fog+96)/8); } - else if(waterreflect) + + farplane = fog*5/2; + gluPerspective(fovy, aspect, 0.15f, farplane); + glMatrixMode(GL_MODELVIEW); + + if(!underwater && waterreflect) { extern int wx1; if(wx1>=0)