From 73cf9df88eeb7b6193dd3c2c53b1c796a196418c Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 28 Feb 2013 05:46:11 +0100 Subject: your daily dose of API additions --- include/common.h | 4 ++++ include/game.h | 17 +++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/common.h b/include/common.h index 38e9c86..44c3652 100644 --- a/include/common.h +++ b/include/common.h @@ -113,6 +113,10 @@ char *RetrieveFileFromArcAlt(void *table, char *name, char *path);*/ extern void *ArchiveHeap; // PAL 0x8042A72C, NTSC 0x8042A44C +namespace nw4r { namespace math { float FrSqrt(float); }} +float sqrtf(float x) { + return (x <= 0) ? 0.0f : x * nw4r::math::FrSqrt(x); +} #ifdef __MWERKS__ #define InfiniteLoop for (;;) { asm { nop } } diff --git a/include/game.h b/include/game.h index d90ce0f..5fcd2e8 100755 --- a/include/game.h +++ b/include/game.h @@ -3526,15 +3526,15 @@ namespace mEf { void clear(); virtual bool probablyCreateWithName(const char *name, u32 unk); - virtual bool spawn(const char *name, u32 unk, Vec *pos=0, S16Vec *rot=0, Vec *scale=0); - virtual bool spawnWithMatrix(const char *name, u32 unk, Mtx *mtx); + virtual bool spawn(const char *name, u32 unk, const Vec *pos=0, const S16Vec *rot=0, const Vec *scale=0); + virtual bool spawnWithMatrix(const char *name, u32 unk, const Mtx *mtx); // these two deal with mEf::effectCB_c and crap. absolutely no idea. virtual bool _vfA8(/* tons and tons of params */); virtual bool _vfAC(/* a slightly smaller amount of params */); - virtual bool _vfB0(Vec *pos=0, S16Vec *rot=0, Vec *scale=0); - virtual bool _vfB4(Mtx *mtx); + virtual bool _vfB0(const Vec *pos=0, const S16Vec *rot=0, const Vec *scale=0); + virtual bool _vfB4(const Mtx *mtx); }; class es2 : public effect_c { @@ -3547,10 +3547,10 @@ namespace mEf { void makeItHappen(); bool probablyCreateWithName(const char *name, u32 unk); - bool spawn(const char *name, u32 unk, Vec *pos=0, S16Vec *rot=0, Vec *scale=0); - bool spawnWithMatrix(const char *name, u32 unk, Mtx *mtx); - bool _vfB0(Vec *pos=0, S16Vec *rot=0, Vec *scale=0); - bool _vfB4(Mtx *mtx); + bool spawn(const char *name, u32 unk, const Vec *pos=0, const S16Vec *rot=0, const Vec *scale=0); + bool spawnWithMatrix(const char *name, u32 unk, const Mtx *mtx); + bool _vfB0(const Vec *pos=0, const S16Vec *rot=0, const Vec *scale=0); + bool _vfB4(const Mtx *mtx); virtual u8 returnField11D(); // does exactly what it says on the tin @@ -3876,6 +3876,7 @@ inline int Player_VF3D4(void *self) { extern "C" void PlaySoundWithFunctionB4(void *spc, nw4r::snd::SoundHandle *handle, int id, int unk); +void GetPosForLayoutEffect(VEC3 *pos, bool quack); bool SmoothRotation(s16 *pValue, s16 target, s16 stepSize); -- cgit v1.2.3