mirror of
https://github.com/pmret/papermario.git
synced 2024-11-09 12:32:38 +01:00
better code for matching funcs
This commit is contained in:
parent
7bc578801e
commit
b889313aad
@ -4,7 +4,7 @@
|
||||
#include "ultra64.h"
|
||||
#include "common_structs.h"
|
||||
|
||||
extern game_status* gGameStatus;
|
||||
extern game_status* gGameStatus[1];
|
||||
extern s16* D_80151328;
|
||||
|
||||
#endif
|
||||
|
@ -16,22 +16,22 @@ s32 EnableSpriteShading(ScriptContext* script) {
|
||||
}
|
||||
|
||||
s32 getDemoState(ScriptContext* script) {
|
||||
set_variable(script, *script->ptrReadPos, gGameStatus->demoState);
|
||||
set_variable(script, *script->ptrReadPos, (*gGameStatus)->demoState);
|
||||
return 2;
|
||||
}
|
||||
|
||||
s32 DemoPressButton(ScriptContext* script) {
|
||||
gGameStatus->demoButtonInput |= get_variable(script, *script->ptrReadPos);
|
||||
(*gGameStatus)->demoButtonInput |= get_variable(script, *script->ptrReadPos);
|
||||
return 2;
|
||||
}
|
||||
|
||||
s32 DemoReleaseButton(ScriptContext* script) {
|
||||
gGameStatus->demoButtonInput &= ~get_variable(script, *script->ptrReadPos);
|
||||
(*gGameStatus)->demoButtonInput &= ~get_variable(script, *script->ptrReadPos);
|
||||
return 2;
|
||||
}
|
||||
|
||||
s32 DemoSetButtons(ScriptContext* script) {
|
||||
gGameStatus->demoButtonInput = get_variable(script, *script->ptrReadPos);
|
||||
(*gGameStatus)->demoButtonInput = get_variable(script, *script->ptrReadPos);
|
||||
return 2;
|
||||
}
|
||||
|
||||
@ -39,13 +39,12 @@ s32 DemoJoystickRadial(ScriptContext* script) {
|
||||
float a;
|
||||
float b;
|
||||
s32* thisPos = script->ptrReadPos;
|
||||
game_status **status = &gGameStatus;
|
||||
|
||||
a = get_float_variable(script, *thisPos++);
|
||||
b = get_float_variable(script, *thisPos);
|
||||
b = get_float_variable(script, *thisPos++);
|
||||
|
||||
(*status)->demoStickX = a * sin_deg(b);
|
||||
(*status)->demoStickY = a * cos_deg(b);
|
||||
(*gGameStatus)->demoStickX = a * sin_deg(b);
|
||||
(*gGameStatus)->demoStickY = a * cos_deg(b);
|
||||
|
||||
return 2;
|
||||
}
|
||||
@ -54,13 +53,12 @@ s32 DemoJoystickXY(ScriptContext* script) {
|
||||
float a;
|
||||
float b;
|
||||
s32* thisPos = script->ptrReadPos;
|
||||
game_status **status = &gGameStatus;
|
||||
|
||||
a = get_float_variable(script, *thisPos++);
|
||||
b = get_float_variable(script, *thisPos);
|
||||
b = get_float_variable(script, *thisPos++);
|
||||
|
||||
(*status)->demoStickX = a;
|
||||
(*status)->demoStickY = b;
|
||||
(*gGameStatus)->demoStickX = a;
|
||||
(*gGameStatus)->demoStickY = b;
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user