Even though each double to single conversion produces a small amount of error, this error balances out over the course of the platform's cycle. Using the N64's rounding mode, the y variable, which represents the platform's height, will repeatedly return to its original value and continue oscillating with fixed maximum height. The example given above is taken from the code controlling the oscillation of the platforms at the beginning of Bowser in the Fire Sea. For this reason, TASes produced for one of these platforms cannot generally be played back on the other without desync. Examples such as this one arise in many places in the game's source code, and over time they result in large discrepancies between the N64 and Wii VC versions of the game. This causes the expression to evaluate to a double, which is then converted to a float before being stored in y. However, in C, the numeric literal 0.58 is a double since it lacks a trailing f, as in 0.58f. In the above code sample, y and sins(t) are both single precision floats.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |