GOOC - Game Oriented Object C
GOOC - Game Oriented Object C
9.6. Subroutine Modifiers
9.6. Subroutine Modifiers
Subroutine modifiers may be used to give a subroutine some specific or extra behavior which may otherwise be very unintuitive to accomplish. These are divided into two types: pre-subroutine modifiers and normal subroutine modifiers. Pre-subroutine modifiers are placed before the parameters list, while subroutine modifiers are placed after. This has to do with the sequential parsing that is done.
Pre-Subroutine Modifiers
Pre-Subroutine Modifiers
There is only one pre-subroutine modifier.
- __mips - The subroutine will be compiled into MIPS instructions, instead of GOOL instructions. This only applies to game versions that support running MIPS machine code in a GOOL file (Crash 2 onwards).
Subroutine Modifiers
Subroutine Modifiers
There are two subroutine modifiers.
- __trans - The subroutine will allow certain constructs normally only permitted within trans blocks, and subroutine parameters will be turned into direct field addresses.
- __args(a, b, c, ...) - Explicitly define those extra subroutine parameters. Only allowed if __trans has already been specified.