Remove THIS macro (#1756)

* Remove THIS macro

* Revert changes to the documentation

* Undo revert to STYLE.md
This commit is contained in:
Tom Overton
2024-12-13 03:34:39 -08:00
committed by GitHub
parent f6d4a8731e
commit 8efc382b9f
581 changed files with 2710 additions and 3869 deletions
+4 -4
View File
@@ -150,19 +150,19 @@ All compound flag lists (e.g. `ACTOR_FLAG_HOSTILE | ACTOR_FLAG_FRIENDLY`) should
## Play2
In some particular instances, IDO requires the function argument `play` to be cast to a second variable of the same type to match. In these particular instances, the function argument should be renamed to `play2` and than this `play2` just assigned to a stack variable called `play`. This cast should occur before the actor `THIS` cast is made. For example in `z_en_firefly.c`
In some particular instances, IDO requires the function argument `play` to be cast to a second variable of the same type to match. In these particular instances, the function argument should be renamed to `play2` and than this `play2` just assigned to a stack variable called `play`. This cast should occur before the actor recast is made. For example in `z_en_firefly.c`
```c
void EnFirefly_Update(Actor* thisx, PlayState* play2) {
PlayState* play = play2;
EnFirefly* this = THIS;
EnFirefly* this = (EnFirefly*)thisx;
```
In other places the cast is actually not explictly needed, but a stack `pad` variable is still needed. For this there should just be a stack variable called `pad` of type `s32` before the actor `THIS` cast. For example in `z_bg_goron_oyu`
In other places the cast is actually not explictly needed, but a stack `pad` variable is still needed. For this there should just be a stack variable called `pad` of type `s32` before the actor recast. For example in `z_bg_goron_oyu`
```c
void BgGoronOyu_Init(Actor* thisx, PlayState* play) {
s32 pad;
BgGoronOyu* this = THIS;
BgGoronOyu* this = (BgGoronOyu*)thisx;
CollisionHeader* colHeader = NULL;
```