remove DynosOption + add a static assert to DynOS Array

(the rule is already followed, this is just for safety)
This commit is contained in:
Isaac0-dev 2026-05-22 09:41:44 +10:00
parent 690f17498d
commit ea4d8ee85f

View file

@ -211,6 +211,10 @@ private:
template <typename T>
class Array {
static_assert(
std::is_trivially_destructible_v<T>,
"DynOS Array can only be used with types that have trivial destructors."
);
public:
inline Array() : mBuffer(NULL), mCount(0), mCapacity(0) {
}
@ -654,57 +658,6 @@ struct PackData {
bool mLoaded;
};
typedef Pair<String, const u8 *> Label;
struct DynosOption : NoCopy {
String mName;
String mConfigName; // Name used in the config file
Label mLabel;
Label mTitle; // Full caps label, displayed with colored font
DynosOption *mPrev;
DynosOption *mNext;
DynosOption *mParent;
bool mDynos; // true from create, false from convert
u8 mType;
// TOGGLE
struct Toggle : NoCopy {
bool *mTog;
} mToggle;
// CHOICE
struct Choice : NoCopy {
Array<Label> mChoices;
s32 *mIndex;
} mChoice;
// SCROLL
struct Scroll : NoCopy {
s32 mMin;
s32 mMax;
s32 mStep;
s32 *mValue;
} mScroll;
// BIND
struct Bind : NoCopy {
u32 mMask;
u32 *mBinds;
s32 mIndex;
} mBind;
// BUTTON
struct Button : NoCopy {
String mFuncName;
} mButton;
// SUBMENU
struct Submenu : NoCopy {
DynosOption *mChild;
bool mEmpty;
} mSubMenu;
};
typedef bool (*DynosLoopFunc)(DynosOption *, void *);
struct LvlCmd {
u8 mType;
u8 mSize;