diff --git a/include/sead/seadBitFlag.h b/include/sead/seadBitFlag.h deleted file mode 100755 index fee3a79..0000000 --- a/include/sead/seadBitFlag.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -namespace sead -{ - template - class BitFlag - { - protected: - T mBits; // _0 - }; -}; \ No newline at end of file diff --git a/include/sead/seadDisposer.h b/include/sead/seadDisposer.h deleted file mode 100755 index 7bdcd26..0000000 --- a/include/sead/seadDisposer.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include "sead/seadListImpl.h" - -namespace sead -{ - class Heap; - - class IDisposer - { - public: - IDisposer(); - - virtual ~IDisposer(); - - enum HeapNullOption - { - UseGivenHeap = 0x0, - UseGivenOrContainedHeap = 0x1, - NoDisposerIfNoSpecifiedHeap = 0x2, - UseCurrentOrSpecifiedHeap = 0x3 - }; - - IDisposer(sead::Heap *, HeapNullOption); - - sead::Heap* mDisposerHeap; // _8 - sead::ListNode mNode; // _10 - }; -}; \ No newline at end of file diff --git a/include/sead/seadFileDevice.h b/include/sead/seadFileDevice.h deleted file mode 100755 index 58ae377..0000000 --- a/include/sead/seadFileDevice.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include "sead/seadDisposer.h" -#include "sead/seadListImpl.h" -#include "sead/seadSafeString.h" -#include "sead/seadRuntimeTypeInfo.h" - -namespace sead -{ - class ArchiveRes; - - class FileDevice : public TListNode, public IDisposer - { - SEAD_RTTI_BASE(FileDevice) - public: - - bool tryGetFileSize(unsigned int *, const sead::SafeStringBase &); - bool tryIsExistFile(bool *, const sead::SafeStringBase &); - - FixedSafeString<32> mName; - bool unk; - }; - - class ArchiveFileDevice : public FileDevice - { - SEAD_RTTI_OVERRIDE(ArchiveFileDevice, FileDevice) - public: - ArchiveFileDevice(ArchiveRes *); - - ArchiveRes* mArchiveRes; - }; -}; \ No newline at end of file diff --git a/include/sead/seadHeap.h b/include/sead/seadHeap.h deleted file mode 100755 index 454e236..0000000 --- a/include/sead/seadHeap.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include "seadDisposer.h" -#include "seadNamable.h" -#include "seadHostIO.h" - -namespace sead -{ - class Heap; - - class HeapMgr - { - public: - HeapMgr(); - - virtual ~HeapMgr(); - - Heap* getCurrentHeap(); - - static HeapMgr sInstance; - static HeapMgr* sInstancePtr; - }; - - class Heap : public IDisposer, INamable, hostio::Reflexible - { - public: - - }; -}; \ No newline at end of file diff --git a/include/sead/seadHostIO.h b/include/sead/seadHostIO.h deleted file mode 100755 index e66f9da..0000000 --- a/include/sead/seadHostIO.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -namespace sead -{ - namespace hostio - { - // all of these are unused in release builds, but used in develop / debug builds - class LifeCheckable { }; - class PropertyEventListener : public LifeCheckable { }; - class NodeEventListener : public PropertyEventListener { }; - class Reflexible : public NodeEventListener { }; - }; -}; \ No newline at end of file diff --git a/include/sead/seadListImpl.h b/include/sead/seadListImpl.h deleted file mode 100755 index 0bc57d8..0000000 --- a/include/sead/seadListImpl.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -namespace sead -{ - class ListNode - { - public: - ListNode* mPrev; // _0 - ListNode* mNext; // _8 - }; - - class ListImpl - { - public: - ListNode mStart; // _0 - int mNodeCount; // _10 - }; - - template - class TListNode; - - template - class TList : ListImpl - { - public: - TListNode* mCur; // _18 - TListNode* mNext; // _20 - }; - - template - class TListNode : ListNode - { - public: - T mData; // _10 - TList* mParentList; // _18 - }; -}; \ No newline at end of file diff --git a/include/sead/seadMatrix.h b/include/sead/seadMatrix.h deleted file mode 100755 index c21e850..0000000 --- a/include/sead/seadMatrix.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -namespace sead -{ - template - class Matrix34 - { - public: - T mMtx[3][4]; - - static const Matrix34 zero; - static const Matrix34 ident; - }; -}; \ No newline at end of file diff --git a/include/sead/seadNamable.h b/include/sead/seadNamable.h deleted file mode 100755 index 0e388ec..0000000 --- a/include/sead/seadNamable.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include "sead/seadSafeString.h" - -namespace sead -{ - class INamable - { - public: - SafeStringBase mName; // _0 - }; -}; \ No newline at end of file diff --git a/include/sead/seadQuat.h b/include/sead/seadQuat.h deleted file mode 100755 index a8ce93d..0000000 --- a/include/sead/seadQuat.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -namespace sead -{ - template - class Quat - { - public: - T x; - T y; - T z; - T w; - - static const Quat unit; - }; -}; \ No newline at end of file diff --git a/include/sead/seadResource.h b/include/sead/seadResource.h deleted file mode 100755 index a452621..0000000 --- a/include/sead/seadResource.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include "sead/seadBitFlag.h" -#include "sead/seadRuntimeTypeInfo.h" - -namespace sead -{ - class Heap; - - class Resource - { - public: - SEAD_RTTI_BASE(Resource) - - Resource(); - - virtual ~Resource(); - }; - - class DirectResource : public Resource - { - public: - SEAD_RTTI_OVERRIDE(DirectResource, Resource) - - DirectResource(); - - virtual ~DirectResource(); - virtual int getLoadDataAlignment() const; - virtual void doCreate_(unsigned char *, unsigned int, sead::Heap *); - - unsigned char* mData; // _8 - unsigned int mSize; // _10 - unsigned int mBufferSize; // _14 - sead::BitFlag mSettings; // _18 - }; - - class ArchiveRes : public DirectResource - { - public: - SEAD_RTTI_OVERRIDE(ArchiveRes, DirectResource) - }; -}; \ No newline at end of file diff --git a/include/sead/seadRuntimeTypeInfo.h b/include/sead/seadRuntimeTypeInfo.h deleted file mode 100755 index 110ad66..0000000 --- a/include/sead/seadRuntimeTypeInfo.h +++ /dev/null @@ -1,111 +0,0 @@ -#pragma once - -namespace sead -{ - namespace RuntimeTypeInfo - { - class Interface - { - public: - Interface() {} - - virtual bool isDerived(const Interface* typeInfo) const = 0; - }; - - class Root : public Interface - { - public: - Root() {} - - bool isDerived(const Interface* typeInfo) const override { return typeInfo == this; } - }; - - template - class Derive : public Interface - { - public: - Derive() {} - - bool isDerived(const Interface* typeInfo) const override - { - if (this == typeInfo) - return true; - - const RuntimeTypeInfo::Interface* rootTypeInfo = BaseType::getRuntimeTypeInfoStatic(); - return rootTypeInfo->isDerived(typeInfo); - } - }; - }; - - template - inline bool IsDerivedFrom(const Type* obj) - { - const RuntimeTypeInfo::Interface* typeInfo = DerivedType::getRuntimeTypeInfoStatic(); - return obj != nullptr && obj->checkDerivedRuntimeTypeInfo(typeInfo); - } - - template - inline DerivedType* DynamicCast(Type* obj) - { - if (IsDerivedFrom(obj)) - return static_cast(obj); - - return nullptr; - } -} - -#define SEAD_RTTI_BASE(CLASS) \ -public: \ - static const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfoStatic() \ - { \ - static const sead::RuntimeTypeInfo::Root typeInfo; \ - return &typeInfo; \ - } \ - \ - static bool checkDerivedRuntimeTypeInfoStatic( \ - const sead::RuntimeTypeInfo::Interface* typeInfo) \ - { \ - const sead::RuntimeTypeInfo::Interface* clsTypeInfo = CLASS::getRuntimeTypeInfoStatic(); \ - return typeInfo == clsTypeInfo; \ - } \ - \ - virtual bool checkDerivedRuntimeTypeInfo(const sead::RuntimeTypeInfo::Interface* typeInfo) \ - const \ - { \ - return checkDerivedRuntimeTypeInfoStatic(typeInfo); \ - } \ - \ - virtual const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfo() const \ - { \ - return getRuntimeTypeInfoStatic(); \ - } - -#define SEAD_RTTI_OVERRIDE(CLASS, BASE) \ -public: \ - static const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfoStatic() \ - { \ - static const sead::RuntimeTypeInfo::Derive typeInfo; \ - return &typeInfo; \ - } \ - \ - static bool checkDerivedRuntimeTypeInfoStatic( \ - const sead::RuntimeTypeInfo::Interface* typeInfo) \ - \ - { \ - const sead::RuntimeTypeInfo::Interface* clsTypeInfo = CLASS::getRuntimeTypeInfoStatic(); \ - if (typeInfo == clsTypeInfo) \ - return true; \ - \ - return BASE::checkDerivedRuntimeTypeInfoStatic(typeInfo); \ - } \ - \ - bool checkDerivedRuntimeTypeInfo(const sead::RuntimeTypeInfo::Interface* typeInfo) \ - const override \ - { \ - return checkDerivedRuntimeTypeInfoStatic(typeInfo); \ - } \ - \ - const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfo() const override \ - { \ - return getRuntimeTypeInfoStatic(); \ - } diff --git a/include/sead/seadSafeString.h b/include/sead/seadSafeString.h deleted file mode 100755 index 9ea7854..0000000 --- a/include/sead/seadSafeString.h +++ /dev/null @@ -1,97 +0,0 @@ -#pragma once - -namespace sead -{ - template - class SafeStringBase - { - public: - SafeStringBase(const T* pStr) : mTop(pStr) { } - virtual ~SafeStringBase(); - - virtual SafeStringBase& operator=(const SafeStringBase &); - virtual void assureTerminationImpl_() const; - - inline int calcLength() const; - - const T* cstr() const - { - assureTerminationImpl_(); - return mTop; - } - - static const T cNullChar; - static const int cMaximumLength = 0x80000; - - protected: - const T* mTop; // _8 - }; - - template - class BufferedSafeStringBase : public SafeStringBase - { - public: - __attribute__((always_inline)) - BufferedSafeStringBase(T* buf, int size) - : SafeStringBase(buf) - { - mSize = size; - - if (size <= 0) - { - this->mTop = 0; - this->mSize = 0; - } - else - { - assureTerminationImpl_(); - } - }; - - virtual ~BufferedSafeStringBase(); - - virtual BufferedSafeStringBase& operator=(const SafeStringBase &); - virtual void assureTerminationImpl_() const; - - inline int copy(const SafeStringBase& src, int copyLength = -1); - - T* getBuffer() - { - assureTerminationImpl_(); - return getMutableStringTop_(); - } - - T* getMutableStringTop_() - { - return const_cast(this->mTop); - } - - inline void clear() - { - getMutableStringTop_()[0] = this->cNullChar; - } - - int mSize; // _10 - }; - - template - class FixedSafeStringBase : public BufferedSafeStringBase - { - public: - FixedSafeStringBase(const SafeStringBase& rStr) : BufferedSafeStringBase(mStrBuffer, Len) - { - this->copy(rStr); - } - - T mStrBuffer[Len]; // _18 - }; - - template - class FixedSafeString : public FixedSafeStringBase - { - public: - FixedSafeString(const SafeStringBase &rStr) : FixedSafeStringBase(rStr) { } - - virtual ~FixedSafeString(); - }; -}; \ No newline at end of file diff --git a/include/sead/seadSafeString.hpp b/include/sead/seadSafeString.hpp deleted file mode 100755 index 6ed668e..0000000 --- a/include/sead/seadSafeString.hpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "seadSafeString.h" -#include - -namespace sead -{ - template - inline int SafeStringBase::calcLength() const - { - assureTerminationImpl_(); - int length = 0; - - for (;;) - { - if (length > cMaximumLength || mTop[length] == cNullChar) - break; - - length++; - } - - if (length > cMaximumLength) - { - return 0; - } - - return length; - } - - template - inline int BufferedSafeStringBase::copy(const SafeStringBase& src, int copyLength) - { - T* dst = getMutableStringTop_(); - const T* csrc = src.cstr(); - if (dst == csrc) - return 0; - - if (copyLength < 0) - copyLength = src.calcLength(); - - if (copyLength >= mSize) - { - copyLength = mSize - 1; - } - - std::memcpy(dst, csrc, copyLength * sizeof(T)); - dst[copyLength] = SafeStringBase::cNullChar; - - return copyLength; - } -}; \ No newline at end of file diff --git a/include/sead/seadVector.h b/include/sead/seadVector.h deleted file mode 100755 index cf7b57c..0000000 --- a/include/sead/seadVector.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -namespace sead -{ - template - class Vector2 - { - public: - T x; - T y; - }; - - template - class Vector3 - { - public: - T x; - T y; - T z; - - inline void set(T x, T y, T z) - { - this->x = x; - this->y = y; - this->z = z; - } - - static const Vector3 zero; - static const Vector3 ex; - static const Vector3 ey; - static const Vector3 ez; - static const Vector3 ones; - }; - - template - class Vector4 - { - public: - T x; - T y; - T z; - T h; - - inline void set(T x, T y, T z, T h) - { - this->x = x; - this->y = y; - this->z = z; - this->h = h; - } - }; -}; \ No newline at end of file