ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


mulretval

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
mulretval [2016/04/25 00:32] korshunmulretval [2017/07/13 18:30] korshun
Line 1: Line 1:
-====== Multiple return values ====== +#REDIRECT multiple_return_values
- +
-acsutils uses a simple convention for functions returning multiple values, like RotateVector(): +
- +
-There are global variables r1 through r8. The functions write their return values to them. +
- +
-    RotateVector(x, y, angle); // Call the function +
-    int newX = r1; // Get the first returned value +
-    int newY = r2; // And the second one +
- +
-<note warning>You should retrieve the return values **as soon as possible**, or else they may get overwritten by other functions that return multiple values.</note>+