Note that, since Lua uses ^ for powers, bitwise XOR is represented as ^^. All standard bitwise operations are supported.Some useful functions from the missing libraries are replaced by SRB2-specific functions. The other libraries were removed either because they are not useful for SRB2's purposes or because they could be used to write potentially harmful code. The only standard libraries loaded are the basic library (including the coroutine library), string manipulation, and table manipulation.Fixed-point math functions such as FixedMul() and FixedDiv() are available to assist with math in these situations. For example, the number 1.5 is represented by FRACUNIT + FRACUNIT/2 or 3*FRACUNIT/2 (98304). In situations where real numbers are required, SRB2's Lua uses fixed-point numbers with a base unit of FRACUNIT (65536). Whereas standard Lua uses floating-point doubles for all of its math, SRB2's implementation uses signed integers.Additionally, some further changes have been made to adapt BLUA for SRB2's purposes. SRB2's implementation of Lua is based on BLUA, which has some syntax differences compared to standard Lua, bringing it closer to C. For users new to the Lua language, it is highly recommended to read the Lua Tutorial on the lua-users wiki to learn the basics of Lua.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |