mirror of
https://github.com/encounter/bfbb.git
synced 2026-03-30 10:58:00 -07:00
Partial Progress On zMovePoint.cpp And zLightEffect.cpp (#95)
* Decomp Part Of zMusic.cpp Progress. * Cleanup zMusic Changes For merging. * Partial Decompilation Of zTaxi.cpp 9/13 functions done. * Decompile Most Of zCameraFly.cpp; Cleanup More progress. * zRumble, zFX, Snd zScript Partial Decpmpilation More general progress. * zRumble, zFX, And zScript Partial Decpmpilation More general progress. * Cleanup For Merging For progress. * Another Cleanup For Pull Request 3rd time's the charm. * Partial Decompilation Of iTime.cpp Progress! * Decompile Most Of Particle Manager So close to 100%ing it, but yet so far. * Start xBehaviour; Remove zScript.s I need sleep. * More Work On xBehaviour Progress. * Partial Decompilation Of Various Files Include xDebug, zPendulum, and zTaskBox. All work in progress. * Partial Decompilation Of zMovePoint And zLightEffect Progress.
This commit is contained in:
@@ -17,15 +17,25 @@
|
||||
#define ILIGHT_ENV_WORLD 2
|
||||
#define ILIGHT_ENV_ATOMICWORLD 3
|
||||
|
||||
// Size: 0x3C
|
||||
struct iLight
|
||||
{
|
||||
|
||||
// 0x0
|
||||
uint32 type;
|
||||
RpLight* hw;
|
||||
|
||||
//0x8
|
||||
xSphere sph;
|
||||
float32 radius_sq;
|
||||
|
||||
//0x1C
|
||||
_xFColor color;
|
||||
|
||||
//0x2C
|
||||
xVec3 dir;
|
||||
float32 coneangle;
|
||||
|
||||
};
|
||||
|
||||
extern RpWorld* gLightWorld;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "xLinkAsset.h"
|
||||
#include "xserializer.h"
|
||||
|
||||
// Size: 0x8
|
||||
struct xBaseAsset
|
||||
{
|
||||
uint32 id;
|
||||
@@ -16,6 +17,7 @@ struct xBase;
|
||||
|
||||
typedef int32 (*xBaseEventCB)(xBase*, xBase*, uint32, const float32*, xBase*);
|
||||
|
||||
// Size: 0x10
|
||||
struct xBase
|
||||
{
|
||||
uint32 id;
|
||||
|
||||
@@ -55,7 +55,7 @@ void xMovePointReset(xMovePoint* m)
|
||||
void xMovePointSetup(xMovePoint* m, xScene* sc)
|
||||
{
|
||||
m->node_wt_sum = 0;
|
||||
uint32* pointIds = (uint32*)(m->asset + 1);
|
||||
uint32* pointIds = (uint32*)(m->asset + 1) - 1;
|
||||
for (uint16 idx = 0; idx < m->asset->numPoints; ++idx)
|
||||
{
|
||||
uint32 id = pointIds[idx];
|
||||
@@ -79,13 +79,14 @@ void xMovePointSplineDestroy(xMovePoint* m)
|
||||
|
||||
// func_800357B8
|
||||
#if 1
|
||||
#pragma GLOBAL_ASM("asm/Core/x/xMovePoint.s", "xMovePointGetNext__FPC10xMovePointPC10xMovePointPP10xMovePointP5xVec3")
|
||||
#pragma GLOBAL_ASM("asm/Core/x/xMovePoint.s", \
|
||||
"xMovePointGetNext__FPC10xMovePointPC10xMovePointPP10xMovePointP5xVec3")
|
||||
#else
|
||||
// If you uncomment the numPoints variable then this function is a perfect match
|
||||
// minus ordering. In the original assembly some variable fetches are lifted to
|
||||
// places earlier in the assembly listing than what this comiles to for some
|
||||
// reason.
|
||||
// The r27-30 registers used to hold the main varibles of the function are all
|
||||
// reason.
|
||||
// The r27-30 registers used to hold the main varibles of the function are all
|
||||
// perfect matches with this code.
|
||||
extern float xMovePoint_float_0;
|
||||
float32 xMovePointGetNext(xMovePoint* m, xMovePoint* prev, xMovePoint** next, xVec3* hdng)
|
||||
|
||||
@@ -12,17 +12,16 @@ struct xMovePointAsset : xBaseAsset
|
||||
xVec3 pos;
|
||||
uint16 wt;
|
||||
|
||||
// Offset: 0x16
|
||||
uint8 on;
|
||||
uint8 bezIndex;
|
||||
uint8 flg_props;
|
||||
uint8 pad;
|
||||
uint16 numPoints;
|
||||
|
||||
// Offset: 0x1C
|
||||
float32 delay;
|
||||
float32 zoneRadius;
|
||||
float32 arenaRadius;
|
||||
xLinkAsset* link;
|
||||
};
|
||||
|
||||
struct xMovePoint : xBase
|
||||
@@ -37,7 +36,7 @@ struct xMovePoint : xBase
|
||||
|
||||
// Offset: 0x24
|
||||
uint8 on;
|
||||
uint8 pad[2];
|
||||
uint8 pad[3];
|
||||
|
||||
// Offset: 0x28
|
||||
float32 delay;
|
||||
@@ -45,7 +44,8 @@ struct xMovePoint : xBase
|
||||
};
|
||||
|
||||
xVec3* xMovePointGetPos(xMovePoint* m);
|
||||
float32 xMovePointGetNext(xMovePoint* m, xMovePoint* prev, xMovePoint** next, xVec3* hdng);
|
||||
float32 xMovePointGetNext(const xMovePoint* m, const xMovePoint* prev, xMovePoint** next,
|
||||
xVec3* hdng);
|
||||
void xMovePointSplineDestroy(xMovePoint* m);
|
||||
void xMovePointSplineSetup(xMovePoint* m);
|
||||
void xMovePointSetup(xMovePoint* m, xScene* sc);
|
||||
|
||||
+148
-46
@@ -1,84 +1,186 @@
|
||||
#include "zLightEffect.h"
|
||||
|
||||
#include <types.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// func_8009E7F8
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectSet__FP7_zLighti")
|
||||
extern lightInitFunc sEffectInitFuncs[18];
|
||||
extern float32 lbl_803CDB60; // 65535f
|
||||
extern float32 lbl_803CDB68; // 176f
|
||||
extern float32 lbl_803CDB70; // 0.0f
|
||||
extern float32 lbl_803CDB74; // 0.1f
|
||||
extern float32 lbl_803CDB78; // 0.2f
|
||||
extern float32 lbl_803CDB80; // 0.05f
|
||||
extern float32 lbl_803CDB84; // 0.3f
|
||||
|
||||
// func_8009E848
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightOn__FP7_zLighti")
|
||||
void zLightEffectSet(_zLight* zlight, int32 idx)
|
||||
{
|
||||
if (zlight->reg)
|
||||
{
|
||||
zlight->effect_idx = idx;
|
||||
if (sEffectInitFuncs[zlight->effect_idx] != NULL)
|
||||
{
|
||||
sEffectInitFuncs[zlight->effect_idx](zlight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void zLightOn(_zLight* zl, int32 on)
|
||||
{
|
||||
if (on)
|
||||
{
|
||||
zl->flags |= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
zl->flags &= 0xfffffffe;
|
||||
}
|
||||
}
|
||||
|
||||
#if 1
|
||||
|
||||
// func_8009E870
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "leGetRandom__Fv")
|
||||
|
||||
// func_8009E8B4
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectInitStrobe__FP7_zLight")
|
||||
#else
|
||||
|
||||
// func_8009E8B8
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectInitDim__FP7_zLight")
|
||||
// WIP.
|
||||
float32 leGetRandom()
|
||||
{
|
||||
uint32 rnd = rand();
|
||||
return ((float)(rnd & 0xffff) - lbl_803CDB68) / lbl_803CDB60;
|
||||
}
|
||||
|
||||
// func_8009E8BC
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectInitHalfDim__FP7_zLight")
|
||||
#endif
|
||||
|
||||
// func_8009E8C0
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectInitRandomCol__FP7_zLight")
|
||||
void zLightEffectInitStrobe(_zLight* zlight)
|
||||
{
|
||||
}
|
||||
|
||||
// func_8009E8C4
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectInitFlicker__FP7_zLight")
|
||||
void zLightEffectInitDim(_zLight* zlight)
|
||||
{
|
||||
}
|
||||
|
||||
void zLightEffectInitHalfDim(_zLight* zlight)
|
||||
{
|
||||
}
|
||||
|
||||
void zLightEffectInitRandomCol(_zLight* zlight)
|
||||
{
|
||||
}
|
||||
|
||||
void zLightEffectInitFlicker(_zLight* zlight)
|
||||
{
|
||||
*zlight->reg = lbl_803CDB70;
|
||||
zLightOn(zlight, true);
|
||||
}
|
||||
|
||||
#if 1
|
||||
|
||||
// func_8009E8F4
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "EffectFlicker__FP7_zLightfff")
|
||||
|
||||
// func_8009EA78
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectFlicker__FP7_zLightf")
|
||||
#else
|
||||
|
||||
// func_8009EAA0
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectFlickerSlow__FP7_zLightf")
|
||||
// WIP.
|
||||
void EffectFlicker(_zLight* zlight, float32 seconds, float32 min, float32 rnd)
|
||||
{
|
||||
}
|
||||
|
||||
// func_8009EAC8
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectFlickerErratic__FP7_zLightf")
|
||||
#endif
|
||||
|
||||
// func_8009EAF0
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectStrobeSlow__FP7_zLightf")
|
||||
void zLightEffectFlicker(_zLight* zlight, float32 seconds)
|
||||
{
|
||||
EffectFlicker(zlight, seconds, lbl_803CDB80, lbl_803CDB78);
|
||||
}
|
||||
|
||||
// func_8009EAF4
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectStrobe__FP7_zLightf")
|
||||
void zLightEffectFlickerSlow(_zLight* zlight, float32 seconds)
|
||||
{
|
||||
EffectFlicker(zlight, seconds, lbl_803CDB78, lbl_803CDB84);
|
||||
}
|
||||
|
||||
// func_8009EAF8
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectStrobeFast__FP7_zLightf")
|
||||
void zLightEffectFlickerErratic(_zLight* zlight, float32 seconds)
|
||||
{
|
||||
EffectFlicker(zlight, seconds, lbl_803CDB70, lbl_803CDB74);
|
||||
}
|
||||
|
||||
// func_8009EAFC
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectDimSlow__FP7_zLightf")
|
||||
void zLightEffectStrobeSlow()
|
||||
{
|
||||
}
|
||||
|
||||
// func_8009EB00
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectDim__FP7_zLightf")
|
||||
void zLightEffectStrobe()
|
||||
{
|
||||
}
|
||||
|
||||
// func_8009EB04
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectDimFast__FP7_zLightf")
|
||||
void zLightEffectStrobeFast()
|
||||
{
|
||||
}
|
||||
|
||||
// func_8009EB08
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectHalfDimSlow__FP7_zLightf")
|
||||
void zLightEffectDimSlow()
|
||||
{
|
||||
}
|
||||
|
||||
// func_8009EB0C
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectHalfDim__FP7_zLightf")
|
||||
void zLightEffectDim()
|
||||
{
|
||||
}
|
||||
|
||||
// func_8009EB10
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectHalfDimFast__FP7_zLightf")
|
||||
void zLightEffectDimFast()
|
||||
{
|
||||
}
|
||||
|
||||
// func_8009EB14
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectRandomColSlow__FP7_zLightf")
|
||||
void zLightEffectHalfDimSlow()
|
||||
{
|
||||
}
|
||||
|
||||
// func_8009EB18
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectRandomCol__FP7_zLightf")
|
||||
void zLightEffectHalfDim()
|
||||
{
|
||||
}
|
||||
|
||||
// func_8009EB1C
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectRandomColFast__FP7_zLightf")
|
||||
void zLightEffectHalfDimFast()
|
||||
{
|
||||
}
|
||||
|
||||
// func_8009EB20
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectInitCauldron__FP7_zLight")
|
||||
void zLightEffectRandomColSlow()
|
||||
{
|
||||
}
|
||||
|
||||
void zLightEffectRandomCol()
|
||||
{
|
||||
}
|
||||
|
||||
void zLightEffectRandomColFast()
|
||||
{
|
||||
}
|
||||
|
||||
void zLightEffectInitCauldron(_zLight* zlight)
|
||||
{
|
||||
*zlight->reg = lbl_803CDB70;
|
||||
zLightOn(zlight, true);
|
||||
}
|
||||
|
||||
#if 1
|
||||
|
||||
// func_8009EB50
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "leBlendToCol__Ffff")
|
||||
|
||||
#else
|
||||
|
||||
// WIP.
|
||||
float32 leBlendToCol(float32 f1, float32 f2, float32 f3)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
|
||||
// func_8009EB84
|
||||
#pragma GLOBAL_ASM("asm/Game/zLightEffect.s", "zLightEffectCauldron__FP7_zLightf")
|
||||
|
||||
#else
|
||||
|
||||
// WIP.
|
||||
void zLightEffectCauldron(_zLight* zlight, float32 seconds)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,75 @@
|
||||
#ifndef ZLIGHTEFFECT_H
|
||||
#define ZLIGHTEFFECT_H
|
||||
|
||||
#include "../Core/p2/iLight.h"
|
||||
#include "../Core/x/xBase.h"
|
||||
|
||||
#include <types.h>
|
||||
|
||||
// Size: 0x38
|
||||
struct zLightAsset : xBaseAsset
|
||||
{
|
||||
// 0x8
|
||||
uint8 lightType;
|
||||
uint8 lightEffect;
|
||||
uint8 lightPad[2];
|
||||
uint32 lightFlags;
|
||||
|
||||
// 0x10
|
||||
float32 lightColor[4];
|
||||
xVec3 lightDir;
|
||||
|
||||
// 0x20
|
||||
float32 lightConeAngle;
|
||||
xSphere lightSphere;
|
||||
uint32 attachID;
|
||||
};
|
||||
|
||||
// Size: 0x64
|
||||
struct _zLight : xBase
|
||||
{
|
||||
// 0x10
|
||||
uint32 flags;
|
||||
zLightAsset* tasset;
|
||||
|
||||
// 0x18
|
||||
iLight light;
|
||||
xBase* attached_to;
|
||||
int32 true_idx;
|
||||
float32* reg;
|
||||
|
||||
// 0x60
|
||||
int32 effect_idx;
|
||||
};
|
||||
|
||||
typedef void (*lightInitFunc)(_zLight*);
|
||||
|
||||
void zLightEffectSet(_zLight* zlight, int32 idx);
|
||||
void zLightOn(_zLight* zl, int32 on);
|
||||
float32 leGetRandom();
|
||||
void zLightEffectInitStrobe(_zLight* zlight);
|
||||
void zLightEffectInitDim(_zLight* zlight);
|
||||
void zLightEffectInitHalfDim(_zLight* zlight);
|
||||
void zLightEffectInitRandomCol(_zLight* zlight);
|
||||
void zLightEffectInitFlicker(_zLight* zlight);
|
||||
void EffectFlicker(_zLight* zlight, float32 seconds, float32 min, float32 rnd);
|
||||
void zLightEffectFlicker(_zLight* zlight, float32 seconds);
|
||||
void zLightEffectFlickerSlow(_zLight* zlight, float32 seconds);
|
||||
void zLightEffectFlickerErratic(_zLight* zlight, float32 seconds);
|
||||
void zLightEffectStrobeSlow();
|
||||
void zLightEffectStrobe();
|
||||
void zLightEffectStrobeFast();
|
||||
void zLightEffectDimSlow();
|
||||
void zLightEffectDim();
|
||||
void zLightEffectDimFast();
|
||||
void zLightEffectHalfDimSlow();
|
||||
void zLightEffectHalfDim();
|
||||
void zLightEffectHalfDimFast();
|
||||
void zLightEffectRandomColSlow();
|
||||
void zLightEffectRandomCol();
|
||||
void zLightEffectRandomColFast();
|
||||
void zLightEffectInitCauldron(_zLight* zlight);
|
||||
float32 leBlendToCol(float32 f1, float32 f2, float32 f3);
|
||||
void zLightEffectCauldron(_zLight* zlight, float32 seconds);
|
||||
|
||||
#endif
|
||||
+130
-25
@@ -1,43 +1,148 @@
|
||||
#include "zMovePoint.h"
|
||||
#include "zNPCSupplement.h"
|
||||
|
||||
#include "../Core/x/xEvent.h"
|
||||
|
||||
#include <types.h>
|
||||
|
||||
extern zMovePoint* g_mvpt_list;
|
||||
extern int32 g_mvpt_cnt;
|
||||
extern float32 lbl_803CDD40;
|
||||
extern float32 lbl_803CDD44;
|
||||
|
||||
#if 1
|
||||
|
||||
// func_800A6BF8
|
||||
#pragma GLOBAL_ASM("asm/Game/zMovePoint.s", "zMovePoint_GetMemPool__Fi")
|
||||
|
||||
// func_800A6C48
|
||||
#pragma GLOBAL_ASM("asm/Game/zMovePoint.s", "zMovePointInit__FP10zMovePointP15xMovePointAsset")
|
||||
#else
|
||||
|
||||
// func_800A6CB8
|
||||
#pragma GLOBAL_ASM("asm/Game/zMovePoint.s", "zMovePoint_GetInst__Fi")
|
||||
// Random load word at the end of the function for some reason.
|
||||
zMovePoint* zMovePoint_GetMemPool(int32 cnt)
|
||||
{
|
||||
/*if (cnt != 0)
|
||||
{
|
||||
g_mvpt_list = (zMovePoint*)xMemAlloc(cnt * sizeof(zMovePoint));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_mvpt_list = NULL;
|
||||
}
|
||||
g_mvpt_cnt = cnt;
|
||||
return g_mvpt_list;*/
|
||||
|
||||
// func_800A6CC8
|
||||
#pragma GLOBAL_ASM("asm/Game/zMovePoint.s", "zMovePointSetup__FP10zMovePointP6zScene")
|
||||
g_mvpt_list = cnt ? (zMovePoint*)xMemAlloc(cnt * sizeof(zMovePoint)) : NULL;
|
||||
g_mvpt_cnt = cnt;
|
||||
return g_mvpt_list;
|
||||
}
|
||||
|
||||
// func_800A6CE8
|
||||
#pragma GLOBAL_ASM("asm/Game/zMovePoint.s", "zMovePoint_From_xAssetID__FUi")
|
||||
#endif
|
||||
|
||||
// func_800A6D28
|
||||
#pragma GLOBAL_ASM("asm/Game/zMovePoint.s", "zMovePointSave__FP10zMovePointP7xSerial")
|
||||
void zMovePointInit(zMovePoint* m, xMovePointAsset* asset)
|
||||
{
|
||||
xMovePointInit((xMovePoint*)m, asset);
|
||||
m->eventFunc = zMovePointEventCB;
|
||||
if (m->linkCount)
|
||||
{
|
||||
m->link = (xLinkAsset*)(&asset->link + *(uint16*)&asset->numPoints);
|
||||
}
|
||||
else
|
||||
{
|
||||
m->link = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// func_800A6D48
|
||||
#pragma GLOBAL_ASM("asm/Game/zMovePoint.s", "zMovePointLoad__FP10zMovePointP7xSerial")
|
||||
zMovePoint* zMovePoint_GetInst(int32 n)
|
||||
{
|
||||
return &g_mvpt_list[n];
|
||||
}
|
||||
|
||||
// func_800A6D68
|
||||
#pragma GLOBAL_ASM("asm/Game/zMovePoint.s", "zMovePointReset__FP10zMovePoint")
|
||||
void zMovePointSetup(zMovePoint* mvpt, zScene* scn)
|
||||
{
|
||||
xMovePointSetup((xMovePoint*)mvpt, (xScene*)scn);
|
||||
}
|
||||
|
||||
// func_800A6D88
|
||||
#pragma GLOBAL_ASM("asm/Game/zMovePoint.s", "zMovePointEventCB__FP5xBaseP5xBaseUiPCfP5xBase")
|
||||
zMovePoint* zMovePoint_From_xAssetID(uint32 aid)
|
||||
{
|
||||
zMovePoint* pnt = g_mvpt_list;
|
||||
zMovePoint* ret = NULL;
|
||||
for (int32 i = g_mvpt_cnt; i > 0; i--)
|
||||
{
|
||||
if (pnt->asset->id == aid)
|
||||
{
|
||||
ret = pnt;
|
||||
break;
|
||||
}
|
||||
pnt++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// func_800A6E34
|
||||
#pragma GLOBAL_ASM("asm/Game/zMovePoint.s", \
|
||||
"zMovePointGetNext__FPC10zMovePointPC10zMovePointPP10zMovePointP5xVec3")
|
||||
void zMovePointSave(zMovePoint* ent, xSerial* s)
|
||||
{
|
||||
xMovePointSave((xMovePoint*)ent, s);
|
||||
}
|
||||
|
||||
// func_800A6E54
|
||||
#pragma GLOBAL_ASM("asm/Game/zMovePoint.s", "zMovePointGetPos__FPC10zMovePoint")
|
||||
void zMovePointLoad(zMovePoint* ent, xSerial* s)
|
||||
{
|
||||
xMovePointLoad((xMovePoint*)ent, s);
|
||||
}
|
||||
|
||||
// func_800A6E74
|
||||
#pragma GLOBAL_ASM("asm/Game/zMovePoint.s", "zMovePointGetDelay__FPC10zMovePoint")
|
||||
void zMovePointReset(zMovePoint* m)
|
||||
{
|
||||
xMovePointReset((xMovePoint*)m);
|
||||
}
|
||||
|
||||
// func_800A6E94
|
||||
#pragma GLOBAL_ASM("asm/Game/zMovePoint.s", "xMovePointGetDelay__FPC10xMovePoint")
|
||||
int32 zMovePointEventCB(xBase* from, xBase* to, uint32 toEvent, const float32* toParam, xBase* b3)
|
||||
{
|
||||
switch (toEvent)
|
||||
{
|
||||
case eEventOn:
|
||||
((zMovePoint*)to)->on = true;
|
||||
break;
|
||||
case eEventOff:
|
||||
((zMovePoint*)to)->on = false;
|
||||
break;
|
||||
case eEventArrive:
|
||||
break;
|
||||
case eEventReset:
|
||||
zMovePointReset((zMovePoint*)to);
|
||||
break;
|
||||
case eEventMakeASplash:
|
||||
xVec3* pos = ((zMovePoint*)to)->pos;
|
||||
if (pos != NULL)
|
||||
{
|
||||
if (*toParam < lbl_803CDD40)
|
||||
{
|
||||
NPCC_MakeASplash(pos, lbl_803CDD44);
|
||||
}
|
||||
else
|
||||
{
|
||||
NPCC_MakeASplash(pos, *toParam);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return eEventEnable;
|
||||
}
|
||||
|
||||
float32 zMovePointGetNext(const zMovePoint* current, const zMovePoint* prev, zMovePoint** next,
|
||||
xVec3* hdng)
|
||||
{
|
||||
return xMovePointGetNext((xMovePoint*)current, (xMovePoint*)prev, (xMovePoint**)next, hdng);
|
||||
}
|
||||
|
||||
xVec3* zMovePointGetPos(const zMovePoint* m)
|
||||
{
|
||||
return xMovePointGetPos((xMovePoint*)m);
|
||||
}
|
||||
|
||||
float32 zMovePointGetDelay(const zMovePoint* m)
|
||||
{
|
||||
return xMovePointGetDelay((xMovePoint*)m);
|
||||
}
|
||||
|
||||
float32 xMovePointGetDelay(const xMovePoint* m)
|
||||
{
|
||||
return m->delay;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,27 @@
|
||||
|
||||
#include "../Core/x/xMovePoint.h"
|
||||
|
||||
#include "zScene.h"
|
||||
|
||||
#include <types.h>
|
||||
|
||||
struct zMovePoint : xMovePoint
|
||||
{
|
||||
};
|
||||
|
||||
zMovePoint* zMovePoint_GetMemPool(int32 cnt);
|
||||
void zMovePointInit(zMovePoint* m, xMovePointAsset* asset);
|
||||
zMovePoint* zMovePoint_GetInst(int32 n);
|
||||
void zMovePointSetup(zMovePoint* mvpt, zScene* scn);
|
||||
zMovePoint* zMovePoint_From_xAssetID(uint32 aid);
|
||||
void zMovePointSave(zMovePoint* ent, xSerial* s);
|
||||
void zMovePointLoad(zMovePoint* ent, xSerial* s);
|
||||
void zMovePointReset(zMovePoint* m);
|
||||
int32 zMovePointEventCB(xBase* from, xBase* to, uint32 toEvent, const float32* toParam, xBase* b3);
|
||||
float32 zMovePointGetNext(const zMovePoint* current, const zMovePoint* prev, zMovePoint** next,
|
||||
xVec3* hdng);
|
||||
xVec3* zMovePointGetPos(const zMovePoint* m);
|
||||
float32 zMovePointGetDelay(const zMovePoint* m);
|
||||
float32 xMovePointGetDelay(const xMovePoint* m);
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,10 @@
|
||||
#ifndef ZNPCSUPPLEMENT_H
|
||||
#define ZNPCSUPPLEMENT_H
|
||||
|
||||
#include "../Core/x/xVec3.h"
|
||||
|
||||
#include <types.h>
|
||||
|
||||
void NPCC_MakeASplash(const xVec3* pos, float32 radius);
|
||||
|
||||
#endif
|
||||
+27
-28
@@ -99,41 +99,40 @@ void ztaskbox::talk_callback::reset(ztaskbox& task)
|
||||
this->answer = ztalkbox::ANSWER_CONTINUE;
|
||||
}
|
||||
|
||||
#if 1
|
||||
|
||||
// func_80134BD4
|
||||
#pragma GLOBAL_ASM("asm/Game/zTaskBox.s", "stop_talk__8ztaskboxFv")
|
||||
|
||||
#else
|
||||
|
||||
// Need to fix up the conditions.
|
||||
void ztaskbox::stop_talk()
|
||||
{
|
||||
ztaskbox* curr = this->current;
|
||||
if (curr != NULL)
|
||||
|
||||
if (curr == NULL)
|
||||
{
|
||||
if (curr != this)
|
||||
{
|
||||
curr->stop_talk();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this->flag.enabled && this->state != STATE_INVALID &&
|
||||
shared == this) // Does not like this condition.
|
||||
{
|
||||
ztalkbox* other = (ztalkbox*)zSceneFindObject(this->asset->talk_box);
|
||||
if (other != NULL)
|
||||
{
|
||||
other->stop_talk();
|
||||
shared = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (curr != this)
|
||||
{
|
||||
curr->stop_talk();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this->flag.enabled || this->state == STATE_INVALID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (shared != this)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ztalkbox* other = (ztalkbox*)zSceneFindObject(this->asset->talk_box);
|
||||
|
||||
if (other)
|
||||
{
|
||||
other->stop_talk();
|
||||
shared = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void ztaskbox::enable()
|
||||
{
|
||||
if (!this->flag.enabled)
|
||||
|
||||
Reference in New Issue
Block a user