higher resolution for waterlevel

Interpret the waterlevel value as tenths of a cube.

This makes the waterlevel variable a float value to the user, while the
map file still stores an integer value - but now it is interpreted
differently - for example, a waterlevel value of 123 now means 12.3 cubes
instead of 123. Old map files are converted during loading.

Note: the values of waterlevel and hdr.waterlevel need to be in sync.

DOCREF waterlevel
This commit is contained in:
ac-stef
2015-05-18 14:59:41 +02:00
parent b1b789eefc
commit ea480a7b0c
15 changed files with 39 additions and 32 deletions
+2 -2
View File
@@ -840,7 +840,7 @@ void drawminimap(int w, int h)
renderzones(mapdims.maxceil);
//renderentities();// IMHO better done by radar itself, if at all
resettmu(0);
float hf = hdr.waterlevel-0.3f;
float hf = waterlevel - 0.3f;
renderwater(hf, 0, 0);
//draw a black border to prevent the minimap texture edges from bleeding in radarview
@@ -1001,7 +1001,7 @@ void gl_drawframe(int w, int h, float changelod, float curfps)
aspect = float(w)/h;
fovy = 2*atan2(tan(float(dynfov())/2*RAD), aspect)/RAD;
float hf = hdr.waterlevel-0.3f;
float hf = waterlevel - 0.3f;
bool underwater = camera1->o.z<hf;
glFogi(GL_FOG_START, (fog+64)/8);