GOOC - Game Oriented Object C
GOOC - Game Oriented Object C
7.12. Other Operators
7.12. Other Operators
GOOC is equipped with a few miscellaneous operators. These operators are merely syntactic sugar for specific operations. These have the same precedence as E-instructions.
- avg(a, b) - The average between two numbers, expands to (a + b) >> 1.
- autopal(a) - Automatically converts an NTSC frame value into a PAL frame value. Expands to a * 25 / 30 if the selected region is a PAL region, otherwise it simply expands to a.
- autontsc(a) - Automatically converts a PAL frame value into an NTSC frame value. Expands to a * 30 / 25 if the selected region is an NTSC region, otherwise it simply expands to a.
- offsetof(a) - If a is a global variable, returns the offset of that variable. If a is a field variable, returns the offset of that field. If a is neither, an error will be thrown.