mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-21 22:10:59 -04:00
Copy JStudio::stb progress from TP
This commit is contained in:
@@ -0,0 +1,158 @@
|
||||
#ifndef CTB_H
|
||||
#define CTB_H
|
||||
|
||||
#include "JSystem/JGadget/binary.h"
|
||||
#include "JSystem/JGadget/linklist.h"
|
||||
#include "JSystem/JStudio/JStudio/object-id.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
|
||||
namespace JStudio {
|
||||
namespace ctb {
|
||||
struct TObject : public object::TObject_ID {
|
||||
TObject(const void* id, u32 size, const void* param_2) : object::TObject_ID(id, size) {
|
||||
pData_ = param_2;
|
||||
JUT_ASSERT(82, pData_!=0);
|
||||
}
|
||||
virtual ~TObject() = 0;
|
||||
virtual int getScheme() const = 0;
|
||||
const void* getData() const { return pData_; }
|
||||
|
||||
/* 0x08 vtable */
|
||||
/* 0x0C */ JGadget::TLinkListNode ocObject_;
|
||||
/* 0x14 */ const void* pData_;
|
||||
};
|
||||
|
||||
struct data {
|
||||
struct THeaderData {
|
||||
u32 signature;
|
||||
u16 byteOrder;
|
||||
u16 version;
|
||||
u8 field_0x0[4];
|
||||
u32 blockNumber;
|
||||
u8 content[0];
|
||||
};
|
||||
|
||||
struct TParse_THeader : public JGadget::binary::TParseData_aligned<4> {
|
||||
TParse_THeader(const void* pContent) : JGadget::binary::TParseData_aligned<4>(pContent) {}
|
||||
const THeaderData* get() const {
|
||||
return (THeaderData*) getRaw();
|
||||
}
|
||||
|
||||
const void* get_signature() const {
|
||||
return &get()->signature;
|
||||
}
|
||||
|
||||
u32 get_blockNumber() const {
|
||||
return get()->blockNumber;
|
||||
}
|
||||
|
||||
u16 get_byteOrder() const {
|
||||
return get()->byteOrder;
|
||||
}
|
||||
|
||||
u16 get_version() const {
|
||||
return get()->version;
|
||||
}
|
||||
|
||||
const void* getContent() const {
|
||||
const THeaderData* header = (THeaderData*) getRaw();
|
||||
return header->content;
|
||||
}
|
||||
};
|
||||
|
||||
struct TBlockData {
|
||||
u32 size;
|
||||
u16 scheme;
|
||||
u16 IDSize;
|
||||
u32 field_0x8[0];
|
||||
};
|
||||
|
||||
struct TParse_TBlock : public JGadget::binary::TParseData_aligned<4> {
|
||||
TParse_TBlock(const void* pContent) : JGadget::binary::TParseData_aligned<4>(pContent) {}
|
||||
const TBlockData* get() const {
|
||||
return (const TBlockData*)getRaw();
|
||||
}
|
||||
|
||||
u32 get_size() const {
|
||||
return get()->size;
|
||||
}
|
||||
|
||||
u16 get_scheme() const {
|
||||
return get()->scheme;
|
||||
}
|
||||
|
||||
u16 get_IDSize() const {
|
||||
return get()->IDSize;
|
||||
}
|
||||
|
||||
const void* getBlockEnd_() const {
|
||||
return get()->field_0x8;
|
||||
}
|
||||
|
||||
const void* get_ID() const {
|
||||
const void* rv = NULL;
|
||||
if (get_IDSize() != 0) {
|
||||
rv = getBlockEnd_();
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
const void* getContent() const {
|
||||
return (const void*)((char*)getBlockEnd_() + JGadget::binary::align_roundUp((u16)get_IDSize(), 4));
|
||||
}
|
||||
|
||||
const TParse_TBlock* getNext() {
|
||||
return (TParse_TBlock*)((char*)getRaw() + get_size());
|
||||
}
|
||||
};
|
||||
|
||||
static const u32 ga4cSignature;
|
||||
};
|
||||
|
||||
struct TObject_TxyzRy : public TObject {
|
||||
TObject_TxyzRy(JStudio::ctb::data::TParse_TBlock const&);
|
||||
|
||||
virtual ~TObject_TxyzRy();
|
||||
virtual int getScheme() const;
|
||||
};
|
||||
|
||||
struct TFactory {
|
||||
TFactory() {}
|
||||
|
||||
virtual ~TFactory();
|
||||
virtual TObject* create(JStudio::ctb::data::TParse_TBlock const&);
|
||||
virtual void destroy(JStudio::ctb::TObject*);
|
||||
};
|
||||
|
||||
struct TControl {
|
||||
TControl();
|
||||
virtual ~TControl();
|
||||
void appendObject(JStudio::ctb::TObject*);
|
||||
void removeObject(JStudio::ctb::TObject*);
|
||||
void destroyObject(JStudio::ctb::TObject*);
|
||||
void destroyObject_all();
|
||||
JStudio::ctb::TObject* getObject(void const*, u32);
|
||||
JStudio::ctb::TObject* getObject_index(u32);
|
||||
|
||||
TFactory* getFactory() { return pFactory_; }
|
||||
void setFactory(TFactory* factory) { pFactory_ = factory; }
|
||||
|
||||
/* 0x4 */ TFactory* pFactory_;
|
||||
/* 0x8 */ JGadget::TLinkList<TObject, -12> mList;
|
||||
};
|
||||
|
||||
struct TParse : public JGadget::binary::TParse_header_block {
|
||||
TParse(JStudio::ctb::TControl*);
|
||||
virtual ~TParse();
|
||||
virtual bool parseHeader_next(void const**, u32*, u32);
|
||||
virtual bool parseBlock_next(void const**, u32*, u32);
|
||||
|
||||
TControl* getControl() { return pControl_; }
|
||||
|
||||
/* 0x4 */ TControl* pControl_;
|
||||
};
|
||||
|
||||
}; // namespace ctb
|
||||
}; // namespace JStudio
|
||||
|
||||
#endif /* CTB_H */
|
||||
@@ -0,0 +1,412 @@
|
||||
#ifndef FUNCTIONVALUE_H
|
||||
#define FUNCTIONVALUE_H
|
||||
|
||||
#include "JSystem/JGadget/search.h"
|
||||
#include "JSystem/JGadget/vector.h"
|
||||
#include "global.h"
|
||||
|
||||
namespace JStudio {
|
||||
|
||||
typedef f64 (*ExtrapolateParameter)(f64, f64);
|
||||
|
||||
class TFunctionValue;
|
||||
class TFunctionValueAttributeSet;
|
||||
|
||||
class TFunctionValueAttribute_refer;
|
||||
class TFunctionValueAttribute_range;
|
||||
class TFunctionValueAttribute_interpolate;
|
||||
|
||||
class TFunctionValue {
|
||||
public:
|
||||
enum TEProgress { PROG_INIT };
|
||||
enum TEAdjust { ADJ_INIT, ADJ_UNK1, ADJ_UNK2, ADJ_UNK3, ADJ_UNK4 };
|
||||
enum TEOutside { OUT_INIT };
|
||||
enum TEInterpolate {};
|
||||
|
||||
TFunctionValue();
|
||||
virtual ~TFunctionValue() = 0;
|
||||
|
||||
virtual u32 getType() const = 0;
|
||||
virtual TFunctionValueAttributeSet getAttributeSet() = 0;
|
||||
virtual void initialize() = 0;
|
||||
virtual void prepare() = 0;
|
||||
virtual f64 getValue(f64 arg1) = 0;
|
||||
|
||||
static ExtrapolateParameter toFunction_outside(int);
|
||||
|
||||
static ExtrapolateParameter toFunction(TFunctionValue::TEOutside outside) {
|
||||
return toFunction_outside(outside);
|
||||
}
|
||||
};
|
||||
|
||||
class TFunctionValueAttributeSet_const {
|
||||
public:
|
||||
TFunctionValueAttributeSet_const(TFunctionValueAttribute_refer* refer,
|
||||
TFunctionValueAttribute_range* range,
|
||||
TFunctionValueAttribute_interpolate* interp)
|
||||
: refer_(refer), range_(range), interp_(interp) {}
|
||||
|
||||
TFunctionValueAttribute_refer* refer_get() const { return refer_; }
|
||||
TFunctionValueAttribute_range* range_get() const { return range_; }
|
||||
TFunctionValueAttribute_interpolate* interpolate_get() const { return interp_; }
|
||||
|
||||
private:
|
||||
/* 0x00 */ TFunctionValueAttribute_refer* refer_;
|
||||
/* 0x04 */ TFunctionValueAttribute_range* range_;
|
||||
/* 0x08 */ TFunctionValueAttribute_interpolate* interp_;
|
||||
};
|
||||
|
||||
class TFunctionValueAttributeSet : public TFunctionValueAttributeSet_const {
|
||||
public:
|
||||
TFunctionValueAttributeSet(TFunctionValueAttribute_refer* refer,
|
||||
TFunctionValueAttribute_range* range,
|
||||
TFunctionValueAttribute_interpolate* interp)
|
||||
: TFunctionValueAttributeSet_const(refer, range, interp) {}
|
||||
|
||||
TFunctionValueAttribute_refer* refer_get() const {
|
||||
return static_cast<const TFunctionValueAttributeSet_const*>(this)->refer_get();
|
||||
}
|
||||
TFunctionValueAttribute_range* range_get() const {
|
||||
return static_cast<const TFunctionValueAttributeSet_const*>(this)->range_get();
|
||||
}
|
||||
TFunctionValueAttribute_interpolate* interpolate_get() const {
|
||||
return static_cast<const TFunctionValueAttributeSet_const*>(this)->interpolate_get();
|
||||
}
|
||||
};
|
||||
|
||||
class TFunctionValueAttribute_refer : public JGadget::TVector_pointer<TFunctionValue*> {
|
||||
public:
|
||||
TFunctionValueAttribute_refer() :
|
||||
JGadget::TVector_pointer<TFunctionValue*>(JGadget::TAllocator<void*>()) {}
|
||||
~TFunctionValueAttribute_refer() {}
|
||||
|
||||
void refer_initialize();
|
||||
|
||||
const TFunctionValueAttribute_refer* refer_getContainer() const { return this; }
|
||||
JGadget::TVector_pointer<TFunctionValue*>& refer_referContainer() { return *this; }
|
||||
bool refer_isReferring(const TFunctionValue* p) const { return false; } // todo
|
||||
};
|
||||
|
||||
class TFunctionValueAttribute_range {
|
||||
public:
|
||||
TFunctionValueAttribute_range();
|
||||
|
||||
void range_initialize();
|
||||
void range_prepare();
|
||||
void range_set(f64, f64);
|
||||
f64 range_getParameter(f64, f64, f64) const;
|
||||
|
||||
TFunctionValue::TEProgress range_getProgress() const {
|
||||
return (TFunctionValue::TEProgress)mProgress;
|
||||
}
|
||||
void range_setProgress(TFunctionValue::TEProgress progress) { mProgress = progress; }
|
||||
TFunctionValue::TEAdjust range_getAdjust() const { return (TFunctionValue::TEAdjust)mAdjust; }
|
||||
void range_setAdjust(TFunctionValue::TEAdjust adjust) { mAdjust = adjust; }
|
||||
void range_setOutside(TFunctionValue::TEOutside outside) { range_setOutside(outside, outside); }
|
||||
void range_setOutside(TFunctionValue::TEOutside begin, TFunctionValue::TEOutside end) {
|
||||
range_setOutside_begin(begin);
|
||||
range_setOutside_end(end);
|
||||
}
|
||||
void range_setOutside_begin(TFunctionValue::TEOutside begin) { mBegin = begin; }
|
||||
void range_setOutside_end(TFunctionValue::TEOutside end) { mEnd = end; }
|
||||
f64 range_getParameter_outside(f64 arg1) const {
|
||||
f64 result = arg1;
|
||||
result -= fBegin_;
|
||||
if (result < 0.0) {
|
||||
result = TFunctionValue::toFunction(mBegin)(result, fDifference_);
|
||||
} else if (result >= fDifference_) {
|
||||
result = TFunctionValue::toFunction(mEnd)(result, fDifference_);
|
||||
}
|
||||
result += fBegin_;
|
||||
return result;
|
||||
}
|
||||
f64 range_getParameter_progress(f64 arg1) const { return _20 + _28 * (arg1 - _20); }
|
||||
f64 range_getBegin() const { return fBegin_;}
|
||||
f64 range_getEnd() const { return fEnd_;}
|
||||
f64 range_getDifference() const { return fDifference_; }
|
||||
|
||||
private:
|
||||
/* 0x00 */ f64 fBegin_;
|
||||
/* 0x08 */ f64 fEnd_;
|
||||
/* 0x10 */ f64 fDifference_;
|
||||
/* 0x18 */ s8 mProgress;
|
||||
/* 0x19 */ s8 mAdjust;
|
||||
/* 0x1A */ s8 _1a[2];
|
||||
/* 0x1C */ u32 _1c;
|
||||
/* 0x20 */ f64 _20;
|
||||
/* 0x28 */ f64 _28;
|
||||
/* 0x30 */ TFunctionValue::TEOutside mBegin;
|
||||
/* 0x34 */ TFunctionValue::TEOutside mEnd;
|
||||
};
|
||||
|
||||
class TFunctionValueAttribute_interpolate {
|
||||
public:
|
||||
TFunctionValueAttribute_interpolate() : interpolate_(0) {}
|
||||
|
||||
void interpolate_initialize() { interpolate_ = 0; }
|
||||
void interpolate_prepare() {}
|
||||
u32 interpolate_get() const { return interpolate_; }
|
||||
void interpolate_set(TFunctionValue::TEInterpolate interpolate) { interpolate_ = interpolate; }
|
||||
|
||||
private:
|
||||
/* 0x0 */ u32 interpolate_;
|
||||
};
|
||||
|
||||
class TFunctionValue_constant : public TFunctionValue {
|
||||
public:
|
||||
TFunctionValue_constant();
|
||||
virtual ~TFunctionValue_constant() {}
|
||||
|
||||
virtual u32 getType() const;
|
||||
virtual TFunctionValueAttributeSet getAttributeSet();
|
||||
virtual void initialize();
|
||||
virtual void prepare();
|
||||
virtual f64 getValue(f64);
|
||||
|
||||
void data_set(f64 value) { fValue_ = value; }
|
||||
|
||||
private:
|
||||
f64 fValue_;
|
||||
};
|
||||
|
||||
class TFunctionValue_composite : public TFunctionValue, public TFunctionValueAttribute_refer {
|
||||
public:
|
||||
struct TData {
|
||||
TData(void* data) : u32data((u32)data) {}
|
||||
TData(const void* data) : rawData(data) {}
|
||||
TData(u32 data) : u32data(data) {}
|
||||
TData(f32 data) : f32data(data) {}
|
||||
|
||||
inline void operator=(const TData& rhs) { f32data = rhs.f32data; }
|
||||
u32 get_unsignedInteger() const { return u32data; }
|
||||
f64 get_value() const { return f32data; }
|
||||
|
||||
union {
|
||||
const void* rawData;
|
||||
u32 u32data;
|
||||
f64 f32data;
|
||||
};
|
||||
};
|
||||
typedef f64 (*UnkFunc)(f64, const TFunctionValueAttribute_refer*,
|
||||
const TFunctionValue_composite::TData*);
|
||||
typedef f64 (*CompositeFunc)(const JGadget::TVector_pointer<TFunctionValue>&,
|
||||
const TFunctionValue_composite::TData&, f64);
|
||||
|
||||
TFunctionValue_composite();
|
||||
virtual ~TFunctionValue_composite() {}
|
||||
|
||||
virtual u32 getType() const;
|
||||
virtual TFunctionValueAttributeSet getAttributeSet();
|
||||
virtual void initialize();
|
||||
virtual void prepare();
|
||||
virtual f64 getValue(f64);
|
||||
static f64 composite_raw(TVector_pointer<TFunctionValue*> const&, TData const&, f64);
|
||||
static f64 composite_index(TVector_pointer<TFunctionValue*> const&, TData const&, f64);
|
||||
static f64 composite_parameter(TVector_pointer<TFunctionValue*> const&,
|
||||
TData const&, f64);
|
||||
static f64 composite_add(TVector_pointer<JStudio::TFunctionValue*> const&,
|
||||
TData const&, f64);
|
||||
static f64 composite_subtract(TVector_pointer<TFunctionValue*> const&, TData const&,
|
||||
f64);
|
||||
static f64 composite_multiply(TVector_pointer<TFunctionValue*> const&, TData const&,
|
||||
f64);
|
||||
static f64 composite_divide(TVector_pointer<TFunctionValue*> const&, TData const&,
|
||||
f64);
|
||||
|
||||
void data_set(CompositeFunc fn, const TData& dat) {
|
||||
pfn_ = (UnkFunc)fn;
|
||||
data_setData(dat);
|
||||
}
|
||||
const TData* data_getData() const { return &data; }
|
||||
void data_setData(const TData& dat) { data = dat; }
|
||||
|
||||
// private:
|
||||
UnkFunc pfn_;
|
||||
TData data;
|
||||
};
|
||||
|
||||
class TFunctionValue_transition : TFunctionValue,
|
||||
TFunctionValueAttribute_range,
|
||||
TFunctionValueAttribute_interpolate {
|
||||
public:
|
||||
TFunctionValue_transition();
|
||||
virtual ~TFunctionValue_transition() {}
|
||||
|
||||
virtual u32 getType() const;
|
||||
virtual TFunctionValueAttributeSet getAttributeSet();
|
||||
virtual void initialize();
|
||||
virtual void prepare();
|
||||
virtual f64 getValue(f64);
|
||||
|
||||
void data_set(f64 a1, f64 a2) {
|
||||
_48 = a1;
|
||||
_50 = a2;
|
||||
}
|
||||
|
||||
f64 data_getDifference() const { return _50 - _48; }
|
||||
|
||||
private:
|
||||
/* 0x48 */ f64 _48;
|
||||
/* 0x50 */ f64 _50;
|
||||
};
|
||||
|
||||
class TFunctionValue_list : TFunctionValue,
|
||||
TFunctionValueAttribute_range,
|
||||
TFunctionValueAttribute_interpolate {
|
||||
public:
|
||||
struct TIndexData_ {
|
||||
f64 _0;
|
||||
f64 _8;
|
||||
u32 _10;
|
||||
};
|
||||
typedef f64 (*update_INTERPOLATE)(const TFunctionValue_list&, const TIndexData_&);
|
||||
|
||||
TFunctionValue_list();
|
||||
virtual ~TFunctionValue_list() {}
|
||||
|
||||
virtual u32 getType() const;
|
||||
virtual TFunctionValueAttributeSet getAttributeSet();
|
||||
virtual void initialize();
|
||||
virtual void prepare();
|
||||
virtual f64 getValue(f64);
|
||||
|
||||
void data_set(const f32* pf, u32 u) {
|
||||
ASSERT((pf != NULL) || (u == 0));
|
||||
_44 = pf;
|
||||
uData_ = u;
|
||||
}
|
||||
|
||||
void data_setInterval(f64 f) {
|
||||
ASSERT(f > TValue(0));
|
||||
_50 = f;
|
||||
}
|
||||
|
||||
static f64
|
||||
update_INTERPOLATE_NONE_(JStudio::TFunctionValue_list const&,
|
||||
JStudio::TFunctionValue_list::TIndexData_ const&);
|
||||
static f64
|
||||
update_INTERPOLATE_LINEAR_(JStudio::TFunctionValue_list const&,
|
||||
JStudio::TFunctionValue_list::TIndexData_ const&);
|
||||
static f64
|
||||
update_INTERPOLATE_PLATEAU_(JStudio::TFunctionValue_list const&,
|
||||
JStudio::TFunctionValue_list::TIndexData_ const&);
|
||||
static f64
|
||||
update_INTERPOLATE_BSPLINE_dataMore3_(JStudio::TFunctionValue_list const&,
|
||||
JStudio::TFunctionValue_list::TIndexData_ const&);
|
||||
|
||||
private:
|
||||
/* 0x44 */ const f32* _44;
|
||||
/* 0x48 */ u32 uData_;
|
||||
/* 0x50 */ f64 _50;
|
||||
/* 0x58 */ update_INTERPOLATE pfnUpdate_;
|
||||
};
|
||||
|
||||
class TFunctionValue_list_parameter : TFunctionValue,
|
||||
TFunctionValueAttribute_range,
|
||||
TFunctionValueAttribute_interpolate {
|
||||
public:
|
||||
struct TIterator_data_ {
|
||||
TIterator_data_(const f32* value) : value_(value) {}
|
||||
TIterator_data_(const TIterator_data_& other) : value_(other.value_) {}
|
||||
|
||||
void operator=(const TIterator_data_& rhs) { value_ = rhs.value_; }
|
||||
TIterator_data_& operator--() {
|
||||
value_ -= 2;
|
||||
return *this;
|
||||
}
|
||||
friend bool operator==(const TIterator_data_& lhs, const TIterator_data_& rhs) { return lhs.value_ == rhs.value_; }
|
||||
|
||||
const f32* get() const { return value_; }
|
||||
void set(const f32* value) { value_ = value; }
|
||||
|
||||
const f32* value_;
|
||||
};
|
||||
typedef f64 (*update_INTERPOLATE)(const TFunctionValue_list_parameter&, f64);
|
||||
|
||||
TFunctionValue_list_parameter();
|
||||
virtual ~TFunctionValue_list_parameter() {}
|
||||
|
||||
virtual u32 getType() const;
|
||||
virtual TFunctionValueAttributeSet getAttributeSet();
|
||||
void data_set(f32 const*, u32);
|
||||
virtual void initialize();
|
||||
virtual void prepare();
|
||||
virtual f64 getValue(f64);
|
||||
|
||||
static f64
|
||||
update_INTERPOLATE_NONE_(JStudio::TFunctionValue_list_parameter const&, f64);
|
||||
static f64
|
||||
update_INTERPOLATE_LINEAR_(JStudio::TFunctionValue_list_parameter const&, f64);
|
||||
static f64
|
||||
update_INTERPOLATE_PLATEAU_(JStudio::TFunctionValue_list_parameter const&, f64);
|
||||
static f64
|
||||
update_INTERPOLATE_BSPLINE_dataMore3_(JStudio::TFunctionValue_list_parameter const&, f64);
|
||||
|
||||
f64 data_getValue_back() {
|
||||
return pfData_[(uData_ - 1) * 2];
|
||||
}
|
||||
f64 data_getValue_front() { return pfData_[0]; }
|
||||
|
||||
private:
|
||||
/* 0x44 */ const f32* pfData_;
|
||||
/* 0x48 */ u32 uData_;
|
||||
/* 0x4c */ TIterator_data_ dat1;
|
||||
/* 0x50 */ TIterator_data_ dat2;
|
||||
/* 0x54 */ TIterator_data_ dat3;
|
||||
/* 0x58 */ update_INTERPOLATE pfnUpdate_;
|
||||
};
|
||||
|
||||
class TFunctionValue_hermite : TFunctionValue, TFunctionValueAttribute_range {
|
||||
public:
|
||||
struct TIterator_data_ {
|
||||
TIterator_data_(const TFunctionValue_hermite& rParent, const f32* value) {
|
||||
value_ = value;
|
||||
size_ = rParent.data_getSize();
|
||||
}
|
||||
|
||||
const f32* get() { return value_; }
|
||||
|
||||
void set(const f32* value, u32 size) {
|
||||
value_ = value;
|
||||
size_ = size;
|
||||
}
|
||||
|
||||
friend bool operator==(const TIterator_data_& lhs, const TIterator_data_& rhs) { return lhs.value_ == rhs.value_; }
|
||||
|
||||
TIterator_data_& operator--() {
|
||||
value_ -= size_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* 0x00 */ const f32* value_;
|
||||
/* 0x04 */ u32 size_;
|
||||
};
|
||||
|
||||
TFunctionValue_hermite();
|
||||
virtual ~TFunctionValue_hermite() {}
|
||||
|
||||
virtual u32 getType() const;
|
||||
virtual TFunctionValueAttributeSet getAttributeSet();
|
||||
void data_set(f32 const*, u32, u32);
|
||||
virtual void initialize();
|
||||
virtual void prepare();
|
||||
virtual f64 getValue(f64);
|
||||
|
||||
u32 data_getSize() const { return uSize_; }
|
||||
f64 data_getValue_back() {
|
||||
return pf_[(u_ - 1) * uSize_];
|
||||
}
|
||||
f64 data_getValue_front() { return pf_[0]; }
|
||||
|
||||
private:
|
||||
/* 0x40 */ const f32* pf_;
|
||||
/* 0x44 */ u32 u_;
|
||||
/* 0x48 */ u32 uSize_;
|
||||
/* 0x4c */ TIterator_data_ dat1;
|
||||
/* 0x50 */ TIterator_data_ dat2;
|
||||
/* 0x54 */ TIterator_data_ dat3;
|
||||
};
|
||||
|
||||
} // namespace JStudio
|
||||
|
||||
#endif /* FUNCTIONVALUE_H */
|
||||
@@ -0,0 +1,53 @@
|
||||
#ifndef FVB_DATA_PARSE_H
|
||||
#define FVB_DATA_PARSE_H
|
||||
|
||||
#include "JSystem/JStudio/JStudio/fvb-data.h"
|
||||
|
||||
namespace JStudio {
|
||||
namespace fvb {
|
||||
namespace data {
|
||||
|
||||
class TParse_TBlock : public TParseData_aligned<4> {
|
||||
public:
|
||||
TParse_TBlock(const void* content) : TParseData_aligned<4>(content) {}
|
||||
|
||||
const TBlock* get() const { return (TBlock*)getRaw(); }
|
||||
|
||||
u32 get_size() const { return get()->size; }
|
||||
const void* getNext() const {
|
||||
u32 size = get_size();
|
||||
return (const void*)((u8*)getRaw() + size);
|
||||
}
|
||||
u16 get_type() const { return get()->type; }
|
||||
u16 get_IDSize() const { return get()->id_size; }
|
||||
const void* getBlockEnd_() const { return (u8*)getRaw() + sizeof(TBlock); }
|
||||
const void* get_ID() const {
|
||||
const void* ret = 0;
|
||||
if (get_IDSize())
|
||||
ret = getBlockEnd_();
|
||||
return ret;
|
||||
}
|
||||
const void* getContent() const {
|
||||
u32 size = align_roundUp(get_IDSize(), 4);
|
||||
return (const void*)((int)getBlockEnd_() + size);
|
||||
}
|
||||
};
|
||||
|
||||
class TParse_TParagraph : public TParseData_aligned<4> {
|
||||
public:
|
||||
struct TData {
|
||||
/* 0x04 */ u32 u32Size;
|
||||
/* 0x08 */ u32 u32Type;
|
||||
/* 0x0C */ const void* pContent;
|
||||
/* 0x10 */ const void* next;
|
||||
};
|
||||
TParse_TParagraph(const void* content) : TParseData_aligned<4>(content) {}
|
||||
|
||||
void getData(JStudio::fvb::data::TParse_TParagraph::TData*) const;
|
||||
};
|
||||
|
||||
} // namespace data
|
||||
} // namespace fvb
|
||||
} // namespace JStudio
|
||||
|
||||
#endif /* FVB_DATA_PARSE_H */
|
||||
@@ -0,0 +1,63 @@
|
||||
#ifndef FVB_DATA_H
|
||||
#define FVB_DATA_H
|
||||
|
||||
#include "JSystem/JGadget/binary.h"
|
||||
#include "JSystem/JStudio/JStudio/functionvalue.h"
|
||||
|
||||
using namespace JGadget::binary;
|
||||
|
||||
namespace JStudio {
|
||||
namespace fvb {
|
||||
namespace data {
|
||||
|
||||
extern const char ga4cSignature[4];
|
||||
|
||||
const int PARAGRAPH_DATA = 1;
|
||||
|
||||
typedef enum TEComposite {
|
||||
/* 0x0 */ COMPOSITE_NONE,
|
||||
/* 0x1 */ COMPOSITE_RAW,
|
||||
/* 0x2 */ COMPOSITE_IDX,
|
||||
/* 0x3 */ COMPOSITE_PARAM,
|
||||
/* 0x4 */ COMPOSITE_ADD,
|
||||
/* 0x5 */ COMPOSITE_SUB,
|
||||
/* 0x6 */ COMPOSITE_MUL,
|
||||
/* 0x7 */ COMPOSITE_DIV,
|
||||
/* 0x8 */ COMPOSITE_ENUM_SIZE,
|
||||
};
|
||||
|
||||
typedef const void* (*CompositeOperation)(TFunctionValue_composite::TData);
|
||||
|
||||
struct TBlock {
|
||||
/* 0x0 */ u32 size;
|
||||
/* 0x4 */ u16 type;
|
||||
/* 0x6 */ u16 id_size;
|
||||
/* 0x8 */ u8 id[0];
|
||||
};
|
||||
|
||||
struct THeader {
|
||||
/* 0x00 */ char signature[4];
|
||||
/* 0x04 */ u16 byte_order; // must be 0xFEFF
|
||||
/* 0x06 */ u16 version; // 0-1 = obselete, 2-7 = OK
|
||||
/* 0x08 */ u32 _8;
|
||||
/* 0x0C */ u32 block_number;
|
||||
/* 0x10 */ u8 content[0];
|
||||
};
|
||||
// Parses a THeader
|
||||
class TParse_THeader : public TParseData_aligned<4> {
|
||||
public:
|
||||
TParse_THeader(const void* p) : TParseData_aligned<4>(p) {}
|
||||
|
||||
const THeader* get() const { return (THeader*)getRaw(); }
|
||||
const void* getContent() const { return ((THeader*)getRaw())->content; }
|
||||
const char* get_signature() const { return get()->signature; }
|
||||
u16 get_byteOrder() const { return get()->byte_order; }
|
||||
u16 get_version() const { return get()->version; }
|
||||
u32 get_blockNumber() const { return get()->block_number; }
|
||||
};
|
||||
|
||||
} // namespace data
|
||||
} // namespace fvb
|
||||
} // namespace JStudio
|
||||
|
||||
#endif /* FVB_DATA_H */
|
||||
@@ -0,0 +1,160 @@
|
||||
#ifndef FVB_H
|
||||
#define FVB_H
|
||||
|
||||
#include "JSystem/JGadget/linklist.h"
|
||||
#include "JSystem/JStudio/JStudio/fvb-data-parse.h"
|
||||
#include "JSystem/JStudio/JStudio/object-id.h"
|
||||
|
||||
namespace JStudio {
|
||||
namespace fvb {
|
||||
|
||||
class TControl;
|
||||
|
||||
class TParse : public TParse_header_block {
|
||||
public:
|
||||
TParse(JStudio::fvb::TControl*);
|
||||
virtual ~TParse();
|
||||
virtual bool parseHeader_next(void const**, u32*, u32);
|
||||
virtual bool parseBlock_next(void const**, u32*, u32);
|
||||
|
||||
TControl* getControl() const { return pControl_; }
|
||||
|
||||
private:
|
||||
TControl* pControl_;
|
||||
};
|
||||
|
||||
class TObject : public object::TObject_ID {
|
||||
public:
|
||||
TObject(const data::TParse_TBlock& block);
|
||||
TObject(void const* id, u32 id_size, TFunctionValue* value);
|
||||
|
||||
explicit TObject(const data::TParse_TBlock& block, TFunctionValue* value)
|
||||
: TObject_ID(block.get_ID(), block.get_IDSize()), pfv_(value) {
|
||||
ASSERT(pfv_ != NULL);
|
||||
}
|
||||
|
||||
virtual ~TObject() = 0;
|
||||
|
||||
virtual void prepare_data_(const data::TParse_TParagraph::TData& data, TControl* control) = 0;
|
||||
|
||||
void prepare(const data::TParse_TBlock& block, TControl* control);
|
||||
|
||||
TFunctionValue* const& referFunctionValue() { return pfv_; }
|
||||
|
||||
private:
|
||||
/* 0x0C */ JGadget::TLinkListNode mNode;
|
||||
/* 0x14 */ TFunctionValue* pfv_;
|
||||
};
|
||||
|
||||
class TFactory {
|
||||
public:
|
||||
TFactory() {}
|
||||
|
||||
virtual ~TFactory();
|
||||
virtual TObject* create(JStudio::fvb::data::TParse_TBlock const&);
|
||||
virtual void destroy(JStudio::fvb::TObject*);
|
||||
};
|
||||
|
||||
class TControl {
|
||||
public:
|
||||
TControl();
|
||||
virtual ~TControl();
|
||||
|
||||
void appendObject(JStudio::fvb::TObject*);
|
||||
void removeObject(JStudio::fvb::TObject*);
|
||||
void destroyObject(JStudio::fvb::TObject*);
|
||||
void destroyObject_all();
|
||||
TObject* getObject(void const*, u32);
|
||||
TObject* getObject_index(u32);
|
||||
|
||||
TFactory* getFactory() const { return pFactory; }
|
||||
void setFactory(TFactory* factory) { pFactory = factory; }
|
||||
|
||||
private:
|
||||
/* 0x4 */ TFactory* pFactory;
|
||||
/* 0x8 */ JGadget::TLinkList<TObject, 12> ocObject_;
|
||||
}; // Size: 0x14
|
||||
|
||||
class TObject_composite : public TObject {
|
||||
public:
|
||||
TObject_composite(JStudio::fvb::data::TParse_TBlock const&);
|
||||
virtual void prepare_data_(JStudio::fvb::data::TParse_TParagraph::TData const&,
|
||||
JStudio::fvb::TControl*);
|
||||
virtual ~TObject_composite() {}
|
||||
|
||||
private:
|
||||
TFunctionValue_composite fnValue;
|
||||
};
|
||||
|
||||
class TObject_constant : public TObject {
|
||||
public:
|
||||
TObject_constant(data::TParse_TBlock const&);
|
||||
virtual ~TObject_constant() {}
|
||||
|
||||
virtual void prepare_data_(data::TParse_TParagraph::TData const&, TControl*);
|
||||
|
||||
private:
|
||||
TFunctionValue_constant fnValue;
|
||||
};
|
||||
|
||||
class TObject_transition : public TObject {
|
||||
public:
|
||||
TObject_transition(data::TParse_TBlock const&);
|
||||
virtual ~TObject_transition() {}
|
||||
|
||||
virtual void prepare_data_(data::TParse_TParagraph::TData const&, TControl*);
|
||||
|
||||
private:
|
||||
TFunctionValue_transition fnValue;
|
||||
};
|
||||
|
||||
class TObject_list : public TObject {
|
||||
public:
|
||||
struct ListData {
|
||||
/* 0x0 */ f32 _0;
|
||||
/* 0x4 */ u32 _4;
|
||||
/* 0x8 */ f32 _8[0];
|
||||
};
|
||||
TObject_list(data::TParse_TBlock const&);
|
||||
virtual ~TObject_list() {}
|
||||
|
||||
virtual void prepare_data_(data::TParse_TParagraph::TData const&, TControl*);
|
||||
|
||||
private:
|
||||
TFunctionValue_list fnValue;
|
||||
};
|
||||
|
||||
class TObject_list_parameter : public TObject {
|
||||
public:
|
||||
struct ListData {
|
||||
u32 _0;
|
||||
f32 _4[0];
|
||||
};
|
||||
TObject_list_parameter(data::TParse_TBlock const&);
|
||||
virtual ~TObject_list_parameter() {}
|
||||
|
||||
virtual void prepare_data_(data::TParse_TParagraph::TData const&, TControl*);
|
||||
|
||||
private:
|
||||
TFunctionValue_list_parameter fnValue;
|
||||
};
|
||||
|
||||
struct TObject_hermite : public TObject {
|
||||
public:
|
||||
struct ListData {
|
||||
u32 _0; // u : 28, uSize : 4
|
||||
f32 _4[0];
|
||||
};
|
||||
TObject_hermite(data::TParse_TBlock const&);
|
||||
virtual ~TObject_hermite() {}
|
||||
|
||||
virtual void prepare_data_(data::TParse_TParagraph::TData const&, TControl*);
|
||||
|
||||
private:
|
||||
TFunctionValue_hermite fnValue;
|
||||
};
|
||||
|
||||
} // namespace fvb
|
||||
} // namespace JStudio
|
||||
|
||||
#endif /* FVB_H */
|
||||
@@ -0,0 +1,131 @@
|
||||
#ifndef JSTUDIO_CONTROL_H
|
||||
#define JSTUDIO_CONTROL_H
|
||||
|
||||
#include "JSystem/JStudio/JStudio/fvb.h"
|
||||
#include "JSystem/JStudio/JStudio/stb.h"
|
||||
#include "JSystem/JStudio/JStudio/ctb.h"
|
||||
#include "dolphin/gx/GX.h"
|
||||
#include "dolphin/mtx/vec.h"
|
||||
|
||||
namespace JStudio {
|
||||
struct TObject;
|
||||
struct TCreateObject {
|
||||
TCreateObject() {}
|
||||
virtual ~TCreateObject() = 0;
|
||||
virtual bool create(TObject**, JStudio::stb::data::TParse_TBlock_object const&) = 0;
|
||||
|
||||
/* 0x4 */ JGadget::TLinkListNode mNode;
|
||||
}; // Size: 0xC
|
||||
|
||||
struct TFactory : public stb::TFactory {
|
||||
TFactory() {}
|
||||
|
||||
virtual ~TFactory();
|
||||
virtual TObject* create(JStudio::stb::data::TParse_TBlock_object const&);
|
||||
|
||||
void appendCreateObject(JStudio::TCreateObject*);
|
||||
|
||||
/* 0x04 */ JGadget::TLinkList<TCreateObject, -4> mList;
|
||||
/* 0x10 */ fvb::TFactory fvb_Factory;
|
||||
/* 0x14 */ ctb::TFactory ctb_Factory;
|
||||
};
|
||||
|
||||
class TControl : public stb::TControl {
|
||||
public:
|
||||
struct TTransform_translation_rotation_scaling {};
|
||||
struct TTransform_position {};
|
||||
|
||||
TControl();
|
||||
virtual ~TControl();
|
||||
void setFactory(JStudio::TFactory*);
|
||||
int transformOnSet_setOrigin_TxyzRy(Vec const&, f32);
|
||||
int transformOnGet_setOrigin_TxyzRy(Vec const&, f32);
|
||||
int transform_setOrigin_ctb(JStudio::ctb::TObject const&);
|
||||
bool transform_setOrigin_ctb_index(u32);
|
||||
|
||||
void stb_destroyObject_all() { stb::TControl::destroyObject_all(); }
|
||||
void fvb_destroyObject_all() { fvb_Control.destroyObject_all(); }
|
||||
void ctb_destroyObject_all() { ctb_Control.destroyObject_all(); }
|
||||
|
||||
void destroyObject_all() {
|
||||
stb_destroyObject_all();
|
||||
fvb_destroyObject_all();
|
||||
ctb_destroyObject_all();
|
||||
}
|
||||
|
||||
void transformOnSet_enable(bool param_0) { mTransformOnSet = param_0; }
|
||||
void transformOnGet_enable(bool param_0) { mTransformOnGet = param_0; }
|
||||
|
||||
void transform_enable(bool param_0) {
|
||||
transformOnSet_enable(param_0);
|
||||
transformOnGet_enable(param_0);
|
||||
}
|
||||
|
||||
void transform_setOrigin_TxyzRy(const Vec& xyz, f32 rotY) {
|
||||
transformOnSet_setOrigin_TxyzRy(xyz, rotY);
|
||||
transformOnGet_setOrigin_TxyzRy(xyz, rotY);
|
||||
}
|
||||
|
||||
void transform_setOrigin(const Vec& xyz, f32 rotY) {
|
||||
transform_setOrigin_TxyzRy(xyz, rotY);
|
||||
}
|
||||
|
||||
void setSecondPerFrame(f64 param_0) { mSecondPerFrame = param_0; }
|
||||
f64 getSecondPerFrame() const { return mSecondPerFrame; }
|
||||
|
||||
ctb::TObject* ctb_getObject_index(u32 index) {
|
||||
return ctb_Control.getObject_index(index);
|
||||
}
|
||||
|
||||
fvb::TObject* fvb_getObject(const void* param_1, u32 param_2) {
|
||||
return fvb_Control.getObject(param_1, param_2);
|
||||
}
|
||||
|
||||
fvb::TObject* fvb_getObject_index(u32 index) {
|
||||
return fvb_Control.getObject_index(index);
|
||||
}
|
||||
|
||||
TFunctionValue* getFunctionValue(const void* param_1, u32 param_2) {
|
||||
fvb::TObject* obj = fvb_getObject(param_1, param_2);
|
||||
if (obj == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return obj->referFunctionValue();
|
||||
}
|
||||
|
||||
TFunctionValue* getFunctionValue_index(u32 index) {
|
||||
fvb::TObject* obj = fvb_getObject_index(index);
|
||||
if (obj == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return obj->referFunctionValue();
|
||||
}
|
||||
|
||||
/* 0x58 */ f64 mSecondPerFrame;
|
||||
/* 0x60 */ fvb::TControl fvb_Control;
|
||||
/* 0x74 */ ctb::TControl ctb_Control;
|
||||
/* 0x88 */ bool mTransformOnSet;
|
||||
/* 0x89 */ bool mTransformOnGet;
|
||||
/* 0x8C */ Vec field_0x8c;
|
||||
/* 0x98 */ Vec field_0x98;
|
||||
/* 0xA4 */ f32 mTransformOnSet_RotationY;
|
||||
/* 0xA8 */ f32 field_0xa8;
|
||||
/* 0xAC */ Mtx mTransformOnSet_Matrix;
|
||||
/* 0xDC */ Mtx mTransformOnGet_Matrix;
|
||||
};
|
||||
|
||||
struct TParse : public stb::TParse {
|
||||
TParse(JStudio::TControl*);
|
||||
bool parseBlock_block_fvb_(JStudio::stb::data::TParse_TBlock const&, u32);
|
||||
bool parseBlock_block_ctb_(JStudio::stb::data::TParse_TBlock const&, u32);
|
||||
|
||||
virtual ~TParse();
|
||||
virtual bool parseHeader(JStudio::stb::data::TParse_THeader const&, u32);
|
||||
virtual bool parseBlock_block(JStudio::stb::data::TParse_TBlock const&, u32);
|
||||
|
||||
TControl* getControl() { return (TControl*)stb::TParse::getControl(); }
|
||||
};
|
||||
|
||||
}; // namespace JStudio
|
||||
|
||||
#endif /* JSTUDIO_CONTROL_H */
|
||||
@@ -0,0 +1,336 @@
|
||||
#ifndef JSTUDIO_OBJECT_H
|
||||
#define JSTUDIO_OBJECT_H
|
||||
|
||||
#include "JSystem/JStudio/JStudio/ctb.h"
|
||||
#include "JSystem/JStudio/JStudio/jstudio-control.h"
|
||||
#include "limits.h"
|
||||
|
||||
typedef struct _GXColor GXColor;
|
||||
|
||||
namespace JStudio {
|
||||
namespace data {
|
||||
enum TEOperationData {
|
||||
UNK_0x1 = 0x1,
|
||||
UNK_0x2 = 0x2,
|
||||
UNK_0x3 = 0x3,
|
||||
UNK_0x10 = 0x10,
|
||||
UNK_0x12 = 0x12,
|
||||
UNK_0x19 = 0x19,
|
||||
};
|
||||
};
|
||||
|
||||
struct TAdaptor;
|
||||
struct TVariableValue {
|
||||
struct TOutput {
|
||||
virtual void operator()(f32, JStudio::TAdaptor*) const = 0;
|
||||
~TOutput();
|
||||
};
|
||||
|
||||
struct TOutput_none_ {
|
||||
~TOutput_none_();
|
||||
void operator()(f32, JStudio::TAdaptor*) const;
|
||||
};
|
||||
|
||||
void update(f64, JStudio::TAdaptor*);
|
||||
static void update_immediate_(JStudio::TVariableValue*, f64);
|
||||
static void update_time_(JStudio::TVariableValue*, f64);
|
||||
static void update_functionValue_(JStudio::TVariableValue*, f64);
|
||||
TVariableValue();
|
||||
|
||||
void setValue_immediate(f32 value) {
|
||||
field_0x8 = &update_immediate_;
|
||||
field_0x4 = 0;
|
||||
field_0xc.val = value;
|
||||
}
|
||||
|
||||
void setValue_none() {
|
||||
field_0x8 = NULL;
|
||||
}
|
||||
|
||||
void setValue_time(f32 value) {
|
||||
field_0x8 = &update_time_;
|
||||
field_0x4 = 0;
|
||||
field_0xc.val = value;
|
||||
}
|
||||
|
||||
void setValue_functionValue(TFunctionValue* value) {
|
||||
field_0x8 = &update_functionValue_;
|
||||
field_0x4 = 0;
|
||||
field_0xc.fv = value;
|
||||
}
|
||||
|
||||
f32 getValue() const { return mValue; }
|
||||
|
||||
template<typename T>
|
||||
T getValue_clamp() const {
|
||||
f32 val = mValue;
|
||||
if (val <= std::numeric_limits<T>::min()) {
|
||||
return std::numeric_limits<T>::min();
|
||||
} else if (val >= std::numeric_limits<T>::max()) {
|
||||
return std::numeric_limits<T>::max();
|
||||
}
|
||||
return val;
|
||||
}
|
||||
u8 getValue_uint8() const { return getValue_clamp<u8>(); }
|
||||
|
||||
void forward(u32 param_0) {
|
||||
if (std::numeric_limits<u32>::max() - field_0x4 <= param_0) {
|
||||
field_0x4 = std::numeric_limits<u32>::max();
|
||||
} else {
|
||||
field_0x4 += param_0;
|
||||
}
|
||||
}
|
||||
|
||||
static u8 soOutput_none_[4 + 4 /* padding */];
|
||||
|
||||
/* 0x00 */ f32 mValue;
|
||||
/* 0x04 */ u32 field_0x4;
|
||||
/* 0x08 */ void (*field_0x8)(TVariableValue*, double);
|
||||
/* 0x0C */ union {
|
||||
TFunctionValue* fv;
|
||||
f32 val;
|
||||
} field_0xc;
|
||||
/* 0x10 */ TOutput* pOutput_;
|
||||
}; // Size: 0x14
|
||||
|
||||
typedef void (TObject::*paragraphFunc)(u32, void const*, u32);
|
||||
|
||||
class TObject : public stb::TObject {
|
||||
public:
|
||||
TObject(JStudio::stb::data::TParse_TBlock_object const&, JStudio::TAdaptor*);
|
||||
void forward_value(u32);
|
||||
|
||||
virtual ~TObject() = 0;
|
||||
virtual void do_begin();
|
||||
virtual void do_end();
|
||||
virtual void do_paragraph(u32, void const*, u32) = 0;
|
||||
virtual void do_wait(u32);
|
||||
virtual void do_data(void const*, u32, void const*, u32);
|
||||
|
||||
TAdaptor* getAdaptor() { return mpAdaptor; }
|
||||
TControl* getControl() { return (TControl*)stb::TObject::getControl(); }
|
||||
|
||||
void prepareAdaptor() {
|
||||
if (mpAdaptor != NULL) {
|
||||
// mpAdaptor->adaptor_setObject_(this);
|
||||
// mpAdaptor->adaptor_do_begin();
|
||||
}
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T* createFromAdaptor(const stb::data::TParse_TBlock_object& param_0, T* param_1) {
|
||||
T* n = new T(param_0, param_1);
|
||||
|
||||
if (n == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
n->prepareAdaptor();
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
/* 0x34 */ TAdaptor* mpAdaptor;
|
||||
};
|
||||
|
||||
struct TAdaptor {
|
||||
struct TSetVariableValue_immediate {
|
||||
u32 field_0x0;
|
||||
f32 field_0x4;
|
||||
};
|
||||
typedef void (*setVarFunc)(JStudio::TAdaptor*, JStudio::TControl*, u32, void const*, u32);
|
||||
virtual ~TAdaptor() = 0;
|
||||
virtual void adaptor_do_prepare();
|
||||
virtual void adaptor_do_begin();
|
||||
virtual void adaptor_do_end();
|
||||
virtual void adaptor_do_update(u32);
|
||||
virtual void adaptor_do_data(void const*, u32, void const*, u32);
|
||||
|
||||
void adaptor_setVariableValue(JStudio::TControl*, u32,
|
||||
JStudio::data::TEOperationData, void const*, u32);
|
||||
void adaptor_setVariableValue_n(JStudio::TControl*, u32 const*, u32,
|
||||
JStudio::data::TEOperationData, void const*,
|
||||
u32);
|
||||
void
|
||||
adaptor_setVariableValue_immediate(JStudio::TAdaptor::TSetVariableValue_immediate const*);
|
||||
void adaptor_setVariableValue_Vec(u32 const*, Vec const&);
|
||||
void adaptor_getVariableValue_Vec(Vec*, u32 const*) const;
|
||||
void adaptor_setVariableValue_GXColor(u32 const*, GXColor const&);
|
||||
void adaptor_getVariableValue_GXColor(GXColor*, u32 const*) const;
|
||||
void adaptor_updateVariableValue(JStudio::TControl*, u32);
|
||||
static void adaptor_setVariableValue_VOID_(JStudio::TAdaptor*, JStudio::TControl*, u32,
|
||||
void const*, u32);
|
||||
static void adaptor_setVariableValue_IMMEDIATE_(JStudio::TAdaptor*, JStudio::TControl*,
|
||||
u32, void const*, u32);
|
||||
static void adaptor_setVariableValue_TIME_(JStudio::TAdaptor*, JStudio::TControl*, u32,
|
||||
void const*, u32);
|
||||
static void adaptor_setVariableValue_FVR_NAME_(JStudio::TAdaptor*, JStudio::TControl*,
|
||||
u32, void const*, u32);
|
||||
static void adaptor_setVariableValue_FVR_INDEX_(JStudio::TAdaptor*, JStudio::TControl*,
|
||||
u32, void const*, u32);
|
||||
|
||||
void adaptor_setObject_(const TObject* pObject) {
|
||||
pObject_ = pObject;
|
||||
}
|
||||
|
||||
TVariableValue* adaptor_referVariableValue(u32 param_0) {
|
||||
return &pValue_[param_0];
|
||||
}
|
||||
|
||||
void adaptor_setVariableValue_immediate(u32 param_0, f32 param_1) {
|
||||
adaptor_referVariableValue(param_0)->setValue_immediate(param_1);
|
||||
}
|
||||
|
||||
const TVariableValue* adaptor_getVariableValue(u32 param_0) const {
|
||||
return &pValue_[param_0];
|
||||
}
|
||||
|
||||
/* 0x4 */ const TObject* pObject_;
|
||||
/* 0x8 */ TVariableValue* pValue_;
|
||||
/* 0xC */ u32 u;
|
||||
};
|
||||
|
||||
struct TAdaptor_actor : public TAdaptor {
|
||||
virtual ~TAdaptor_actor() = 0;
|
||||
|
||||
/* 0x10 */ TVariableValue mValue[14];
|
||||
|
||||
static u8 const sauVariableValue_3_TRANSLATION_XYZ[12];
|
||||
static u8 const sauVariableValue_3_ROTATION_XYZ[12];
|
||||
static u8 const sauVariableValue_3_SCALING_XYZ[12];
|
||||
}; // Size: 0x128
|
||||
|
||||
struct TObject_actor : public TObject {
|
||||
TObject_actor(JStudio::stb::data::TParse_TBlock_object const&,
|
||||
JStudio::TAdaptor_actor*);
|
||||
|
||||
virtual ~TObject_actor();
|
||||
virtual void do_paragraph(u32, void const*, u32);
|
||||
};
|
||||
|
||||
struct TAdaptor_ambientLight : public TAdaptor {
|
||||
virtual ~TAdaptor_ambientLight() = 0;
|
||||
|
||||
/* 0x10 */ TVariableValue mValue[4];
|
||||
|
||||
static u8 const sauVariableValue_3_COLOR_RGB[12];
|
||||
static u8 const sauVariableValue_4_COLOR_RGBA[16];
|
||||
};
|
||||
|
||||
struct TObject_ambientLight : public TObject {
|
||||
TObject_ambientLight(JStudio::stb::data::TParse_TBlock_object const&,
|
||||
JStudio::TAdaptor_ambientLight*);
|
||||
|
||||
virtual ~TObject_ambientLight();
|
||||
virtual void do_paragraph(u32, void const*, u32);
|
||||
};
|
||||
|
||||
struct TAdaptor_camera : public TAdaptor {
|
||||
virtual ~TAdaptor_camera() = 0;
|
||||
|
||||
/* 0x10 */ TVariableValue mValue[12];
|
||||
|
||||
static u8 const sauVariableValue_3_POSITION_XYZ[12];
|
||||
static u8 const sauVariableValue_3_TARGET_POSITION_XYZ[12];
|
||||
static u8 sauVariableValue_2_DISTANCE_NEAR_FAR[8];
|
||||
};
|
||||
|
||||
struct TObject_camera : public TObject {
|
||||
TObject_camera(JStudio::stb::data::TParse_TBlock_object const&,
|
||||
JStudio::TAdaptor_camera*);
|
||||
|
||||
virtual ~TObject_camera();
|
||||
virtual void do_paragraph(u32, void const*, u32);
|
||||
};
|
||||
|
||||
struct TAdaptor_fog : public TAdaptor {
|
||||
virtual ~TAdaptor_fog() = 0;
|
||||
|
||||
/* 0x10 */ TVariableValue mValue[6];
|
||||
|
||||
static u8 const sauVariableValue_3_COLOR_RGB[12];
|
||||
static u8 const sauVariableValue_4_COLOR_RGBA[16];
|
||||
static u8 sauVariableValue_2_RANGE_BEGIN_END[8];
|
||||
};
|
||||
|
||||
struct TObject_fog : public TObject {
|
||||
TObject_fog(JStudio::stb::data::TParse_TBlock_object const&,
|
||||
JStudio::TAdaptor_fog*);
|
||||
|
||||
virtual ~TObject_fog();
|
||||
virtual void do_paragraph(u32, void const*, u32);
|
||||
};
|
||||
|
||||
struct TAdaptor_light : public TAdaptor {
|
||||
virtual ~TAdaptor_light() = 0;
|
||||
|
||||
/* 0x10 */ TVariableValue mValue[13];
|
||||
|
||||
static u8 const sauVariableValue_3_COLOR_RGB[12];
|
||||
static u8 const sauVariableValue_4_COLOR_RGBA[16];
|
||||
static u8 const sauVariableValue_3_POSITION_XYZ[12];
|
||||
static u8 const sauVariableValue_3_TARGET_POSITION_XYZ[12];
|
||||
static u8 sauVariableValue_2_DIRECTION_THETA_PHI[8];
|
||||
};
|
||||
|
||||
struct TObject_light : public TObject {
|
||||
TObject_light(JStudio::stb::data::TParse_TBlock_object const&,
|
||||
JStudio::TAdaptor_light*);
|
||||
|
||||
virtual ~TObject_light();
|
||||
virtual void do_paragraph(u32, void const*, u32);
|
||||
};
|
||||
|
||||
struct TAdaptor_message : public TAdaptor {
|
||||
virtual ~TAdaptor_message() = 0;
|
||||
};
|
||||
|
||||
struct TObject_message : public TObject {
|
||||
TObject_message(JStudio::stb::data::TParse_TBlock_object const&,
|
||||
JStudio::TAdaptor_message*);
|
||||
|
||||
virtual ~TObject_message();
|
||||
virtual void do_paragraph(u32, void const*, u32);
|
||||
};
|
||||
|
||||
struct TAdaptor_particle : public TAdaptor {
|
||||
virtual ~TAdaptor_particle() = 0;
|
||||
|
||||
/* 0x10 */ TVariableValue mValue[20];
|
||||
|
||||
static u8 const sauVariableValue_3_TRANSLATION_XYZ[12];
|
||||
static u8 const sauVariableValue_3_ROTATION_XYZ[12];
|
||||
static u8 const sauVariableValue_3_SCALING_XYZ[12];
|
||||
static u8 const sauVariableValue_3_COLOR_RGB[12];
|
||||
static u8 const sauVariableValue_4_COLOR_RGBA[16];
|
||||
static u8 const sauVariableValue_3_COLOR1_RGB[12];
|
||||
static u8 const sauVariableValue_4_COLOR1_RGBA[16];
|
||||
};
|
||||
|
||||
struct TObject_particle : public TObject {
|
||||
TObject_particle(JStudio::stb::data::TParse_TBlock_object const&,
|
||||
JStudio::TAdaptor_particle*);
|
||||
|
||||
virtual ~TObject_particle();
|
||||
virtual void do_paragraph(u32, void const*, u32);
|
||||
};
|
||||
|
||||
struct TAdaptor_sound : public TAdaptor {
|
||||
virtual ~TAdaptor_sound() = 0;
|
||||
|
||||
/* 0x10 */ TVariableValue mValue[13];
|
||||
|
||||
static u8 const sauVariableValue_3_POSITION_XYZ[12];
|
||||
}; // Size: 0x114
|
||||
|
||||
struct TObject_sound : public TObject {
|
||||
TObject_sound(JStudio::stb::data::TParse_TBlock_object const&,
|
||||
JStudio::TAdaptor_sound*);
|
||||
|
||||
virtual ~TObject_sound();
|
||||
virtual void do_paragraph(u32, void const*, u32);
|
||||
};
|
||||
|
||||
}; // namespace JStudio
|
||||
|
||||
#endif /* JSTUDIO_OBJECT_H */
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef OBJECT_ID_H
|
||||
#define OBJECT_ID_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
namespace JStudio {
|
||||
namespace object {
|
||||
|
||||
|
||||
struct TIDData {
|
||||
public:
|
||||
TIDData(const void* id, u32 id_size) : mID(id), mID_size(id_size) {}
|
||||
|
||||
bool isEqual(JStudio::object::TIDData const&, JStudio::object::TIDData const&);
|
||||
inline const void* getID() const { return mID; }
|
||||
inline u32 getIDSize() const { return mID_size; }
|
||||
|
||||
private:
|
||||
/* 0x00 */ const void* mID;
|
||||
/* 0x04 */ u32 mID_size;
|
||||
};
|
||||
|
||||
struct TPRObject_ID_equal : public TIDData {
|
||||
TPRObject_ID_equal(const void* id, u32 id_size) : TIDData(id, id_size) {}
|
||||
};
|
||||
|
||||
struct TObject_ID : public TIDData {
|
||||
TObject_ID(const void* id, u32 id_size) : TIDData(id, id_size) {}
|
||||
};
|
||||
|
||||
} // namespace object
|
||||
} // namespace JStudio
|
||||
|
||||
#endif /* OBJECT_ID_H */
|
||||
@@ -0,0 +1,112 @@
|
||||
#ifndef STB_DATA_PARSE_H
|
||||
#define STB_DATA_PARSE_H
|
||||
|
||||
#include "JSystem/JGadget/binary.h"
|
||||
#include "JSystem/JStudio/JStudio/stb-data.h"
|
||||
|
||||
using namespace JGadget::binary;
|
||||
|
||||
namespace JStudio {
|
||||
namespace stb {
|
||||
namespace data {
|
||||
|
||||
// Parses a THeader
|
||||
class TParse_THeader : public TParseData_aligned<4> {
|
||||
public:
|
||||
TParse_THeader(const void* p) : TParseData_aligned<4>(p) {}
|
||||
|
||||
const THeader* get() const { return (THeader*)getRaw(); }
|
||||
const void* getContent() const { return ((THeader*)getRaw())->content; }
|
||||
const char* get_signature() const { return get()->signature; }
|
||||
u16 get_byteOrder() const { return get()->byte_order; }
|
||||
u16 get_version() const { return get()->version; }
|
||||
u32 get_blockNumber() const { return get()->block_number; }
|
||||
const THeader::Target& get_target() const { return get()->target; }
|
||||
};
|
||||
|
||||
class TParse_TBlock : public TParseData_aligned<4> {
|
||||
public:
|
||||
TParse_TBlock(const void* content) : TParseData_aligned<4>(content) {}
|
||||
|
||||
const TBlock* get() const { return (TBlock*)getRaw(); }
|
||||
const TBlock* getNext() const { return (TBlock*)((u8*)getRaw() + get_size()); }
|
||||
|
||||
u32 get_size() const { return get()->size; }
|
||||
u32 get_type() const { return get()->type; }
|
||||
const void* getContent() const { return ((char*)getRaw()) + 8;}
|
||||
};
|
||||
|
||||
class TParse_TSequence : public TParseData_aligned<4> {
|
||||
public:
|
||||
struct TData {
|
||||
/* 0x00 */ u8 type;
|
||||
/* 0x04 */ u32 param;
|
||||
/* 0x08 */ const void* content;
|
||||
/* 0x0C */ const void* next;
|
||||
};
|
||||
|
||||
TParse_TSequence(const void* content) : TParseData_aligned<4>(content) {}
|
||||
void getData(TData*) const;
|
||||
|
||||
const void* get() const { return getRaw(); }
|
||||
u32 get_head() const { return *(u32*)get(); }
|
||||
};
|
||||
|
||||
class TParse_TParagraph : public TParseData_aligned<4> {
|
||||
public:
|
||||
struct TData {
|
||||
/* 0x00 */ u32 type;
|
||||
/* 0x04 */ u32 param;
|
||||
/* 0x08 */ const void* content;
|
||||
/* 0x0C */ const void* next;
|
||||
};
|
||||
|
||||
TParse_TParagraph(const void* content) : TParseData_aligned<4>(content) {}
|
||||
void getData(TData*) const;
|
||||
};
|
||||
|
||||
struct TParse_TParagraph_data : public TParseData_aligned<4> {
|
||||
struct TData {
|
||||
/* 0x00 */ u8 status;
|
||||
/* 0x04 */ u32 dataSize;
|
||||
/* 0x08 */ u32 _8;
|
||||
/* 0x0C */ const void* fileCount;
|
||||
/* 0x10 */ const void* _10;
|
||||
};
|
||||
|
||||
TParse_TParagraph_data(const void* content) : TParseData_aligned<4>(content) {}
|
||||
void getData(TData* pData) const;
|
||||
};
|
||||
|
||||
// Parses a TObject ("demo object")
|
||||
class TParse_TBlock_object : public TParse_TBlock {
|
||||
public:
|
||||
TParse_TBlock_object(const void* content) : TParse_TBlock(content) {}
|
||||
|
||||
const TBlock_object* get() const { return (TBlock_object*)getRaw(); }
|
||||
const void* getContent() const {
|
||||
return ((TBlock_object*)getRaw())->id + align_roundUp(get_IDSize(), 4);
|
||||
}
|
||||
|
||||
u16 get_flag() const { return get()->flag; }
|
||||
u16 get_IDSize() const { return get()->id_size; }
|
||||
const void* get_ID() const { return get()->id; }
|
||||
};
|
||||
|
||||
class TParse_TParagraph_dataID : public TParseData_aligned<4> {
|
||||
public:
|
||||
TParse_TParagraph_dataID(const void* pContent) : TParseData_aligned<4>(pContent) {}
|
||||
|
||||
const TParagraph* get() const { return (TParagraph*)getRaw(); }
|
||||
u16 get_IDSize() const { return get()->id_size; }
|
||||
const void* get_ID() const { return get()->id; }
|
||||
const void* getContent() const {
|
||||
return ((TParagraph*)getRaw())->id + align_roundUp(get_IDSize(), 4);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace data
|
||||
} // namespace stb
|
||||
} // namespace JStudio
|
||||
|
||||
#endif /* STB_DATA_PARSE_H */
|
||||
@@ -0,0 +1,69 @@
|
||||
#ifndef STB_DATA_H
|
||||
#define STB_DATA_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
namespace JStudio {
|
||||
namespace stb {
|
||||
namespace data {
|
||||
|
||||
const int guBit_TSequence_type = 24;
|
||||
|
||||
const int BLOCK_SOUND = 'JSND';
|
||||
const int BLOCK_ACTOR = 'JACT';
|
||||
const int BLOCK_AMBIENTLIGHT = 'JABL';
|
||||
const int BLOCK_CAMERA = 'JCMR';
|
||||
const int BLOCK_FOG = 'JFOG';
|
||||
const int BLOCK_LIGHT = 'JLIT';
|
||||
const int BLOCK_MESSAGE = 'JMSG';
|
||||
const int BLOCK_PARTICLE = 'JPTC';
|
||||
const int BLOCK_NONE = -1;
|
||||
|
||||
// Used to expand a signed 24 int to a signed 32 int
|
||||
const u32 gu32Mask_TSequence_value_signExpansion = 0xFF000000;
|
||||
extern const u32 ga4cSignature; // 'STB/0'
|
||||
extern const s32 gauDataSize_TEParagraph_data[8];
|
||||
|
||||
inline void toString_block(char* a5c, u32 arg1) {
|
||||
// from debug, todo
|
||||
}
|
||||
|
||||
struct THeader {
|
||||
struct Target {
|
||||
/* 0x00 */ char name[8]; // "jstudio"
|
||||
/* 0x08 */ u16 _8[3];
|
||||
/* 0x0E */ u16 target_version;
|
||||
};
|
||||
|
||||
/* 0x00 */ char signature[4];
|
||||
/* 0x04 */ u16 byte_order; // must be 0xFEFF
|
||||
/* 0x06 */ u16 version; // 0-1 = obselete, 2-7 = OK
|
||||
/* 0x08 */ u32 _8;
|
||||
/* 0x0C */ u32 block_number;
|
||||
/* 0x10 */ Target target;
|
||||
/* 0x20 */ u8 content[0];
|
||||
};
|
||||
|
||||
struct TBlock {
|
||||
/* 0x0 */ u32 size;
|
||||
/* 0x4 */ u32 type; // char[4] JMSG, JSND, JACT, ...
|
||||
};
|
||||
|
||||
struct TBlock_object : TBlock {
|
||||
/* 0x8 */ u16 flag;
|
||||
/* 0xA */ u16 id_size;
|
||||
/* 0xC */ u8 id[0]; // unique identifier
|
||||
///* ??? */ u8 content[0];
|
||||
};
|
||||
|
||||
struct TParagraph {
|
||||
/* 0x0 */ u16 _0;
|
||||
/* 0x2 */ u16 id_size;
|
||||
/* 0x4 */ u8 id[0]; // unique identifier
|
||||
};
|
||||
|
||||
} // namespace data
|
||||
} // namespace stb
|
||||
} // namespace JStudio
|
||||
|
||||
#endif /* STB_DATA_H */
|
||||
@@ -0,0 +1,199 @@
|
||||
#ifndef STB_H
|
||||
#define STB_H
|
||||
|
||||
#include "JSystem/JGadget/linklist.h"
|
||||
#include "JSystem/JStudio/JStudio/object-id.h"
|
||||
#include "JSystem/JStudio/JStudio/stb-data-parse.h"
|
||||
#include "global.h"
|
||||
|
||||
namespace JStudio {
|
||||
struct TObject;
|
||||
namespace stb {
|
||||
|
||||
class TControl;
|
||||
|
||||
class TParse : public TParse_header_block {
|
||||
public:
|
||||
TParse(TControl*);
|
||||
virtual ~TParse();
|
||||
virtual bool parseHeader_next(void const**, u32*, u32);
|
||||
virtual bool parseBlock_next(void const**, u32*, u32);
|
||||
virtual bool parseHeader(data::TParse_THeader const&, u32);
|
||||
virtual bool parseBlock_block(data::TParse_TBlock const&, u32);
|
||||
virtual bool parseBlock_object(data::TParse_TBlock_object const&, u32);
|
||||
|
||||
TControl* getControl() const { return pControl; }
|
||||
|
||||
private:
|
||||
TControl* pControl;
|
||||
};
|
||||
|
||||
class TObject : public object::TObject_ID {
|
||||
public:
|
||||
enum TEStatus {
|
||||
/* 0x0 */ STATUS_STILL = 0,
|
||||
/* 0x1 */ STATUS_END = 1 << 0,
|
||||
/* 0x2 */ STATUS_WAIT = 1 << 1,
|
||||
/* 0x4 */ STATUS_SUSPEND = 1 << 2,
|
||||
/* 0x8 */ STATUS_INACTIVE = 1 << 3,
|
||||
};
|
||||
|
||||
TObject(data::TParse_TBlock_object const&);
|
||||
explicit TObject(u32, void const*, u32);
|
||||
virtual ~TObject();
|
||||
|
||||
void setFlag_operation(u8, int);
|
||||
void reset(void const*);
|
||||
u8 forward(u32);
|
||||
virtual void do_begin();
|
||||
virtual void do_end();
|
||||
virtual void do_paragraph(u32, void const*, u32);
|
||||
virtual void do_wait(u32);
|
||||
virtual void do_data(void const*, u32, void const*, u32);
|
||||
void process_sequence_();
|
||||
void process_paragraph_reserved_(u32, void const*, u32);
|
||||
|
||||
const char* toString_status(int status);
|
||||
|
||||
void on_begin() { do_begin(); }
|
||||
void on_end() { do_end(); }
|
||||
void on_paragraph(u32 arg1, const void* arg2, u32 arg3) { do_paragraph(arg1, arg2, arg3); }
|
||||
void on_wait(u32 arg1) { do_wait(arg1); }
|
||||
void on_data(const void* arg1, u32 arg2, const void* arg3, u32 arg4) {
|
||||
do_data(arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
TControl* getControl() const { return pControl; }
|
||||
void setControl_(TControl* control) { pControl = control; }
|
||||
int getSuspend() const { return _20; }
|
||||
void setSuspend(s32 val) { _20 = val; }
|
||||
bool isSuspended() const { return getSuspend() > 0; }
|
||||
void suspend(s32 val) { _20 += val; }
|
||||
const void* getSequence() const { return pSequence; }
|
||||
void setSequence_(const void* arg1) { pSequence = arg1; }
|
||||
const void* getSequence_offset(s32 i_no) const {
|
||||
int s32Val = (s32)getSequence();
|
||||
return (const void*)(s32Val + i_no);
|
||||
}
|
||||
const void* getSequence_next() const { return pSequence_next; }
|
||||
void setSequence_next(const void* seq) { pSequence_next = seq; }
|
||||
u32 getWait() const { return u32Wait_; }
|
||||
void setWait(u32 wait) { u32Wait_ = wait; }
|
||||
TEStatus getStatus() const { return mStatus; }
|
||||
void setStatus_(TEStatus status) { mStatus = status; }
|
||||
u32 toInt32FromUInt24_(u32 val) {
|
||||
if (val & 0x800000) {
|
||||
val |= data::gu32Mask_TSequence_value_signExpansion;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
void setFlag_operation_(u32 u32Data) {
|
||||
ASSERT((u32Data >> data::guBit_TSequence_type) == 0);
|
||||
setFlag_operation(u32Data >> 16, u32Data & 0xFFFF);
|
||||
}
|
||||
|
||||
/* 0x10 */ JGadget::TLinkListNode ocObject_;
|
||||
|
||||
private:
|
||||
/* 0x14 */ TControl* pControl;
|
||||
/* 0x18 */ u32 signature;
|
||||
/* 0x1C */ u16 mFlag;
|
||||
/* 0x1E */ u8 bSequence_;
|
||||
/* 0x20 */ u32 _20; // "second per frame"?
|
||||
/* 0x24 */ const void* pSequence;
|
||||
/* 0x28 */ const void* pSequence_next;
|
||||
/* 0x2C */ u32 u32Wait_;
|
||||
/* 0x30 */ TEStatus mStatus;
|
||||
};
|
||||
|
||||
class TFactory {
|
||||
public:
|
||||
TFactory() {}
|
||||
|
||||
virtual ~TFactory();
|
||||
virtual JStudio::TObject* create(data::TParse_TBlock_object const&);
|
||||
virtual void destroy(TObject*);
|
||||
};
|
||||
|
||||
class TObject_control : public TObject {
|
||||
public:
|
||||
TObject_control(void const*, u32);
|
||||
~TObject_control() {}
|
||||
};
|
||||
|
||||
// Manages TObjects
|
||||
class TControl {
|
||||
public:
|
||||
TControl();
|
||||
virtual ~TControl();
|
||||
|
||||
void appendObject(TObject*);
|
||||
void removeObject(TObject*);
|
||||
void destroyObject(TObject*);
|
||||
void destroyObject_all();
|
||||
TObject* getObject(void const*, u32);
|
||||
u8 forward(u32);
|
||||
|
||||
void setStatus_(u32 status) { mStatus = status; }
|
||||
void resetStatus_() { setStatus_(0); }
|
||||
bool isSuspended() const { return _54 > 0; }
|
||||
TFactory* getFactory() const { return pFactory; }
|
||||
void setFactory(TFactory* factory) { pFactory = factory; }
|
||||
TObject_control& referObject_control() { return mObject_control; }
|
||||
int getSuspend() const { return _54; }
|
||||
void setSuspend(s32 suspend) { mObject_control.setSuspend(suspend); }
|
||||
|
||||
private:
|
||||
/* 0x04 */ u32 _4;
|
||||
/* 0x08 */ u32 _8;
|
||||
/* 0x0C */ TFactory* pFactory;
|
||||
/* 0x10 */ JGadget::TLinkList<TObject, -12> mObjectContainer;
|
||||
/* 0x1C */ u32 mStatus;
|
||||
/* 0x20 */ TObject_control mObject_control;
|
||||
/* 0x54 */ s32 _54;
|
||||
};
|
||||
|
||||
template <int T>
|
||||
struct TParseData {
|
||||
TParseData(const void* pContent) {
|
||||
data::TParse_TParagraph_data data(pContent);
|
||||
set(data);
|
||||
}
|
||||
|
||||
void set(const data::TParse_TParagraph_data& data) {
|
||||
//data::TParse_TParagraph_data::TData* p = (data::TParse_TParagraph_data::TData*)this;
|
||||
data.getData(m_data);
|
||||
}
|
||||
|
||||
bool isEnd() const {
|
||||
return m_data->_0 == 0;
|
||||
}
|
||||
|
||||
bool empty() const {
|
||||
return m_data->_c == NULL;
|
||||
}
|
||||
|
||||
bool isValid() const {
|
||||
return !empty() && m_data->_0 == 50;
|
||||
}
|
||||
|
||||
data::TParse_TParagraph_data::TData* m_data;
|
||||
};
|
||||
|
||||
template <int T>
|
||||
struct TParseData_fixed : public TParseData<T> {
|
||||
TParseData_fixed(const void* pContent) : TParseData(pContent) {}
|
||||
|
||||
const void* getNext() const {
|
||||
return m_data->_c;
|
||||
}
|
||||
|
||||
bool isValid() const {
|
||||
return TParseData::isValid() && getNext() != NULL;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace stb
|
||||
} // namespace JStudio
|
||||
|
||||
#endif /* STB_H */
|
||||
Reference in New Issue
Block a user