mirror of
https://github.com/SeekyCt/spm-decomp.git
synced 2025-02-17 03:57:27 +00:00
float -> f32
This commit is contained in:
parent
2d5738c850
commit
7807cd091a
@ -10,6 +10,6 @@ typedef struct {
|
||||
|
||||
void dispInit();
|
||||
|
||||
void dispEntry(s8 cameraId, u8 renderMode, float z, DispCallback * cb, void * cbParam);
|
||||
void dispEntry(s8 cameraId, u8 renderMode, f32 z, DispCallback * cb, void * cbParam);
|
||||
|
||||
DispEntry * dispGetCurWork();
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <common.h>
|
||||
#include <evt_cmd.h>
|
||||
|
||||
// evt_fairy_set_pos(s32 id, float x, float y, float z)
|
||||
// evt_fairy_set_pos(s32 id, f32 x, f32 y, f32 z)
|
||||
EVT_DECLARE_USER_FUNC(evt_fairy_set_pos, 4)
|
||||
|
||||
// evt_fairy_reset()
|
||||
|
@ -14,5 +14,5 @@ EVT_DECLARE_USER_FUNC(evt_mapobj_trans, 4)
|
||||
// evt_mapobj_color(bool group, const char * name, u8 r, u8 g, u8 b, u8 a)
|
||||
EVT_DECLARE_USER_FUNC(evt_mapobj_color, 6)
|
||||
|
||||
// evt_mapobj_get_position(const char * name, float& x, float& y, float& z)
|
||||
// evt_mapobj_get_position(const char * name, f32& x, f32& y, f32& z)
|
||||
EVT_DECLARE_USER_FUNC(evt_mapobj_get_position, 4)
|
||||
|
@ -6,10 +6,10 @@
|
||||
EVT_UNKNOWN_USER_FUNC(evt_mario_key_on)
|
||||
EVT_UNKNOWN_USER_FUNC(evt_mario_key_off)
|
||||
|
||||
// evt_mario_get_pos(float& x, float& y, float& z)
|
||||
// evt_mario_get_pos(f32& x, f32& y, f32& z)
|
||||
EVT_DECLARE_USER_FUNC(evt_mario_get_pos, 3)
|
||||
|
||||
// evt_mario_get_pos(float x, float y, float z)
|
||||
// evt_mario_get_pos(f32 x, f32 y, f32 z)
|
||||
EVT_DECLARE_USER_FUNC(evt_mario_set_pos, 3)
|
||||
|
||||
EVT_UNKNOWN_USER_FUNC(func_800efce0)
|
||||
|
@ -10,28 +10,28 @@ EVT_UNKNOWN_USER_FUNC(evt_mobj_exec_cancel)
|
||||
// evt_mobj_flag_onoff(bool on, bool flag4, const char * name, u32 mask)
|
||||
EVT_DECLARE_USER_FUNC(evt_mobj_flag_onoff, 4)
|
||||
|
||||
// evt_mobj_zyo(const char * name, s32 lockItemId, float x, float y, float z, float yRotation,
|
||||
// evt_mobj_zyo(const char * name, s32 lockItemId, f32 x, f32 y, f32 z, f32 yRotation,
|
||||
// EvtScriptCode * interactScript, EvtScriptCode * openScript, EvtVar collectedVar)
|
||||
EVT_DECLARE_USER_FUNC(evt_mobj_zyo, 9)
|
||||
|
||||
// evt_mobj_thako(s32 type, const char * name, float x, float y, float z, EvtScriptCode * interactScript,
|
||||
// evt_mobj_thako(s32 type, const char * name, f32 x, f32 y, f32 z, EvtScriptCode * interactScript,
|
||||
// EvtScriptCode * openScript, UNK arg8, UNK arg9)
|
||||
EVT_DECLARE_USER_FUNC(evt_mobj_thako, 9)
|
||||
|
||||
// evt_mobj_kan(bool rotation, const char * name, float x, float y, float z, EvtScriptCode * interactScript,
|
||||
// evt_mobj_kan(bool rotation, const char * name, f32 x, f32 y, f32 z, EvtScriptCode * interactScript,
|
||||
// UNK arg7)
|
||||
EVT_DECLARE_USER_FUNC(evt_mobj_kan, 7)
|
||||
|
||||
// evt_mobj_arrow(const char * name, float x, float y, float z, UNK arg5)
|
||||
// evt_mobj_arrow(const char * name, f32 x, f32 y, f32 z, UNK arg5)
|
||||
EVT_DECLARE_USER_FUNC(evt_mobj_arrow, 5)
|
||||
|
||||
// evt_mobj_wait_animation_end(const char * name, UNUSED)
|
||||
EVT_DECLARE_USER_FUNC(evt_mobj_wait_animation_end, 2)
|
||||
|
||||
// evt_mobj_get_position(const char * name, float& x, float& y, float& z)
|
||||
// evt_mobj_get_position(const char * name, f32& x, f32& y, f32& z)
|
||||
EVT_DECLARE_USER_FUNC(evt_mobj_get_position, 4)
|
||||
|
||||
// evt_mobj_set_position(const char * name, float x, float y, float z)
|
||||
// evt_mobj_set_position(const char * name, f32 x, f32 y, f32 z)
|
||||
EVT_DECLARE_USER_FUNC(evt_mobj_set_position, 4)
|
||||
|
||||
// evt_mobj_hit_onoff(bool on, const char * name)
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <common.h>
|
||||
#include <evt_cmd.h>
|
||||
|
||||
// evt_npc_set_position(const char * instanceName, float x, float y, float z)
|
||||
// evt_npc_set_position(const char * instanceName, f32 x, f32 y, f32 z)
|
||||
EVT_DECLARE_USER_FUNC(evt_npc_set_position, 4)
|
||||
|
||||
// evt_npc_entry(const char * instanceName, const char * animPoseName, s32 instanceId)
|
||||
@ -42,15 +42,15 @@ EVT_DECLARE_USER_FUNC(evt_npc_teleport_effect, 2)
|
||||
|
||||
EVT_UNKNOWN_USER_FUNC(func_80105b94)
|
||||
|
||||
// evt_npc_get_position(const char * name, float& x, float& y, float& z)
|
||||
// evt_npc_get_position(const char * name, f32& x, f32& y, f32& z)
|
||||
EVT_DECLARE_USER_FUNC(evt_npc_get_position, 4)
|
||||
|
||||
// evt_npc_jump_to(const char * name, float destX, float destY, float destZ, float height, s32 length)
|
||||
// evt_npc_jump_to(const char * name, f32 destX, f32 destY, f32 destZ, f32 height, s32 length)
|
||||
EVT_DECLARE_USER_FUNC(evt_npc_jump_to, 6)
|
||||
|
||||
EVT_UNKNOWN_USER_FUNC(evt_npc_glide_to)
|
||||
|
||||
// evt_npc_get_axis_movement_unit(const char * name, float& ret)
|
||||
// evt_npc_get_axis_movement_unit(const char * name, f32& ret)
|
||||
EVT_DECLARE_USER_FUNC(evt_npc_get_axis_movement_unit, 2)
|
||||
|
||||
// evt_npc_set_camid(const char * name, s32 camId)
|
||||
|
@ -32,7 +32,7 @@ EVT_UNKNOWN_USER_FUNC(func_800d31a0)
|
||||
EVT_UNKNOWN_USER_FUNC(func_800d22d8)
|
||||
EVT_UNKNOWN_USER_FUNC(evt_snd_bgmon_f_d)
|
||||
|
||||
// evt_snd_sfxon_3d(const char * name, float x, float y, float z)
|
||||
// evt_snd_sfxon_3d(const char * name, f32 x, f32 y, f32 z)
|
||||
EVT_DECLARE_USER_FUNC(evt_snd_sfxon_3d, 4)
|
||||
|
||||
// evt_snd_sfxon(const char * name)
|
||||
|
@ -74,13 +74,13 @@ typedef struct _EvtEntry
|
||||
union
|
||||
{
|
||||
s32 * readAddr;
|
||||
float * readfAddr;
|
||||
f32 * readfAddr;
|
||||
}; // Current addr for read/readf instructions
|
||||
s32 * uw; // User Work variables pointer
|
||||
u32 * uf; // User Flag variables pointer
|
||||
s32 id; // Script id
|
||||
float speed; // timeToRun given per frame
|
||||
float timeToRun; // Number of instructions to execute this frame
|
||||
f32 speed; // timeToRun given per frame
|
||||
f32 timeToRun; // Number of instructions to execute this frame
|
||||
s32 casedrvId;
|
||||
void * ownerNPC;
|
||||
void * ownerMOBJ;
|
||||
|
@ -14,5 +14,5 @@ void hitGrpFlagOn(bool allowSubname, const char * name, u32 mask);
|
||||
void hitGrpFlagOff(bool allowSubname, const char * name, u32 mask);
|
||||
void hitGetMapEntryBbox(s32 mapEntryIdx, Vec3 * min, Vec3 * max);
|
||||
void hitObjGetPos(const char * name, Vec3 * ret);
|
||||
bool hitCheckFilter(float, float, float, float, float, float, void *, float *, float *,
|
||||
float *, float *, float *, float *, float *);
|
||||
bool hitCheckFilter(f32, f32, f32, f32, f32, f32, void *, f32 *, f32 *,
|
||||
f32 *, f32 *, f32 *, f32 *, f32 *);
|
||||
|
@ -26,7 +26,7 @@ typedef struct
|
||||
ItemWork * itemGetWork();
|
||||
void itemInit();
|
||||
void itemMain();
|
||||
ItemEntry * itemEntry(float x, float y, float z, const char * instanceName, s32 itemId,
|
||||
ItemEntry * itemEntry(f32 x, f32 y, f32 z, const char * instanceName, s32 itemId,
|
||||
s32 behaviour, void * pickupScript, s32 switchNumber);
|
||||
s32 itemTypeNameToId(const char * itemName);
|
||||
bool itemCheckForId(s32 itemId);
|
||||
|
@ -35,7 +35,7 @@ typedef struct
|
||||
u8 unknown_0x124[0x2a0 - 0x124];
|
||||
Vec3 position;
|
||||
u8 unknown_0x2ac[0x3ac - 0x2ac];
|
||||
float unknown_0x3ac;
|
||||
f32 unknown_0x3ac;
|
||||
u8 unknown_0x3b0[0x574 - 0x3b0];
|
||||
s32 dropItemId;
|
||||
u8 unknown_0x578[0x748 - 0x578];
|
||||
|
@ -78,7 +78,7 @@ EVT_DECLARE_USER_FUNC(evt_dan_handle_dokans, 1)
|
||||
Select which doors to use as the entrance and exit randomly based on this map's <door> entries
|
||||
Outputs the names of the enter & exit doors and the co-ordinates for the lock to spawn at
|
||||
*/
|
||||
// evt_dan_handle_doors(s32 no, s32 room, &char * enterDoor, &char * exitDoor, &float lockX, &float lockY, &float lockZ)
|
||||
// evt_dan_handle_doors(s32 no, s32 room, &char * enterDoor, &char * exitDoor, &f32 lockX, &f32 lockY, &f32 lockZ)
|
||||
EVT_DECLARE_USER_FUNC(evt_dan_handle_doors, 7)
|
||||
|
||||
/*
|
||||
@ -109,7 +109,7 @@ EVT_DECLARE_USER_FUNC(evt_dan_make_spawn_table, 1)
|
||||
Returns the spawn coordinates for an enemy which is within the group at <enemyIdx>
|
||||
num is a counter of how many enemies have spawned before this one (in any group)
|
||||
*/
|
||||
// evt_dan_get_enemy_spawn_pos(s32 num, s32 no, s32 enemyIdx, &float x, &float y, &float z)
|
||||
// evt_dan_get_enemy_spawn_pos(s32 num, s32 no, s32 enemyIdx, &f32 x, &f32 y, &f32 z)
|
||||
EVT_DECLARE_USER_FUNC(evt_dan_get_enemy_spawn_pos, 6)
|
||||
|
||||
/*
|
||||
|
@ -7,5 +7,5 @@
|
||||
#include <common.h>
|
||||
|
||||
// referenced in dan.c
|
||||
void func_800b426c(float, float, float, s32, s32);
|
||||
void func_800cd554(float, float, float, float, float, float, s32, s32);
|
||||
void func_800b426c(f32, f32, f32, s32, s32);
|
||||
void func_800cd554(f32, f32, f32, f32, f32, f32, s32, s32);
|
||||
|
@ -18,7 +18,7 @@ typedef struct
|
||||
u8 unknown_0x14[0x18 - 0x14];
|
||||
u16 framebufferWidth;
|
||||
u16 framebufferHeight;
|
||||
float gameSpeed;
|
||||
f32 gameSpeed;
|
||||
char saveName[32];
|
||||
s32 lastSaveLoaded;
|
||||
char mapName[32];
|
||||
|
@ -26,7 +26,7 @@ const char * getSpmarioDVDRoot();
|
||||
const char * getMapdataDvdRoot();
|
||||
s32 __assert(const char * filename, s32 line, const char * assertion);
|
||||
s32 __assert2(const char * filename, s32 line, const char * assertion, const char * message, ...);
|
||||
float reviseAngle(float angle);
|
||||
f32 reviseAngle(f32 angle);
|
||||
f32 distABf(f32 x1, f32 z1, f32 x2, f32 z2);
|
||||
f32 compAngle(f32 a, f32 b);
|
||||
f32 angleABf(f32 x1, f32 z1, f32 x2, f32 z2);
|
||||
@ -36,7 +36,7 @@ void fsort(char ** table, size_t size);
|
||||
void qqsort(char * list, size_t nel, size_t size, void * compare);
|
||||
s32 rand();
|
||||
s32 irand();
|
||||
float frand(f32 limit);
|
||||
f32 frand(f32 limit);
|
||||
void sysRandInit();
|
||||
void sysWaitDrawSync();
|
||||
s32 memcmp_as4(const void * a, const void * b, u32 n);
|
||||
|
@ -13,17 +13,17 @@ typedef struct
|
||||
u32 buttonsPressed; // buttons down this frame but not last
|
||||
u32 buttonsReleased; // buttons released this frame
|
||||
Vec3 acceleration;
|
||||
float accelerationMagnitude;
|
||||
float accelerationDif;
|
||||
f32 accelerationMagnitude;
|
||||
f32 accelerationDif;
|
||||
Vec2 pointingPos;
|
||||
Vec2 pointingPosDif;
|
||||
float pointingPosDifSpeed;
|
||||
f32 pointingPosDifSpeed;
|
||||
Vec2 horizontal;
|
||||
Vec2 horizontalDif;
|
||||
float horizontalDifSpeed;
|
||||
float distance;
|
||||
float distanceDif;
|
||||
float distanceDifSpeed;
|
||||
f32 horizontalDifSpeed;
|
||||
f32 distance;
|
||||
f32 distanceDif;
|
||||
f32 distanceDifSpeed;
|
||||
Vec2 verticalPos;
|
||||
u8 type;
|
||||
s8 error;
|
||||
@ -33,11 +33,11 @@ typedef struct
|
||||
} KPADStatus;
|
||||
|
||||
void KPADSetFSStickClamp(s8 min, s8 max);
|
||||
void KPADSetPosParam(s32 controller, float radius, float sensitivity);
|
||||
void KPADSetHoriParam(s32 controller, float radius, float sensitivity);
|
||||
void KPADSetDistParam(s32 controller, float radius, float sensitivity);
|
||||
void KPADSetAccParam(s32 controller, float radius, float sensitivity);
|
||||
void KPADSetBtnRepeat(s32 controller, float delay, float pulse);
|
||||
void KPADSetPosParam(s32 controller, f32 radius, f32 sensitivity);
|
||||
void KPADSetHoriParam(s32 controller, f32 radius, f32 sensitivity);
|
||||
void KPADSetDistParam(s32 controller, f32 radius, f32 sensitivity);
|
||||
void KPADSetAccParam(s32 controller, f32 radius, f32 sensitivity);
|
||||
void KPADSetBtnRepeat(s32 controller, f32 delay, f32 pulse);
|
||||
void KPADCalibrateDPD(s32 controller);
|
||||
s32 KPADRead(s32 controller, KPADStatus * dest, u32 maxStatuses);// 802e15a0
|
||||
void KPADInit();
|
||||
|
@ -24,7 +24,7 @@ typedef struct
|
||||
u32 wrapT;
|
||||
u32 minFilter;
|
||||
u32 magFilter;
|
||||
float LODBias;
|
||||
f32 LODBias;
|
||||
bool edgeLODEnable;
|
||||
u8 minLOD;
|
||||
u8 maxLOD;
|
||||
|
@ -569,7 +569,7 @@ s32 evt_dan_get_enemy_spawn_pos(EvtEntry * entry, bool isInitialCall)
|
||||
doorPos.z = 0.0f;
|
||||
|
||||
// Unknown, outputs coords with some changes if needed
|
||||
float f1, f2, f3, f4, f5, f6, f7;
|
||||
f32 f1, f2, f3, f4, f5, f6, f7;
|
||||
f4 = 1000.0f;
|
||||
if (hitCheckFilter(doorPos.x, doorPos.y, 0.0f, 0.0f, -1.0f, 0.0f, NULL, &f1, &f2, &f3, &f4, &f5, &f6, &f7))
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ static s32 priIdTbl[EVT_ENTRY_MAX];
|
||||
|
||||
// .sdata
|
||||
static s32 evtId = 1;
|
||||
static float evtSpd = 1.0f;
|
||||
static f32 evtSpd = 1.0f;
|
||||
s32 evtMax = 0;
|
||||
static s32 priTblNum = 0;
|
||||
static s32 runMainF = 0;
|
||||
|
@ -1346,7 +1346,7 @@ s32 evt_set_read(EvtEntry * entry)
|
||||
|
||||
s32 evt_set_readf(EvtEntry * entry)
|
||||
{
|
||||
entry->readfAddr = (float *) evtGetValue(entry, entry->pCurData[0]);
|
||||
entry->readfAddr = (f32 *) evtGetValue(entry, entry->pCurData[0]);
|
||||
|
||||
return EVT_RET_CONTINUE;
|
||||
}
|
||||
@ -1641,7 +1641,7 @@ s32 evt_set_ramf(EvtEntry * entry)
|
||||
|
||||
p = entry->pCurData;
|
||||
value = evtGetFloat(entry, p[0]);
|
||||
addr = (float *) p[1];
|
||||
addr = (f32 *) p[1];
|
||||
*addr = value;
|
||||
|
||||
return EVT_RET_CONTINUE;
|
||||
|
@ -87,9 +87,9 @@ asm s32 __assert2(const char * filename, s32 line, const char * assertion, const
|
||||
#include "asm/8019c54c.s"
|
||||
}
|
||||
|
||||
float reviseAngle(float angle)
|
||||
f32 reviseAngle(f32 angle)
|
||||
{
|
||||
angle = (float) fmod(angle, 360.0);
|
||||
angle = (f32) fmod(angle, 360.0);
|
||||
|
||||
// Seems impossible, maybe true if NaN returned?
|
||||
if (angle != angle)
|
||||
@ -146,8 +146,8 @@ void movePos(f32 distance, f32 angle, f32 * x, f32 * z)
|
||||
{
|
||||
f32 c;
|
||||
f32 s;
|
||||
s = (float) sin(DEG_TO_RAD(angle));
|
||||
c = (float) cos(DEG_TO_RAD(angle));
|
||||
s = (f32) sin(DEG_TO_RAD(angle));
|
||||
c = (f32) cos(DEG_TO_RAD(angle));
|
||||
*x += distance * s;
|
||||
*z -= distance * c;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user