clang-format pass

Former-commit-id: 6a979e343f
This commit is contained in:
Luke Street 2022-09-18 02:05:46 -04:00
parent 41a2efa884
commit 234afca6c2
214 changed files with 2282 additions and 1957 deletions

View File

@ -21,4 +21,4 @@ private:
};
CHECK_SIZEOF(CCollidableAABox, 0x28)
#endif
#endif

View File

@ -33,4 +33,4 @@ CHECK_SIZEOF(CCollisionPrimitive, 0x10)
inline CCollisionPrimitive::~CCollisionPrimitive() {}
#endif
#endif

View File

@ -18,7 +18,8 @@ public:
CMaterialFilter(const CMaterialList& include, const CMaterialList& exclude, EFilterType type)
: include(include), exclude(exclude), type(type) {}
static CMaterialFilter MakeIncludeExclude(const CMaterialList& include, const CMaterialList& exclude) {
static CMaterialFilter MakeIncludeExclude(const CMaterialList& include,
const CMaterialList& exclude) {
return CMaterialFilter(include, exclude, kFT_IncludeExclude);
}
@ -29,4 +30,4 @@ private:
};
CHECK_SIZEOF(CMaterialFilter, 0x18)
#endif
#endif

View File

@ -113,4 +113,4 @@ private:
};
CHECK_SIZEOF(CMaterialList, 0x8)
#endif
#endif

View File

@ -24,4 +24,4 @@ private:
};
CHECK_SIZEOF(CRayCastResult, 0x30)
#endif
#endif

View File

@ -20,4 +20,4 @@ private:
u8 pad[0x14];
};
#endif
#endif

View File

@ -1,27 +1,24 @@
#ifndef __CCIRCULARBUFFER_HPP__
#define __CCIRCULARBUFFER_HPP__
#include <types.h>
class CCircularBuffer {
public:
enum EOwnership {
kOS_Owned,
kOS_NotOwned
};
enum EOwnership { kOS_Owned, kOS_NotOwned };
CCircularBuffer(void* buf, int len, EOwnership owned = kOS_NotOwned);
bool IsWrappedMemory(int offset, int len);
void* Alloc(int len);
void Free(void* ptr, int len);
int GetAllocatedAmount() const;
CCircularBuffer(void* buf, int len, EOwnership owned = kOS_NotOwned);
bool IsWrappedMemory(int offset, int len);
void* Alloc(int len);
void Free(void* ptr, int len);
int GetAllocatedAmount() const;
private:
u8 x0_owned;
void* x4_ptr;
s32 x8_bufferLen;
s32 xc_;
s32 x10_nextFreeAddr;
s32 x14_;
u8 x0_owned;
void* x4_ptr;
s32 x8_bufferLen;
s32 xc_;
s32 x10_nextFreeAddr;
s32 x14_;
};
#endif // __CCIRCULARBUFFER_HPP__

View File

@ -10,12 +10,8 @@ void Free(const void* ptr);
void* operator new(unsigned long sz, const char*, const char*);
void* operator new[](unsigned long sz, const char*, const char*);
inline void* operator new(unsigned long sz) {
return operator new(sz, "??(??)", nullptr);
}
inline void* operator new[](unsigned long sz) {
return operator new[](sz, "??(??)", nullptr);
}
inline void* operator new(unsigned long sz) { return operator new(sz, "??(??)", nullptr); }
inline void* operator new[](unsigned long sz) { return operator new[](sz, "??(??)", nullptr); }
// placement new
inline void* operator new(unsigned long n, void* ptr) { return ptr; };

View File

@ -6,14 +6,19 @@
static const int kPointerSize = sizeof(void*);
class CSmallAllocPool {
public:
CSmallAllocPool(uint len, void* mainData, void* bookKeeping);
void* FindFree(int len);
void* Alloc(uint size);
bool Free(const void* ptr);
CSmallAllocPool(uint len, void* mainData, void* bookKeeping);
void* FindFree(int len);
void* Alloc(uint size);
bool Free(const void* ptr);
private:
uint GetIndexFromPtr(const void* ptr) const { return ((const u8*)ptr - x0_mainData) / kPointerSize; }
uint GetIndexFromPtr(const void* ptr) const {
return ((const u8*)ptr - x0_mainData) / kPointerSize;
}
long GetEntryValue(uint idx) const { return (long)*((u8*)x4_bookKeeping + idx); }
u8* GetPtrFromIndex(unsigned int idx) const { return static_cast<u8*>(x0_mainData) + (idx << 3); }
u8* GetPtrFromIndex(unsigned int idx) const {
return static_cast< u8* >(x0_mainData) + (idx << 3);
}
void* x0_mainData;
void* x4_bookKeeping;
int x8_numBlocks;

View File

@ -41,10 +41,11 @@ public:
uint x4c_;
uint x50_mediumTotalAllocated;
uint x54_fakeStatics;
SMetrics(uint heapSize, uint unk1, uint unk2, uint unk3, uint unk4, uint heapSize2, uint unk5, uint unk6, uint unk7, uint unk8, uint unk9,
uint smallAllocNumAllocs, uint smallAllocAllocatedSize, uint smallAllocRemainingSize, uint mediumAllocNumAllocs,
uint mediumAllocAllocatedSize, uint mediumAllocBlocksAvailable, uint unk10, uint unk11, uint unk12, uint mediumAllocTotalAllocated,
uint fakeStatics);
SMetrics(uint heapSize, uint unk1, uint unk2, uint unk3, uint unk4, uint heapSize2, uint unk5,
uint unk6, uint unk7, uint unk8, uint unk9, uint smallAllocNumAllocs,
uint smallAllocAllocatedSize, uint smallAllocRemainingSize, uint mediumAllocNumAllocs,
uint mediumAllocAllocatedSize, uint mediumAllocBlocksAvailable, uint unk10, uint unk11,
uint unk12, uint mediumAllocTotalAllocated, uint fakeStatics);
};
struct SAllocInfo {
@ -62,10 +63,12 @@ public:
virtual bool Initialize(COsContext& ctx) = 0;
virtual void Shutdown() = 0;
virtual void* Alloc(unsigned long size, EHint hint, EScope scope, EType type, const CCallStack& cs) = 0;
virtual void* Alloc(unsigned long size, EHint hint, EScope scope, EType type,
const CCallStack& cs) = 0;
virtual void Free(const void* ptr) = 0;
virtual void ReleaseAll() = 0;
virtual void* AllocSecondary(unsigned long size, EHint hint, EScope scope, EType type, const CCallStack& cs) = 0;
virtual void* AllocSecondary(unsigned long size, EHint hint, EScope scope, EType type,
const CCallStack& cs) = 0;
virtual void FreeSecondary(const void* ptr) = 0;
virtual void ReleaseAllSecondary() = 0;
virtual void SetOutOfMemoryCallback(FOutOfMemoryCb cb, const void* data) = 0;

View File

@ -11,4 +11,4 @@ private:
// TODO
};
#endif
#endif

View File

@ -27,4 +27,4 @@ public:
static const u8 kMaxVolume;
};
#endif
#endif

View File

@ -8,4 +8,4 @@ public:
static void Initialize();
};
#endif
#endif

View File

@ -2,36 +2,33 @@
#define _g721_h
struct g72x_state {
long yl; /* Locked or steady state step size multiplier. */
short yu; /* Unlocked or non-steady state step size multiplier. */
short dms; /* Short term energy estimate. */
short dml; /* Long term energy estimate. */
short ap; /* Linear weighting coefficient of 'yl' and 'yu'. */
short a[2]; /* Coefficients of pole portion of prediction filter. */
short b[6]; /* Coefficients of zero portion of prediction filter. */
short pk[2]; /*
* Signs of previous two samples of a partially
* reconstructed signal.
*/
short dq[6]; /*
* Previous 6 samples of the quantized difference
* signal represented in an internal floating point
* format.
*/
short sr[2]; /*
* Previous 2 samples of the quantized difference
* signal represented in an internal floating point
* format.
*/
char td; /* delayed tone detect, new in 1988 version */
long yl; /* Locked or steady state step size multiplier. */
short yu; /* Unlocked or non-steady state step size multiplier. */
short dms; /* Short term energy estimate. */
short dml; /* Long term energy estimate. */
short ap; /* Linear weighting coefficient of 'yl' and 'yu'. */
short a[2]; /* Coefficients of pole portion of prediction filter. */
short b[6]; /* Coefficients of zero portion of prediction filter. */
short pk[2]; /*
* Signs of previous two samples of a partially
* reconstructed signal.
*/
short dq[6]; /*
* Previous 6 samples of the quantized difference
* signal represented in an internal floating point
* format.
*/
short sr[2]; /*
* Previous 2 samples of the quantized difference
* signal represented in an internal floating point
* format.
*/
char td; /* delayed tone detect, new in 1988 version */
};
void
g72x_init_state(struct g72x_state *state_ptr);
void g72x_init_state(struct g72x_state* state_ptr);
int
g721_decoder(int i,
struct g72x_state *state_ptr);
int g721_decoder(int i, struct g72x_state* state_ptr);
#endif

View File

@ -37,15 +37,9 @@ inline s16 FtoS(register f32 in) {
return *ptr;
}
#else
inline u8 ToUint8(f32 in) {
return static_cast<u8>(in);
}
inline f32 ToReal32(u8 in) {
return static_cast<f32>(in);
}
inline s16 FtoS(f32 in) {
return static_cast<s16>(in);
}
inline u8 ToUint8(f32 in) { return static_cast< u8 >(in); }
inline f32 ToReal32(u8 in) { return static_cast< f32 >(in); }
inline s16 FtoS(f32 in) { return static_cast< s16 >(in); }
#endif
} // namespace CCast

View File

@ -32,8 +32,12 @@ public:
}
x0_startTime = mData.GetCPUCycles();
}
inline f32 GetElapsedTime() const { return (mData.GetCPUCycles() - x0_startTime) * mData.GetTimerPeriod(); }
inline s64 GetElapsedMicros() const { return (mData.GetCPUCycles() - x0_startTime) / mData.GetTimerFreqO1M(); }
inline f32 GetElapsedTime() const {
return (mData.GetCPUCycles() - x0_startTime) * mData.GetTimerPeriod();
}
inline s64 GetElapsedMicros() const {
return (mData.GetCPUCycles() - x0_startTime) / mData.GetTimerFreqO1M();
}
private:
static CSWData mData;

View File

@ -7,9 +7,7 @@ class CARAMManager {
public:
static void Shutdown();
static void CollectGarbage();
static void PreInitializeAlloc(uint size) {
mPreInitializeAlloc += size;
}
static void PreInitializeAlloc(uint size) { mPreInitializeAlloc += size; }
static void Initialize(uint);
private:

View File

@ -4,7 +4,7 @@
class CCRC32 {
public:
static uint Calculate(const void* data, uint length);
static uint Calculate(const void* data, uint length);
};
#endif // __CCRC32_HPP__

View File

@ -3,9 +3,9 @@
#include "types.h"
#include "Kyoto/TToken.hpp"
#include "Kyoto/IObjectStore.hpp"
#include "Kyoto/Streams/CInputStream.hpp"
#include "Kyoto/TToken.hpp"
class CFactoryMgr {
public:
@ -24,6 +24,7 @@ private:
rstl::auto_ptr< CObjOwnerDerivedFromIObjUntyped > obj;
};
CFactoryFnReturn FStringTableFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& xfer);
CFactoryFnReturn FStringTableFactory(const SObjectTag& tag, CInputStream& in,
const CVParamTransfer& xfer);
#endif

View File

@ -9,4 +9,4 @@ public:
static void ShutDown();
};
#endif
#endif

View File

@ -12,7 +12,8 @@ class IFactory {
public:
virtual ~IFactory() {}
virtual CFactoryFnReturn Build(const SObjectTag&, const CVParamTransfer&, CObjectReference*) = 0;
virtual void BuildAsync(const SObjectTag&, const CVParamTransfer&, rstl::auto_ptr< IObj >*, CObjectReference*) = 0;
virtual void BuildAsync(const SObjectTag&, const CVParamTransfer&, rstl::auto_ptr< IObj >*,
CObjectReference*) = 0;
virtual void CancelBuild(const SObjectTag&) = 0;
virtual bool CanBuild(const SObjectTag&) = 0;
virtual const SObjectTag* GetResourceIdByName(const char* name) const = 0;

View File

@ -10,6 +10,7 @@ public:
CTimeProvider(const float& time);
~CTimeProvider();
float GetSecondsMod900() const { return x0_currentTime; }
private:
const float& x0_currentTime; // in seconds
bool x4_first;

View File

@ -16,4 +16,4 @@ private:
static CVector3f sViewingFrom;
};
#endif
#endif

View File

@ -88,35 +88,45 @@ public:
static void SetNumIndStages(u8 num);
static void SetChanAmbColor(EChannelId channel, const GXColor& color);
static void SetChanMatColor(EChannelId channel, const GXColor& color);
static void SetChanCtrl(EChannelId channel, GXBool enable, GXColorSrc ambSrc, GXColorSrc matSrc, GXLightID lights, GXDiffuseFn diffFn,
GXAttnFn attnFn);
static void SetChanCtrl(EChannelId channel, GXBool enable, GXColorSrc ambSrc, GXColorSrc matSrc,
GXLightID lights, GXDiffuseFn diffFn, GXAttnFn attnFn);
static void SetTevKColor(GXTevKColorID id, const GXColor& color);
static void SetTevColorIn(GXTevStageID stageId, GXTevColorArg a, GXTevColorArg b, GXTevColorArg c, GXTevColorArg d);
static void SetTevAlphaIn(GXTevStageID stageId, GXTevAlphaArg a, GXTevAlphaArg b, GXTevAlphaArg c, GXTevAlphaArg d);
static void SetTevColorOp(GXTevStageID stageId, GXTevOp op, GXTevBias bias, GXTevScale scale, GXBool clamp, GXTevRegID outReg);
static void SetTevColorIn(GXTevStageID stageId, GXTevColorArg a, GXTevColorArg b, GXTevColorArg c,
GXTevColorArg d);
static void SetTevAlphaIn(GXTevStageID stageId, GXTevAlphaArg a, GXTevAlphaArg b, GXTevAlphaArg c,
GXTevAlphaArg d);
static void SetTevColorOp(GXTevStageID stageId, GXTevOp op, GXTevBias bias, GXTevScale scale,
GXBool clamp, GXTevRegID outReg);
static void SetTevColorOp_Compressed(GXTevStageID stageId, uint flags);
static void SetTevAlphaOp(GXTevStageID stageId, GXTevOp op, GXTevBias bias, GXTevScale scale, GXBool clamp, GXTevRegID outReg);
static void SetTevAlphaOp(GXTevStageID stageId, GXTevOp op, GXTevBias bias, GXTevScale scale,
GXBool clamp, GXTevRegID outReg);
static void SetTevAlphaOp_Compressed(GXTevStageID stageId, uint flags);
static void SetTevKColorSel(GXTevStageID stageId, GXTevKColorSel sel);
static void SetTevKAlphaSel(GXTevStageID stageId, GXTevKAlphaSel sel);
static void SetTevOrder(GXTevStageID stageId, GXTexCoordID texCoord, GXTexMapID texMap, GXChannelID color);
static void SetBlendMode(GXBlendMode mode, GXBlendFactor srcFac, GXBlendFactor dstFac, GXLogicOp op);
static void SetTevOrder(GXTevStageID stageId, GXTexCoordID texCoord, GXTexMapID texMap,
GXChannelID color);
static void SetBlendMode(GXBlendMode mode, GXBlendFactor srcFac, GXBlendFactor dstFac,
GXLogicOp op);
static void SetZMode(bool compareEnable, GXCompare func, bool updateEnable);
static void SetAlphaCompare(GXCompare comp0, u8 ref0, GXAlphaOp op, GXCompare comp1, u8 ref1);
static void SetTevIndirect(GXTevStageID stageId, GXIndTexStageID indStage, GXIndTexFormat fmt, GXIndTexBiasSel biasSel,
GXIndTexMtxID mtxSel, GXIndTexWrap wrapS, GXIndTexWrap wrapT, GXBool addPrev, GXBool indLod,
static void SetTevIndirect(GXTevStageID stageId, GXIndTexStageID indStage, GXIndTexFormat fmt,
GXIndTexBiasSel biasSel, GXIndTexMtxID mtxSel, GXIndTexWrap wrapS,
GXIndTexWrap wrapT, GXBool addPrev, GXBool indLod,
GXIndTexAlphaSel alphaSel);
static void SetTevDirect(GXTevStageID stageId);
static void SetTexCoordGen(GXTexCoordID dstCoord, GXTexGenType fn, GXTexGenSrc src, GXTexMtx mtx, GXBool normalize, GXPTTexMtx postMtx);
static void SetTexCoordGen(GXTexCoordID dstCoord, GXTexGenType fn, GXTexGenSrc src, GXTexMtx mtx,
GXBool normalize, GXPTTexMtx postMtx);
static void SetArray(GXAttr attr, const void* data, u8 stride);
static void SetFog(GXFogType type, f32 startZ, f32 endZ, f32 nearZ, f32 farZ, const GXColor& color);
static void SetFog(GXFogType type, f32 startZ, f32 endZ, f32 nearZ, f32 farZ,
const GXColor& color);
static void SetLineWidth(u8 width, GXTexOffset offset);
static void SetIndTexMtxSTPointFive(GXIndTexMtxID id, s8 scaleExp);
static void SetVtxDescv_Compressed(uint flags);
static void SetVtxDesc(GXAttr attr, GXAttrType type); // name?
static void ResetVtxDescv(); // name?
static void SetVtxDescv(const GXVtxDescList* list);
static void SetStandardDirectTev_Compressed(GXTevStageID stageId, uint colorArgs, uint alphaArgs, uint colorOps, uint alphaOps);
static void SetStandardDirectTev_Compressed(GXTevStageID stageId, uint colorArgs, uint alphaArgs,
uint colorOps, uint alphaOps);
static void SetStandardTevColorAlphaOp(GXTevStageID stageId);
static void CallDisplayList(const void* ptr, size_t size);
@ -126,11 +136,12 @@ public:
static void ResetGXStatesFull(); // name?
static inline void LoadTexMtxImm(const f32 mtx[][4], unsigned long id, GXTexMtxType type) {
GXLoadTexMtxImm(const_cast<MtxPtr>(mtx), id, type);
GXLoadTexMtxImm(const_cast< MtxPtr >(mtx), id, type);
}
static GXColor GetChanAmbColor(EChannelId channel);
static void GetFog(GXFogType* fogType, f32* fogStartZ, f32* fogEndZ, f32* fogNearZ, f32* fogFarZ, GXColor* fogColor);
static void GetFog(GXFogType* fogType, f32* fogStartZ, f32* fogEndZ, f32* fogNearZ, f32* fogFarZ,
GXColor* fogColor);
static inline bool CompareGXColors(const GXColor& lhs, const GXColor& rhs) {
return *reinterpret_cast< const uint* >(&lhs) == *reinterpret_cast< const uint* >(&rhs);
@ -146,12 +157,15 @@ private:
static void update_fog(uint flags);
static void apply_fog() {
static const GXColor black = {0, 0, 0, 0};
GXSetFog(static_cast< GXFogType >(sGXState.x53_fogType), sGXState.x24c_fogParams.x0_fogStartZ, sGXState.x24c_fogParams.x4_fogEndZ,
sGXState.x24c_fogParams.x8_fogNearZ, sGXState.x24c_fogParams.xc_fogFarZ,
(sGXState.x56_blendMode & (7 << 5)) == (GX_BL_ONE << 5) ? black : sGXState.x24c_fogParams.x10_fogColor);
GXSetFog(static_cast< GXFogType >(sGXState.x53_fogType), sGXState.x24c_fogParams.x0_fogStartZ,
sGXState.x24c_fogParams.x4_fogEndZ, sGXState.x24c_fogParams.x8_fogNearZ,
sGXState.x24c_fogParams.xc_fogFarZ,
(sGXState.x56_blendMode & (7 << 5)) == (GX_BL_ONE << 5)
? black
: sGXState.x24c_fogParams.x10_fogColor);
}
static SGXState sGXState;
};
#endif
#endif

View File

@ -4,8 +4,8 @@
#include "types.h"
#include "Kyoto/Graphics/CColor.hpp"
#include "Kyoto/Math/CVector3f.hpp"
#include "Kyoto/Math/CTransform4f.hpp"
#include "Kyoto/Math/CVector3f.hpp"
#include "Kyoto/Graphics/CTevCombiners.hpp"

View File

@ -1,8 +1,6 @@
#ifndef __CLIGHT_HPP__
#define __CLIGHT_HPP__
class CLight {
};
class CLight {};
#endif // __CLIGHT_HPP__

View File

@ -24,17 +24,32 @@ public:
};
CModelFlags(ETrans trans, f32 rgba)
: x0_blendMode(trans), x1_matSetIdx(0), x2_flags(kF_DepthCompare | kF_DepthUpdate), x4_color(rgba, rgba, rgba, rgba) {}
: x0_blendMode(trans)
, x1_matSetIdx(0)
, x2_flags(kF_DepthCompare | kF_DepthUpdate)
, x4_color(rgba, rgba, rgba, rgba) {}
CModelFlags(ETrans trans, CColor color)
: x0_blendMode(trans), x1_matSetIdx(0), x2_flags(kF_DepthCompare | kF_DepthUpdate), x4_color(color) {}
: x0_blendMode(trans)
, x1_matSetIdx(0)
, x2_flags(kF_DepthCompare | kF_DepthUpdate)
, x4_color(color) {}
CModelFlags(const CModelFlags& flags, uint otherFlags)
: x0_blendMode(flags.x0_blendMode), x1_matSetIdx(flags.x1_matSetIdx), x2_flags(otherFlags), x4_color(flags.x4_color) {}
: x0_blendMode(flags.x0_blendMode)
, x1_matSetIdx(flags.x1_matSetIdx)
, x2_flags(otherFlags)
, x4_color(flags.x4_color) {}
CModelFlags(const CModelFlags& flags, bool b /* TODO what's this? */, int shaderSet)
: x0_blendMode(flags.x0_blendMode), x1_matSetIdx(shaderSet), x2_flags(flags.x2_flags), x4_color(flags.x4_color) {}
: x0_blendMode(flags.x0_blendMode)
, x1_matSetIdx(shaderSet)
, x2_flags(flags.x2_flags)
, x4_color(flags.x4_color) {}
// ?
CModelFlags(const CModelFlags& flags, ETrans trans, CColor color)
: x0_blendMode(trans), x1_matSetIdx(flags.x1_matSetIdx), x2_flags(flags.x2_flags), x4_color(color) {}
: x0_blendMode(trans)
, x1_matSetIdx(flags.x1_matSetIdx)
, x2_flags(flags.x2_flags)
, x4_color(color) {}
CModelFlags UseShaderSet(int matSet) { return CModelFlags(*this, false, matSet); }
CModelFlags DontLoadTextures() { return CModelFlags(*this, GetOtherFlags() | kF_NoTextureLock); }
@ -75,4 +90,4 @@ private:
};
CHECK_SIZEOF(CModelFlags, 0x8)
#endif
#endif

View File

@ -99,4 +99,4 @@ extern CTevCombiners::CTevPass CTevPass_805a5ebc;
// TODO move to CGraphics
extern CTevCombiners::CTevPass* PTR_skPassThru_805a8828;
#endif
#endif

View File

@ -31,4 +31,4 @@ private:
u8 pad[0x68];
};
#endif
#endif

View File

@ -32,7 +32,8 @@ public:
static inline rstl::auto_ptr< TObjOwnerDerivedFromIObj< T > > GetNewDerivedObject(T* obj) {
return new TObjOwnerDerivedFromIObj< T >(obj);
}
static inline rstl::auto_ptr< TObjOwnerDerivedFromIObj< T > > GetNewDerivedObject(const rstl::auto_ptr< T >& obj) {
static inline rstl::auto_ptr< TObjOwnerDerivedFromIObj< T > >
GetNewDerivedObject(const rstl::auto_ptr< T >& obj) {
return new TObjOwnerDerivedFromIObj< T >(obj);
}
@ -41,4 +42,4 @@ private:
TObjOwnerDerivedFromIObj(const rstl::auto_ptr< T >& obj) : CObjOwnerDerivedFromIObjUntyped(obj) {}
};
#endif
#endif

View File

@ -39,7 +39,8 @@ public:
// , x10_object(obj.release())
// , x14_params(CVParamTransfer::Null()) {}
CObjectReference(IObjectStore* store, const rstl::auto_ptr< IObj >& obj, SObjectTag tag, CVParamTransfer xfer);
CObjectReference(IObjectStore* store, const rstl::auto_ptr< IObj >& obj, SObjectTag tag,
CVParamTransfer xfer);
private:
u16 x0_refCount;
@ -51,6 +52,8 @@ private:
CVParamTransfer x14_params;
};
class CToken;
class IObjectStore {
public:
virtual CToken GetObj(const SObjectTag& tag, CVParamTransfer xfer) = 0;

View File

@ -8,6 +8,7 @@ public:
float GetRelativeValue() const { return x0_relative; }
void SetAbsoluteValue(float val) { x4_absolute = val; }
float GetAbsoluteValue() const { return x4_absolute; }
public:
float x0_relative;
float x4_absolute;

View File

@ -3,6 +3,7 @@
#include "Kyoto/Input/CControllerAxis.hpp"
#include "Kyoto/Input/CControllerButton.hpp"
#include "Kyoto/Input/InputTypes.hpp"
class CControllerGamepadData {
public:
@ -15,7 +16,9 @@ public:
const CControllerButton& GetButton(EButton button) const { return x34_buttons[button]; }
CControllerButton& GetButton(EButton button) { return x34_buttons[button]; }
const CControllerAxis& GetAnalogButton(EAnalogButton button) const { return x24_triggers[button]; }
const CControllerAxis& GetAnalogButton(EAnalogButton button) const {
return x24_triggers[button];
}
CControllerAxis& GetAnalogButton(EAnalogButton button) { return x24_triggers[button]; }
private:

View File

@ -10,16 +10,16 @@ class CDolphinController : public IController {
static const uint skTypeWavebird;
public:
CDolphinController();
virtual ~CDolphinController();
void Poll();
uint GetDeviceCount() const;
CControllerGamepadData& GetGamepadData(int controller);
uint GetControllerType(int) const;
void SetMotorState(EIOPort port, EMotorState state);
bool Initialize();
CDolphinController();
virtual ~CDolphinController();
void Poll();
uint GetDeviceCount() const;
CControllerGamepadData& GetGamepadData(int controller);
uint GetControllerType(int) const;
void SetMotorState(EIOPort port, EMotorState state);
bool Initialize();
float GetAnalogStickMaxValue(EJoyAxis axis) const;
float GetAnalogStickMaxValue(EJoyAxis axis) const;
private:
void ReadDevices();

View File

@ -20,4 +20,4 @@ private:
bool xf0_24_disabled : 1;
};
#endif
#endif

View File

@ -54,4 +54,4 @@ private:
u8 x2e_lastId;
};
#endif
#endif

View File

@ -3,28 +3,27 @@
#include <types.h>
#include "Kyoto/Input/InputTypes.hpp"
#include "Kyoto/Input/CControllerGamepadData.hpp"
#include "Kyoto/Input/InputTypes.hpp"
class COsContext;
class IController {
protected:
static const float kAbsoluteMinimum;
static const float kAbsoluteMaximum;
static const float kRelativeMinimum;
static const float kRelativeMaximum;
static const float kAbsoluteMinimum;
static const float kAbsoluteMaximum;
static const float kRelativeMinimum;
static const float kRelativeMaximum;
public:
IController();
virtual ~IController();
virtual void Poll()=0;
virtual uint GetDeviceCount() const = 0;
virtual CControllerGamepadData& GetGamepadData(int controller) = 0;
virtual uint GetControllerType(int) const = 0;
virtual void SetMotorState(EIOPort port, EMotorState state) = 0;
IController();
virtual ~IController();
virtual void Poll() = 0;
virtual uint GetDeviceCount() const = 0;
virtual CControllerGamepadData& GetGamepadData(int controller) = 0;
virtual uint GetControllerType(int) const = 0;
virtual void SetMotorState(EIOPort port, EMotorState state) = 0;
static IController* Create(const COsContext& ctx);
static IController* Create(const COsContext& ctx);
};
#endif // __ICONTROLLER_HPP__

View File

@ -16,13 +16,7 @@ enum EMotorState {
kMS_StopHard = PAD_MOTOR_STOP_HARD,
};
enum EJoyAxis {
kJA_LeftX,
kJA_LeftY,
kJA_RightX,
kJA_RightY,
kJA_MAX
};
enum EJoyAxis { kJA_LeftX, kJA_LeftY, kJA_RightX, kJA_RightY, kJA_MAX };
enum EButton {
kBU_A,
@ -40,10 +34,6 @@ enum EButton {
kBU_MAX,
};
enum EAnalogButton {
kBA_Left,
kBA_Right,
kBA_MAX
};
enum EAnalogButton { kBA_Left, kBA_Right, kBA_MAX };
#endif // __INPUTTYPES_HPP__

View File

@ -8,7 +8,7 @@ public:
CAABox() {
// TODO
}
CAABox(const CVector3f& min, const CVector3f& max);// : min(min), max(max) {}
CAABox(const CVector3f& min, const CVector3f& max); // : min(min), max(max) {}
CAABox(const CAABox& other) : min(other.min), max(other.max) {}
CVector3f ClosestPointAlongVector(const CVector3f& vec) const;

View File

@ -5,8 +5,8 @@
#include "Kyoto/Math/CVector3f.hpp"
#include "rstl/reserved_vector.hpp"
#include "rstl/optional_object.hpp"
#include "rstl/reserved_vector.hpp"
class CAABox;
class CSphere;
@ -30,4 +30,4 @@ private:
rstl::reserved_vector< CPlane, 6 > x0_planes;
};
#endif
#endif

View File

@ -17,4 +17,4 @@ private:
};
CHECK_SIZEOF(CMatrix3f, 0x24);
#endif
#endif

View File

@ -24,4 +24,4 @@ private:
};
CHECK_SIZEOF(CMatrix4f, 0x40);
#endif
#endif

View File

@ -14,4 +14,4 @@ private:
f32 z;
};
#endif
#endif

View File

@ -15,4 +15,4 @@ private:
};
CHECK_SIZEOF(CPlane, 0x10)
#endif
#endif

View File

@ -23,4 +23,4 @@ private:
static const CQuaternion sNoRotation;
};
#endif
#endif

View File

@ -27,7 +27,7 @@ public:
CVector3f GetRight() const { return CVector3f(m0.GetX(), m1.GetX(), m2.GetX()); }
CVector3f GetForward() const { return CVector3f(m0.GetY(), m1.GetY(), m2.GetY()); }
CVector3f GetUp() const { return CVector3f(m0.GetZ(), m1.GetZ(), m2.GetZ()); }
ConstMtxPtr GetCStyleMatrix() const { return reinterpret_cast<ConstMtxPtr>(this); }
ConstMtxPtr GetCStyleMatrix() const { return reinterpret_cast< ConstMtxPtr >(this); }
CMatrix3f BuildMatrix3f() const;
f32 Get00() const { return m0.GetX(); }
@ -93,7 +93,8 @@ public:
CTransform4f operator*(const CTransform4f& vec) const;
CTransform4f operator*(const CVector3f& vec) const;
static CTransform4f FromColumns(const CVector3f&, const CVector3f&, const CVector3f&, const CVector3f&);
static CTransform4f FromColumns(const CVector3f&, const CVector3f&, const CVector3f&,
const CVector3f&);
static const CTransform4f& Identity() { return sIdentity; }
private:

View File

@ -10,7 +10,7 @@ public:
f32 GetX() const { return mX; }
f32 GetY() const { return mY; }
// private:
// private:
f32 mX;
f32 mY;
};

View File

@ -9,4 +9,4 @@ private:
int y;
};
#endif
#endif

View File

@ -9,4 +9,4 @@ public:
static void ShutDown();
};
#endif
#endif

View File

@ -10,34 +10,34 @@
class CWarp;
class CParticleGen {
public:
virtual ~CParticleGen() = 0;
virtual void Update(double) = 0;
virtual void Render() const = 0;
virtual void SetOrientation(const CTransform4f& orientation) = 0;
virtual void SetTranslation(const CVector3f& translation) = 0;
virtual void SetGlobalOrientation(const CTransform4f& orientation) = 0;
virtual void SetGlobalTranslation(const CVector3f& translation) = 0;
virtual void SetGlobalScale(const CVector3f& scale) = 0;
virtual void SetLocalScale(const CVector3f& scale) = 0;
virtual void SetParticleEmission(bool emission) = 0;
virtual void SetModulationColor(const CColor& col) = 0;
virtual void SetGeneratorRate(float rate) {}
virtual CTransform4f GetOrientation() const = 0;
virtual CVector3f GetTranslation() const = 0;
virtual CTransform4f GetGlobalOrientation() const = 0;
virtual CVector3f GetGlobalTranslation() const = 0;
virtual CVector3f GetGlobalScale() const = 0;
virtual bool GetParticleEmission() const = 0;
virtual CColor GetModulationColor() const = 0;
virtual float GetGeneratorRate() const { return 1.f; }
virtual bool IsSystemDeletable() const = 0;
virtual CAABox GetBounds() const = 0;
virtual int GetParticleCOunt() const = 0;
virtual bool SystemHasLight() const = 0;
virtual CLight GetLight() = 0;
virtual void DestroyParticles() = 0;
virtual void AddModifier(CWarp*) = 0;
virtual uint Get4CharId() const = 0;
virtual ~CParticleGen() = 0;
virtual void Update(double) = 0;
virtual void Render() const = 0;
virtual void SetOrientation(const CTransform4f& orientation) = 0;
virtual void SetTranslation(const CVector3f& translation) = 0;
virtual void SetGlobalOrientation(const CTransform4f& orientation) = 0;
virtual void SetGlobalTranslation(const CVector3f& translation) = 0;
virtual void SetGlobalScale(const CVector3f& scale) = 0;
virtual void SetLocalScale(const CVector3f& scale) = 0;
virtual void SetParticleEmission(bool emission) = 0;
virtual void SetModulationColor(const CColor& col) = 0;
virtual void SetGeneratorRate(float rate) {}
virtual CTransform4f GetOrientation() const = 0;
virtual CVector3f GetTranslation() const = 0;
virtual CTransform4f GetGlobalOrientation() const = 0;
virtual CVector3f GetGlobalTranslation() const = 0;
virtual CVector3f GetGlobalScale() const = 0;
virtual bool GetParticleEmission() const = 0;
virtual CColor GetModulationColor() const = 0;
virtual float GetGeneratorRate() const { return 1.f; }
virtual bool IsSystemDeletable() const = 0;
virtual CAABox GetBounds() const = 0;
virtual int GetParticleCOunt() const = 0;
virtual bool SystemHasLight() const = 0;
virtual CLight GetLight() = 0;
virtual void DestroyParticles() = 0;
virtual void AddModifier(CWarp*) = 0;
virtual uint Get4CharId() const = 0;
};
#endif // _CPARTICLEGEN_HPP

View File

@ -27,7 +27,7 @@ public:
void Get(void* dest, unsigned long len);
template < typename T >
inline T Get(const TType<T>& type) {
inline T Get(const TType< T >& type) {
return cinput_stream_helper(type, *this);
}
@ -65,7 +65,8 @@ inline float cinput_stream_helper(const TType< float >& type, CInputStream& in)
// rstl
#include "rstl/pair.hpp"
template < typename L, typename R >
inline rstl::pair< L, R > cinput_stream_helper(const TType< rstl::pair< L, R > >& type, CInputStream& in) {
inline rstl::pair< L, R > cinput_stream_helper(const TType< rstl::pair< L, R > >& type,
CInputStream& in) {
rstl::pair< L, R > result;
result.first = in.Get(TType< L >());
result.second = in.Get(TType< R >());

View File

@ -19,4 +19,4 @@ private:
unkptr x30_zstream;
};
#endif
#endif

View File

@ -23,7 +23,8 @@ public:
static inline rstl::auto_ptr< TObjOwnerDerivedFromIObj< T > > GetIObjObjectFor(T* obj) {
return TObjOwnerDerivedFromIObj< T >::GetNewDerivedObject(obj);
}
static inline rstl::auto_ptr< TObjOwnerDerivedFromIObj< T > > GetIObjObjectFor(const rstl::auto_ptr< T >& obj) {
static inline rstl::auto_ptr< TObjOwnerDerivedFromIObj< T > >
GetIObjObjectFor(const rstl::auto_ptr< T >& obj) {
return TObjOwnerDerivedFromIObj< T >::GetNewDerivedObject(obj);
}
};
@ -45,7 +46,9 @@ class TLockedToken {
public:
TLockedToken() {}
TLockedToken(const CToken& token) : x0_token(token), x8_item(*x0_token) {}
TLockedToken(const TLockedToken< T >& token) : x0_token(token), x8_item(*token) { x0_token.Lock(); }
TLockedToken(const TLockedToken< T >& token) : x0_token(token), x8_item(*token) {
x0_token.Lock();
}
TLockedToken& operator=(const TLockedToken< T >& token) {
x0_token = token;
@ -61,4 +64,4 @@ private:
T* x8_item;
};
#endif
#endif

View File

@ -24,9 +24,7 @@ public:
CRasterFont(CInputStream&, IObjectStore*);
~CRasterFont();
void SetTexture(TToken<CTexture> token) {
x7c_texture = token;
}
void SetTexture(TToken< CTexture > token) { x7c_texture = token; }
private:
bool x0_initialized;

View File

@ -30,7 +30,8 @@ public:
virtual void AddParticleGen1();
virtual void AddParticleGen2();
virtual void AddPlaneObject();
virtual void AddDrawable(const void* obj, const CVector3f& pos, const CAABox& bounds, int mode, IRenderer::EDrawableSorting sorting);
virtual void AddDrawable(const void* obj, const CVector3f& pos, const CAABox& bounds, int mode,
IRenderer::EDrawableSorting sorting);
virtual void SetDrawableCallback();
virtual void SetWorldViewpoint();
virtual void SetPerspective1();

View File

@ -22,4 +22,4 @@ namespace Renderer {
IRenderer* AllocateRenderer(IObjectStore&, COsContext&, CMemorySys&, CResFactory&);
};
#endif
#endif

View File

@ -10,5 +10,4 @@ void EnableMetroTRKInterrupts(void);
}
#endif
#endif /* #ifndef __TRKINIT_H__ */

View File

@ -207,8 +207,9 @@ public:
kSS_Done,
};
CActor(TUniqueId uid, bool active, const rstl::string& name, const CEntityInfo& info, const CTransform4f& xf, const CModelData& mData,
const CMaterialList& list, const CActorParameters& params, TUniqueId nextDrawNode);
CActor(TUniqueId uid, bool active, const rstl::string& name, const CEntityInfo& info,
const CTransform4f& xf, const CModelData& mData, const CMaterialList& list,
const CActorParameters& params, TUniqueId nextDrawNode);
~CActor() override;
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override;
@ -221,24 +222,28 @@ public:
virtual void CalculateRenderBounds();
virtual CHealthInfo* HealthInfo(CStateManager&);
virtual const CDamageVulnerability* GetDamageVulnerability() const;
virtual const CDamageVulnerability* GetDamageVulnerability(const CVector3f&, const CVector3f&, const CDamageInfo&) const;
virtual const CDamageVulnerability* GetDamageVulnerability(const CVector3f&, const CVector3f&,
const CDamageInfo&) const;
virtual rstl::optional_object< CAABox > GetTouchBounds() const;
virtual void Touch(CActor&, CStateManager&);
virtual CVector3f GetOrbitPosition(const CStateManager&) const;
virtual CVector3f GetAimPosition(const CStateManager&, float) const;
virtual CVector3f GetHomingPosition(const CStateManager&, float) const;
virtual CVector3f GetScanObjectIndicatorPosition(const CStateManager&) const;
virtual EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&, const CWeaponMode&,
virtual EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&,
const CWeaponMode&,
int /*EProjectileAttrib?*/) const;
virtual void FluidFXThink(EFluidState, CScriptWater&, CStateManager&);
virtual void OnScanStateChange(EScanState, CStateManager&);
virtual CAABox GetSortingBounds(const CTransform4f&) const;
virtual void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt);
virtual void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type,
float dt);
SAdvancementDeltas UpdateAnimation(float dt, CStateManager& mgr, bool advTree);
void ProcessSoundEvent(int sfxId, f32 weight, int flags, f32 fallOff, f32 maxDist, u8 minVol, u8 maxVol, const CVector3f& toListener,
const CVector3f& position, int aid, CStateManager& mgr, bool translateId);
void ProcessSoundEvent(int sfxId, f32 weight, int flags, f32 fallOff, f32 maxDist, u8 minVol,
u8 maxVol, const CVector3f& toListener, const CVector3f& position, int aid,
CStateManager& mgr, bool translateId);
void UpdateSfxEmitters();
void RemoveEmitter();
@ -264,7 +269,9 @@ public:
/// ????
bool NullModel() const { return !GetAnimationData() && !GetModelData()->HasNormalModel(); }
bool HasModelData() const { return GetModelData() && (GetModelData()->HasAnimation() || GetModelData()->HasNormalModel()); }
bool HasModelData() const {
return GetModelData() && (GetModelData()->HasAnimation() || GetModelData()->HasNormalModel());
}
CModelData* ModelData() { return x64_modelData.get(); }
const CModelData* GetModelData() const { return x64_modelData.get(); }

View File

@ -85,4 +85,4 @@ private:
};
CHECK_SIZEOF(CActorLights, 0x2e0)
#endif
#endif