mirror of
https://github.com/zeldaret/tww.git
synced 2026-06-19 23:23:14 -04:00
copy JStudio_JStage progress from pikmin2
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
#define JAIBASIC_H
|
||||
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "dolphin/mtx/vec.h"
|
||||
#include "JSystem/JAudio/JAIBankWave.h"
|
||||
#include "JSystem/JAudio/JAISound.h"
|
||||
#include "dolphin/mtx/vec.h"
|
||||
|
||||
class JAISound;
|
||||
class JKRSolidHeap;
|
||||
|
||||
namespace JAInter {
|
||||
@@ -87,8 +87,16 @@ public:
|
||||
return JAInter::BankWave::checkAllWaveLoadStatus();
|
||||
}
|
||||
|
||||
// this might be wrong, it matches but the size doesn't seem to match the debug map
|
||||
bool checkEnablePrepare(u32 flags) { return !(flags & 0xc0000000) && !(flags & 0x00000c00); }
|
||||
|
||||
void prepareSoundVec(u32 flags, JAISound** pSound, Vec* pos, u32 r7, u32 r8, u8 r9) {
|
||||
startSoundVec(flags, pSound, pos, r7, r8, r9);
|
||||
if (*pSound) {
|
||||
(*pSound)->setPrepareFlag(1);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
void addInitOnCodeSeScene(u32, u32) {}
|
||||
void getAudioCamera() {}
|
||||
@@ -99,7 +107,6 @@ public:
|
||||
void getWaveLoadStatus(s32) {}
|
||||
void initAudio(JKRSolidHeap*, u32, u8) {}
|
||||
void loadSceneWave(s32, s32) {}
|
||||
void prepareSoundVec(u32, JAISound**, Vec*, u32, u32, u8) {}
|
||||
void setInitDataInfo(char*) {}
|
||||
void setInitOnCodeSeScene(u32*) {}
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
|
||||
namespace JStage {
|
||||
struct TFog : public TObject {
|
||||
void JSGFDisableFlag(u32 flag) { JSGSetFlag(JSGGetFlag() & ~flag); }
|
||||
void JSGFEnableFlag(u32 flag) { JSGSetFlag(JSGGetFlag() | flag); }
|
||||
|
||||
virtual ~TFog() = 0;
|
||||
virtual s32 JSGFGetType() const;
|
||||
virtual bool JSGGetFogFunction() const;
|
||||
|
||||
@@ -15,10 +15,13 @@ namespace JStage {
|
||||
};
|
||||
|
||||
struct TObject {
|
||||
void JSGFDisableFlag(u32 flag) { JSGSetFlag(JSGGetFlag() & ~flag); }
|
||||
void JSGFEnableFlag(u32 flag) { JSGSetFlag(JSGGetFlag() | flag); }
|
||||
|
||||
virtual ~TObject() = 0;
|
||||
virtual s32 JSGFGetType() const = 0;
|
||||
virtual bool JSGGetName() const;
|
||||
virtual bool JSGGetFlag() const;
|
||||
virtual u32 JSGGetFlag() const;
|
||||
virtual void JSGSetFlag(u32);
|
||||
virtual bool JSGGetData(u32, void*, u32) const;
|
||||
virtual void JSGSetData(u32, void const*, u32);
|
||||
|
||||
@@ -31,7 +31,7 @@ struct TFactory : public stb::TFactory {
|
||||
class TControl : public stb::TControl {
|
||||
public:
|
||||
struct TTransform_position {
|
||||
Vec mPosition;
|
||||
Vec mPosition;
|
||||
};
|
||||
struct TTransform_position_direction {};
|
||||
struct TTransform_translation_rotation {};
|
||||
|
||||
@@ -140,8 +140,8 @@ public:
|
||||
|
||||
struct TAdaptor {
|
||||
inline TAdaptor(TVariableValue* values, int count)
|
||||
: pValue_(values)
|
||||
, u(count)
|
||||
: mVariableValues(values)
|
||||
, mCount(count)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ struct TAdaptor {
|
||||
|
||||
|
||||
TVariableValue* adaptor_referVariableValue(u32 param_0) {
|
||||
return &pValue_[param_0];
|
||||
return &mVariableValues[param_0];
|
||||
}
|
||||
|
||||
void adaptor_setVariableValue_immediate(u32 param_0, f32 param_1) {
|
||||
@@ -192,11 +192,11 @@ struct TAdaptor {
|
||||
}
|
||||
|
||||
const TVariableValue* adaptor_getVariableValue(u32 param_0) const {
|
||||
return &pValue_[param_0];
|
||||
return &mVariableValues[param_0];
|
||||
}
|
||||
|
||||
/* 0x4 */ TVariableValue* pValue_;
|
||||
/* 0x8 */ u32 u;
|
||||
/* 0x4 */ TVariableValue* mVariableValues;
|
||||
/* 0x8 */ u32 mCount;
|
||||
};
|
||||
|
||||
struct TAdaptor_actor : public TAdaptor {
|
||||
@@ -232,8 +232,8 @@ struct TAdaptor_ambientLight : public TAdaptor {
|
||||
|
||||
/* 0x10 */ TVariableValue mValue[4];
|
||||
|
||||
static u8 const sauVariableValue_3_COLOR_RGB[12];
|
||||
static u8 const sauVariableValue_4_COLOR_RGBA[16];
|
||||
static const u32 sauVariableValue_3_COLOR_RGB[3];
|
||||
static const u32 sauVariableValue_4_COLOR_RGBA[4];
|
||||
};
|
||||
|
||||
struct TObject_ambientLight : public TObject {
|
||||
@@ -277,8 +277,8 @@ struct TAdaptor_fog : public TAdaptor {
|
||||
|
||||
/* 0x10 */ TVariableValue mValue[6];
|
||||
|
||||
static u8 const sauVariableValue_3_COLOR_RGB[12];
|
||||
static u8 const sauVariableValue_4_COLOR_RGBA[16];
|
||||
static const u32 sauVariableValue_3_COLOR_RGB[12];
|
||||
static const u32 sauVariableValue_4_COLOR_RGBA[16];
|
||||
static u8 sauVariableValue_2_RANGE_BEGIN_END[8];
|
||||
};
|
||||
|
||||
|
||||
@@ -23,10 +23,10 @@ struct TAdaptor_sound : public JStudio::TAdaptor_sound {
|
||||
};
|
||||
|
||||
struct TVVOSetValue_ : public JStudio::TVariableValue::TOutput {
|
||||
TVVOSetValue_(JStudio::TAdaptor_sound::TEVariableValue idx, TVVOSoundSetFunc func) {
|
||||
mValueIndex = idx;
|
||||
mSetFunc = func;
|
||||
}
|
||||
TVVOSetValue_(JStudio::TAdaptor_sound::TEVariableValue idx, TVVOSoundSetFunc func) {
|
||||
mValueIndex = idx;
|
||||
mSetFunc = func;
|
||||
}
|
||||
|
||||
virtual void operator()(f32, JStudio::TAdaptor*) const;
|
||||
virtual ~TVVOSetValue_() {}
|
||||
|
||||
@@ -22,9 +22,33 @@ struct TCreateObject : public JStudio::TCreateObject {
|
||||
/* 0x0C */ const JStage::TSystem* mSystem;
|
||||
};
|
||||
|
||||
template <typename Adaptor, typename Object>
|
||||
struct TVariableValueOutput_object_ : public JStudio::TVariableValue::TOutput {
|
||||
typedef void (Object::*Setter)(f32);
|
||||
typedef f32 (Object::*Getter)() const;
|
||||
|
||||
TVariableValueOutput_object_(int valueIndex, Setter setter, Getter getter)
|
||||
: TOutput()
|
||||
, mValueIndex(valueIndex)
|
||||
, mSetter(setter)
|
||||
, mGetter(getter)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void operator()(f32 value, JStudio::TAdaptor* adaptor) const // _08 (weak)
|
||||
{
|
||||
(static_cast<Object*>(static_cast<Adaptor*>(adaptor)->mObject)->*mSetter)(value);
|
||||
}
|
||||
virtual ~TVariableValueOutput_object_() { } // _0C (weak)
|
||||
|
||||
int mValueIndex; // _04
|
||||
Setter mSetter; // _08
|
||||
Getter mGetter; // _14
|
||||
};
|
||||
|
||||
struct TAdaptor_object_ {
|
||||
void adaptor_data_(JStage::TObject*, void const*, u32, void const*, u32);
|
||||
void adaptor_ENABLE_(JStage::TObject*, JStudio::data::TEOperationData, void const*, u32);
|
||||
static void adaptor_data_(JStage::TObject*, void const*, u32, void const*, u32);
|
||||
static void adaptor_ENABLE_(JStage::TObject*, JStudio::data::TEOperationData, void const*, u32);
|
||||
|
||||
/* 0x0 */ JStudio::TAdaptor* field_0x0;
|
||||
/* 0x4 */ JStage::TSystem* mSystem;
|
||||
@@ -79,7 +103,8 @@ struct TAdaptor_ambientLight : public JStudio::TAdaptor_ambientLight {
|
||||
virtual void adaptor_do_update(const JStudio::TObject*, u32);
|
||||
virtual void adaptor_do_data(const JStudio::TObject*, void const*, u32, void const*, u32);
|
||||
|
||||
/* 0x5C */ u8 field_0x5C[0x64- 0x5C];
|
||||
/* 0x5C */ const JStage::TSystem* mSystem;
|
||||
/* 0x60 */ JStage::TAmbientLight* mLight;
|
||||
}; // Size: 0x64
|
||||
|
||||
struct TAdaptor_camera : public JStudio::TAdaptor_camera {
|
||||
@@ -105,6 +130,8 @@ struct TAdaptor_camera : public JStudio::TAdaptor_camera {
|
||||
}; // Size: 0xF8
|
||||
|
||||
struct TAdaptor_fog : public JStudio::TAdaptor_fog {
|
||||
typedef TVariableValueOutput_object_<TAdaptor_fog, JStage::TFog> TVVOutput;
|
||||
|
||||
TAdaptor_fog(JStage::TSystem const*, JStage::TFog*);
|
||||
virtual ~TAdaptor_fog();
|
||||
virtual void adaptor_do_prepare(const JStudio::TObject*);
|
||||
@@ -113,9 +140,10 @@ struct TAdaptor_fog : public JStudio::TAdaptor_fog {
|
||||
virtual void adaptor_do_update(const JStudio::TObject*, u32);
|
||||
virtual void adaptor_do_data(const JStudio::TObject*, void const*, u32, void const*, u32);
|
||||
|
||||
static u8 saoVVOutput_[96 + 4 /* padding */];
|
||||
static const TVVOutput saoVVOutput_[3];
|
||||
|
||||
/* 0x84 */ u8 field_0x110[0x8C - 0x84];
|
||||
/* 0x84 */ const JStage::TSystem* mSystem;
|
||||
/* 0x88 */ JStage::TFog* mObject;
|
||||
}; // Size: 0x8C
|
||||
|
||||
struct TAdaptor_light : public JStudio::TAdaptor_light {
|
||||
|
||||
Reference in New Issue
Block a user