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:
@@ -57,6 +57,7 @@ Mapping
|
|||||||
[*] entproperty now works in MP coop, but buffered.
|
[*] entproperty now works in MP coop, but buffered.
|
||||||
[*] Textures can now have a non-default scale, definable through the texture command.
|
[*] Textures can now have a non-default scale, definable through the texture command.
|
||||||
[*] Multiple selections support
|
[*] Multiple selections support
|
||||||
|
[*] Configurable wave height
|
||||||
|
|
||||||
Rendering / HUD / ...
|
Rendering / HUD / ...
|
||||||
---------------------
|
---------------------
|
||||||
|
|||||||
+14
-9
@@ -1270,7 +1270,7 @@ echo foo
|
|||||||
<identifierReference identifier="add2list"/>
|
<identifierReference identifier="add2list"/>
|
||||||
</references>
|
</references>
|
||||||
</scriptalias>
|
</scriptalias>
|
||||||
|
|
||||||
<command name="MDArray_New_Subarray">
|
<command name="MDArray_New_Subarray">
|
||||||
<description>Adds a subarray to a cubescript multidimensional array. (alias)</description>
|
<description>Adds a subarray to a cubescript multidimensional array. (alias)</description>
|
||||||
<examples>
|
<examples>
|
||||||
@@ -1295,7 +1295,7 @@ echo foo
|
|||||||
<identifierReference identifier="MDArray_Search"/>
|
<identifierReference identifier="MDArray_Search"/>
|
||||||
</references>
|
</references>
|
||||||
</command>
|
</command>
|
||||||
|
|
||||||
<command name="MDArray_Add_To_Subarray">
|
<command name="MDArray_Add_To_Subarray">
|
||||||
<description>Adds a string to an existing subarray in a cubescript multidimensional array.</description>
|
<description>Adds a string to an existing subarray in a cubescript multidimensional array.</description>
|
||||||
<examples>
|
<examples>
|
||||||
@@ -1319,7 +1319,7 @@ echo foo
|
|||||||
<identifierReference identifier="MDArray_Search"/>
|
<identifierReference identifier="MDArray_Search"/>
|
||||||
</references>
|
</references>
|
||||||
</command>
|
</command>
|
||||||
|
|
||||||
<command name="MDArray_Get">
|
<command name="MDArray_Get">
|
||||||
<description>Returns a subarray or a subarray element of a cubescript multidimensional array.</description>
|
<description>Returns a subarray or a subarray element of a cubescript multidimensional array.</description>
|
||||||
<examples>
|
<examples>
|
||||||
@@ -1344,7 +1344,7 @@ echo foo
|
|||||||
<identifierReference identifier="MDArray_Search"/>
|
<identifierReference identifier="MDArray_Search"/>
|
||||||
</references>
|
</references>
|
||||||
</command>
|
</command>
|
||||||
|
|
||||||
<command name="MDArray_Modify_Subarray">
|
<command name="MDArray_Modify_Subarray">
|
||||||
<description>Modifies a subarray element of a cubescript multidimensional array.</description>
|
<description>Modifies a subarray element of a cubescript multidimensional array.</description>
|
||||||
<examples>
|
<examples>
|
||||||
@@ -1353,7 +1353,7 @@ echo foo
|
|||||||
<explanation>Output: 1 2 9 4 5</explanation>
|
<explanation>Output: 1 2 9 4 5</explanation>
|
||||||
</example>
|
</example>
|
||||||
</examples>
|
</examples>
|
||||||
|
|
||||||
<arguments>
|
<arguments>
|
||||||
<argument token="A" description="name of alias (multidimensional array)"/>
|
<argument token="A" description="name of alias (multidimensional array)"/>
|
||||||
<argument token="N" description="name of target subarray to modify"/>
|
<argument token="N" description="name of target subarray to modify"/>
|
||||||
@@ -1370,7 +1370,7 @@ echo foo
|
|||||||
<identifierReference identifier="MDArray_Search"/>
|
<identifierReference identifier="MDArray_Search"/>
|
||||||
</references>
|
</references>
|
||||||
</command>
|
</command>
|
||||||
|
|
||||||
<command name="MDArray_Delete_Subarray">
|
<command name="MDArray_Delete_Subarray">
|
||||||
<description>Deletes an entire subarray from an existing cubescript multidimensional array.</description>
|
<description>Deletes an entire subarray from an existing cubescript multidimensional array.</description>
|
||||||
<arguments>
|
<arguments>
|
||||||
@@ -1387,7 +1387,7 @@ echo foo
|
|||||||
<identifierReference identifier="MDArray_Search"/>
|
<identifierReference identifier="MDArray_Search"/>
|
||||||
</references>
|
</references>
|
||||||
</command>
|
</command>
|
||||||
|
|
||||||
<command name="MDArray_Get_Subarray_Count">
|
<command name="MDArray_Get_Subarray_Count">
|
||||||
<description>Returns the number of subarrays in a cubescript multidimensional array.</description>
|
<description>Returns the number of subarrays in a cubescript multidimensional array.</description>
|
||||||
<arguments>
|
<arguments>
|
||||||
@@ -1403,7 +1403,7 @@ echo foo
|
|||||||
<identifierReference identifier="MDArray_Search"/>
|
<identifierReference identifier="MDArray_Search"/>
|
||||||
</references>
|
</references>
|
||||||
</command>
|
</command>
|
||||||
|
|
||||||
<command name="MDArray_Get_All_Subarray_Names">
|
<command name="MDArray_Get_All_Subarray_Names">
|
||||||
<description>Returns a list of all subarray names in a cubescript multidimensional array.</description>
|
<description>Returns a list of all subarray names in a cubescript multidimensional array.</description>
|
||||||
<examples>
|
<examples>
|
||||||
@@ -1425,7 +1425,7 @@ echo foo
|
|||||||
<identifierReference identifier="MDArray_Search"/>
|
<identifierReference identifier="MDArray_Search"/>
|
||||||
</references>
|
</references>
|
||||||
</command>
|
</command>
|
||||||
|
|
||||||
<command name="MDArray_Search">
|
<command name="MDArray_Search">
|
||||||
<description>Returns a list of all subarray names that have content matching a specific keyword.</description>
|
<description>Returns a list of all subarray names that have content matching a specific keyword.</description>
|
||||||
<examples>
|
<examples>
|
||||||
@@ -6968,6 +6968,11 @@ Output:
|
|||||||
</arguments>
|
</arguments>
|
||||||
</command>
|
</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>
|
</identifiers>
|
||||||
</section>
|
</section>
|
||||||
<!-- Editing Configs Section Ends -->
|
<!-- Editing Configs Section Ends -->
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ void setwatercolor(const char *r, const char *g, const char *b, const char *a)
|
|||||||
}
|
}
|
||||||
|
|
||||||
COMMANDN(watercolour, setwatercolor, ARG_4STR);
|
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
|
// 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 angle = v1*v2*0.1f/(2*M_PI) + t; \
|
||||||
float s = angle - int(angle) - 0.5f; \
|
float s = angle - int(angle) - 0.5f; \
|
||||||
s *= 8 - fabs(s)*16; \
|
s *= 8 - fabs(s)*16; \
|
||||||
float h = 0.3f*s; \
|
float h = waveheight*0.5f*s; \
|
||||||
varray::attrib<float>(v1, v2, v3+h); \
|
varray::attrib<float>(v1, v2, v3+h); \
|
||||||
body; \
|
body; \
|
||||||
}
|
}
|
||||||
@@ -51,7 +52,7 @@ COMMANDN(watercolour, setwatercolor, ARG_4STR);
|
|||||||
})
|
})
|
||||||
#define VERTWT(vertwt, defbody, body) \
|
#define VERTWT(vertwt, defbody, body) \
|
||||||
VERTWC(vertwt, defbody, { \
|
VERTWC(vertwt, defbody, { \
|
||||||
float duv = 0.2f*v; \
|
float duv = waveheight*0.5f*v; \
|
||||||
body; \
|
body; \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user