configurable wave height

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6847 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
sireus
2012-06-28 21:52:48 +00:00
parent b2379e90d4
commit 55a68dde53
3 changed files with 18 additions and 11 deletions
+1
View File
@@ -57,6 +57,7 @@ Mapping
[*] entproperty now works in MP coop, but buffered.
[*] Textures can now have a non-default scale, definable through the texture command.
[*] Multiple selections support
[*] Configurable wave height
Rendering / HUD / ...
---------------------
+5
View File
@@ -6968,6 +6968,11 @@ Output:
</arguments>
</command>
<variable name="waveheight">
<description>Sets the wave height of water, between 0 (completely still, no waves at all) and 1 (very choppy).</description>
<value token="F" description="wave height (floating-point value)" minValue="0" maxValue="1" defaultValue="0.3" />
</variable>
</identifiers>
</section>
<!-- Editing Configs Section Ends -->
+3 -2
View File
@@ -25,6 +25,7 @@ void setwatercolor(const char *r, const char *g, const char *b, const char *a)
}
COMMANDN(watercolour, setwatercolor, ARG_4STR);
FVAR(waveheight, 0, 0.3f, 1.0f);
// renders water for bounding rect area that contains water... simple but very inefficient
@@ -39,7 +40,7 @@ COMMANDN(watercolour, setwatercolor, ARG_4STR);
float angle = v1*v2*0.1f/(2*M_PI) + t; \
float s = angle - int(angle) - 0.5f; \
s *= 8 - fabs(s)*16; \
float h = 0.3f*s; \
float h = waveheight*0.5f*s; \
varray::attrib<float>(v1, v2, v3+h); \
body; \
}
@@ -51,7 +52,7 @@ COMMANDN(watercolour, setwatercolor, ARG_4STR);
})
#define VERTWT(vertwt, defbody, body) \
VERTWC(vertwt, defbody, { \
float duv = 0.2f*v; \
float duv = waveheight*0.5f*v; \
body; \
})