mirror of
https://github.com/zeldaret/ss
synced 2026-09-09 03:40:36 -04:00
change everything to use a common types file
This commit is contained in:
+17
-9
@@ -2,7 +2,7 @@
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/cLib/c_list.hpp
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
/// @brief A doubly-linked list node. See cListMg_c.
|
||||
/// @note Unofficial name.
|
||||
@@ -11,8 +11,12 @@ public:
|
||||
/// @brief Constructs a new list node.
|
||||
cListNd_c() : mpPrev(nullptr), mpNext(nullptr) {}
|
||||
|
||||
cListNd_c *getPrev() const { return mpPrev; }
|
||||
cListNd_c *getNext() const { return mpNext; }
|
||||
cListNd_c *getPrev() const {
|
||||
return mpPrev;
|
||||
}
|
||||
cListNd_c *getNext() const {
|
||||
return mpNext;
|
||||
}
|
||||
|
||||
protected:
|
||||
cListNd_c *mpPrev; ///< The previous node.
|
||||
@@ -24,8 +28,8 @@ protected:
|
||||
class cListMg_c {
|
||||
public:
|
||||
/* 802e2be0 */ cListMg_c() : mpFirst(nullptr), mpLast(nullptr) {}
|
||||
// /* 802e2880 */ ~cListMg_c();
|
||||
|
||||
// /* 802e2880 */ ~cListMg_c();
|
||||
|
||||
bool insertAfter(cListNd_c *node, cListNd_c *prevNode);
|
||||
|
||||
/**
|
||||
@@ -52,10 +56,14 @@ public:
|
||||
*/
|
||||
bool prepend(cListNd_c *node);
|
||||
|
||||
cListNd_c *getFirst() const { return mpFirst; }
|
||||
cListNd_c *getLast() const { return mpLast; }
|
||||
cListNd_c *getFirst() const {
|
||||
return mpFirst;
|
||||
}
|
||||
cListNd_c *getLast() const {
|
||||
return mpLast;
|
||||
}
|
||||
|
||||
protected:
|
||||
cListNd_c *mpFirst; ///< The first node in the list.
|
||||
cListNd_c *mpLast; ///< The last node in the list.
|
||||
};
|
||||
cListNd_c *mpLast; ///< The last node in the list.
|
||||
};
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef C_LIB_CMATH
|
||||
#define C_LIB_CMATH
|
||||
|
||||
#include <common.h>
|
||||
|
||||
namespace cM {
|
||||
static s16 atan2s(f32, f32);
|
||||
} // namespace cM
|
||||
|
||||
#endif
|
||||
+15
-8
@@ -1,20 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/cLib/c_owner_set.hpp
|
||||
// This file was ported from
|
||||
// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/cLib/c_owner_set.hpp
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
/// @file
|
||||
|
||||
/// @brief A set node with a pointer to the owning container. See cOwnerSetMg_c.
|
||||
/// @note Unofficial name.
|
||||
class cOwnerSetNd_c {
|
||||
public:
|
||||
void *getOwner() const { return mpOwner; }
|
||||
cOwnerSetNd_c *getNext() const { return mpNext; }
|
||||
void *getOwner() const {
|
||||
return mpOwner;
|
||||
}
|
||||
cOwnerSetNd_c *getNext() const {
|
||||
return mpNext;
|
||||
}
|
||||
|
||||
private:
|
||||
void* mpOwner; ///< The set that contains this node.
|
||||
cOwnerSetNd_c* mpNext; ///< The next node in the set.
|
||||
void *mpOwner; ///< The set that contains this node.
|
||||
cOwnerSetNd_c *mpNext; ///< The next node in the set.
|
||||
|
||||
friend class cOwnerSetMg_c;
|
||||
};
|
||||
@@ -28,7 +33,9 @@ public:
|
||||
cOwnerSetMg_c() : mpRoot(nullptr) {}
|
||||
|
||||
/// @brief Destroys the set.
|
||||
~cOwnerSetMg_c() { clear(); };
|
||||
~cOwnerSetMg_c() {
|
||||
clear();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Adds a node to the set.
|
||||
@@ -50,5 +57,5 @@ private:
|
||||
/// @brief Clears out the set and unlinks all child nodes.
|
||||
void clear();
|
||||
|
||||
cOwnerSetNd_c* mpRoot; ///< The first element of the set.
|
||||
cOwnerSetNd_c *mpRoot; ///< The first element of the set.
|
||||
};
|
||||
|
||||
+17
-9
@@ -2,7 +2,7 @@
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/cLib/c_tree.hpp
|
||||
|
||||
#include "types.h"
|
||||
#include <common.h>
|
||||
|
||||
/// @brief A tree node. See cTreeMg_c.
|
||||
/// @details The tree is represented as a doubly-linked LCRS tree.
|
||||
@@ -17,19 +17,27 @@ public:
|
||||
/// @brief Gets the next node in preorder traversal order, excluding the node's children.
|
||||
cTreeNd_c *getTreeNextNotChild() const;
|
||||
|
||||
cTreeNd_c *getParent() const { return mpParent; }
|
||||
cTreeNd_c *getChild() const { return mpChild; }
|
||||
cTreeNd_c *getBrPrev() const { return mpPrev; }
|
||||
cTreeNd_c *getBrNext() const { return mpNext; }
|
||||
cTreeNd_c *getParent() const {
|
||||
return mpParent;
|
||||
}
|
||||
cTreeNd_c *getChild() const {
|
||||
return mpChild;
|
||||
}
|
||||
cTreeNd_c *getBrPrev() const {
|
||||
return mpPrev;
|
||||
}
|
||||
cTreeNd_c *getBrNext() const {
|
||||
return mpNext;
|
||||
}
|
||||
|
||||
protected:
|
||||
/// @brief Clears all fields.
|
||||
void forcedClear();
|
||||
|
||||
cTreeNd_c *mpParent; ///< The parent node.
|
||||
cTreeNd_c *mpChild; ///< The child node.
|
||||
cTreeNd_c *mpPrev; ///< The previous sibling node.
|
||||
cTreeNd_c *mpNext; ///< The next sibling node.
|
||||
cTreeNd_c *mpChild; ///< The child node.
|
||||
cTreeNd_c *mpPrev; ///< The previous sibling node.
|
||||
cTreeNd_c *mpNext; ///< The next sibling node.
|
||||
|
||||
friend class cTreeMg_c;
|
||||
};
|
||||
@@ -59,4 +67,4 @@ public:
|
||||
|
||||
protected:
|
||||
cTreeNd_c *mpRootNode; ///< The root node of the tree.
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user