Merge branch 'master' of https://github.com/isledecomp/isle into renaming

This commit is contained in:
Nathan 2023-10-25 16:38:35 -04:00
commit 4111cb7275
54 changed files with 68 additions and 58 deletions

View File

@ -19,6 +19,7 @@ ContinuationIndentWidth: 4
IncludeBlocks: Regroup IncludeBlocks: Regroup
IndentAccessModifiers: false IndentAccessModifiers: false
IndentWidth: 4 IndentWidth: 4
InsertNewlineAtEOF: true
PointerAlignment: Left PointerAlignment: Left
SpaceAfterCStyleCast: true SpaceAfterCStyleCast: true
TabWidth: 4 TabWidth: 4

View File

@ -25,7 +25,12 @@ This repository currently has only one goal: accuracy to the original executable
In general, we're not exhaustively strict about coding style, but there are some preferable guidelines to follow that have been adopted from what we know about the original codebase: In general, we're not exhaustively strict about coding style, but there are some preferable guidelines to follow that have been adopted from what we know about the original codebase:
- Indent: 2 spaces ### Formatting
We are currently using [clang-format](https://clang.llvm.org/docs/ClangFormat.html) with a configuration file that aims to replicate the code formatting employed by the original developers. There are [integrations](https://clang.llvm.org/docs/ClangFormat.html#vim-integration) available for most editors and IDEs. The required `clang-format` version is `17.x`.
### Naming conventions
- `PascalCase` for classes, function names, and enumerations. - `PascalCase` for classes, function names, and enumerations.
- `m_camelCase` for member variables. - `m_camelCase` for member variables.
- `g_camelCase` for global variables. - `g_camelCase` for global variables.

View File

@ -147,3 +147,4 @@ MxLong LegoEntity::Notify(MxParam& p)
return 0; return 0;
} }

View File

@ -42,10 +42,8 @@ class HashTableParent : public MxCore {
m_customDestructor = Destroy; m_customDestructor = Destroy;
} }
// OFFSET: LEGO1 0x100afd30
static void Destroy(T*){}; static void Destroy(T*){};
// OFFSET: LEGO1 0x100afcd0
virtual MxS8 Compare(T*, T*) = 0; virtual MxS8 Compare(T*, T*) = 0;
protected: protected:
@ -72,7 +70,6 @@ class MxHashTable : protected HashTableParent<T> {
virtual MxS8 Compare(T*, T*) = 0; virtual MxS8 Compare(T*, T*) = 0;
// OFFSET: LEGO1 0x100afdc0
virtual MxU32 Hash(T*) = 0; virtual MxU32 Hash(T*) = 0;
// FIXME: use of friend here? // FIXME: use of friend here?
@ -154,7 +151,6 @@ class MxHashTableCursor : public MxCore {
}; };
template <class T> template <class T>
// OFFSET: LEGO1 0x100b0bd0
MxHashTable<T>::~MxHashTable() MxHashTable<T>::~MxHashTable()
{ {
for (int i = 0; i < m_numSlots; i++) { for (int i = 0; i < m_numSlots; i++) {
@ -175,7 +171,6 @@ MxHashTable<T>::~MxHashTable()
} }
template <class T> template <class T>
// OFFSET: LEGO1 0x100b7ab0
inline void MxHashTable<T>::Resize() inline void MxHashTable<T>::Resize()
{ {
// Save a reference to the current table // Save a reference to the current table
@ -185,10 +180,10 @@ inline void MxHashTable<T>::Resize()
switch (m_resizeOption) { switch (m_resizeOption) {
case HASH_TABLE_OPT_EXPAND_ADD: case HASH_TABLE_OPT_EXPAND_ADD:
m_numSlots = old_size + m_increaseAmount; m_numSlots += m_increaseAmount;
break; break;
case HASH_TABLE_OPT_EXPAND_MULTIPLY: case HASH_TABLE_OPT_EXPAND_MULTIPLY:
m_numSlots = old_size * m_increaseFactor; m_numSlots *= m_increaseFactor;
break; break;
} }
@ -212,7 +207,6 @@ inline void MxHashTable<T>::Resize()
} }
template <class T> template <class T>
// OFFSET: LEGO1 0x100b7b80
inline void MxHashTable<T>::_NodeInsert(MxHashTableNode<T>* p_node) inline void MxHashTable<T>::_NodeInsert(MxHashTableNode<T>* p_node)
{ {
int bucket = p_node->m_hash % m_numSlots; int bucket = p_node->m_hash % m_numSlots;

View File

@ -21,4 +21,13 @@ class MxVariableTable : public MxHashTable<MxVariable> {
virtual MxU32 Hash(MxVariable*); // +0x18 virtual MxU32 Hash(MxVariable*); // +0x18
}; };
// OFFSET: LEGO1 0x100b0bd0 TEMPLATE
// MxHashTable<MxVariable>::~MxHashTable<MxVariable>
// OFFSET: LEGO1 0x100b7ab0 TEMPLATE
// MxHashTable<MxVariable>::Resize
// OFFSET: LEGO1 0x100b7b80 TEMPLATE
// MxHashTable<MxVariable>::_NodeInsert
#endif // MXVARIABLETABLE_H #endif // MXVARIABLETABLE_H