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
IndentAccessModifiers: false
IndentWidth: 4
InsertNewlineAtEOF: true
PointerAlignment: Left
SpaceAfterCStyleCast: true
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:
- 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.
- `m_camelCase` for member variables.
- `g_camelCase` for global variables.

View File

@ -18,4 +18,4 @@ Ambulance::Ambulance()
this->m_unk172 = 0;
this->m_unk13c = 40.0;
this->m_unk17c = 1.0;
}
}

View File

@ -4,4 +4,4 @@
CarRace::CarRace()
{
// TODO
}
}

View File

@ -5,4 +5,4 @@ extern const char* g_parseExtraTokens;
extern const char* g_strWORLD;
extern const char* g_strACTION;
#endif // DEFINE_H
#endif // DEFINE_H

View File

@ -9,4 +9,4 @@ DuneBuggy::DuneBuggy()
{
this->m_unk13c = 25.0;
this->m_unk164 = 1.0;
}
}

View File

@ -22,4 +22,4 @@ GifMapEntry* GifMap::FindNode(const char*& string)
current = current->m_left;
}
return ret;
}
}

View File

@ -66,4 +66,4 @@ class GifManager : public GifManagerBase {
undefined m_unk[0x1c];
};
#endif // GIFMANAGER_H
#endif // GIFMANAGER_H

View File

@ -8,4 +8,4 @@ Jetski::Jetski()
this->m_unk13c = 25.0;
this->m_unk150 = 2.0;
this->m_unk148 = 1;
}
}

View File

@ -4,4 +4,4 @@
JukeBox::JukeBox()
{
// TODO
}
}

View File

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

View File

@ -4,4 +4,4 @@
LegoFlcTexturePresenter::LegoFlcTexturePresenter()
{
// TODO
}
}

View File

@ -236,4 +236,4 @@ void LegoInputManager::KillTimer()
LegoOmni* omni = LegoOmni::GetInstance();
::KillTimer(omni->GetWindowHandle(), m_timer);
}
}
}

View File

@ -3,4 +3,4 @@
#include "decomp.h"
// Uncomment when member class variables are fleshed out.
// DECOMP_SIZE_ASSERT(LegoMeterPresenter, 0x94); // 0x1000a163
// DECOMP_SIZE_ASSERT(LegoMeterPresenter, 0x94); // 0x1000a163

View File

@ -224,4 +224,4 @@ float LegoNavController::CalculateNewVel(float p_targetVel, float p_currentVel,
}
return newVel;
}
}

View File

@ -164,4 +164,4 @@ void LegoPathActor::VTable0xa4()
void LegoPathActor::VTable0xa8()
{
// TODO
}
}

View File

@ -39,4 +39,4 @@ LegoFileStream* LegoFileStream::FUN_10006030(MxString p_str)
Write(data, (MxS16) fullLength);
return this;
}
}

View File

@ -43,4 +43,4 @@ struct MxAtomIdCounterCompare {
class MxAtomIdCounterSet : public set<MxAtomIdCounter*, MxAtomIdCounterCompare> {};
#endif // MXATOMIDCOUNTER_H
#endif // MXATOMIDCOUNTER_H

View File

@ -75,4 +75,4 @@ MxResult MxAudioManager::InitPresenters()
void MxAudioManager::Destroy()
{
Destroy(FALSE);
}
}

View File

@ -105,4 +105,4 @@ void MxBackgroundAudioManager::DestroyMusic()
Streamer()->Close(m_script.GetInternal());
m_musicEnabled = FALSE;
}
}
}

View File

@ -4,4 +4,4 @@
MxCompositeMediaPresenter::MxCompositeMediaPresenter()
{
// TODO
}
}

View File

@ -11,4 +11,4 @@ MxControlPresenter::MxControlPresenter()
this->m_unk52 = 0;
this->m_unk58 = 0;
this->m_unk54 = 0;
}
}

View File

@ -20,4 +20,4 @@ void MxDSActionList::Destroy(MxDSAction* p_action)
{
if (p_action)
delete p_action;
}
}

View File

@ -38,4 +38,4 @@ MxDSAction* MxDSAnim::Clone()
*clone = *this;
return clone;
}
}

View File

@ -38,4 +38,4 @@ MxDSAction* MxDSEvent::Clone()
*clone = *this;
return clone;
}
}

View File

@ -91,4 +91,4 @@ void MxDSMediaAction::CopyMediaSrcPath(const char* p_mediaSrcPath)
}
else
this->m_mediaSrcPath = NULL;
}
}

View File

@ -151,4 +151,4 @@ void MxDSMultiAction::SetAtomId(MxAtomId p_atomId)
MxDSAction* action;
while (cursor.Next(action))
action->SetAtomId(p_atomId);
}
}

View File

@ -191,4 +191,4 @@ MxDSObject* DeserializeDSObjectDispatch(char** p_source, MxS16 p_flags)
}
return obj;
}
}

View File

@ -84,4 +84,4 @@ MxLong MxDSParallelAction::GetDuration()
this->m_duration *= this->m_loopCount;
return this->m_duration;
}
}

View File

@ -129,4 +129,4 @@ void MxDSSelectAction::Deserialize(char** p_source, MxS16 p_unk24)
}
*p_source += extraFlag;
}
}

View File

@ -78,4 +78,4 @@ MxLong MxDSSerialAction::GetDuration()
}
return this->m_duration;
}
}

View File

@ -60,4 +60,4 @@ MxDSAction* MxDSSound::Clone()
*clone = *this;
return clone;
}
}

View File

@ -38,4 +38,4 @@ MxDSAction* MxDSStill::Clone()
*clone = *this;
return clone;
}
}

View File

@ -89,4 +89,4 @@ void MxDSStreamingAction::FUN_100CD2D0()
this->m_duration -= duration;
this->m_unka8 += duration;
}
}

View File

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

View File

@ -65,4 +65,4 @@ class MxMatrixData : public MxMatrix {
};
};
#endif // MXMATRIX_H
#endif // MXMATRIX_H

View File

@ -99,4 +99,4 @@ void MxMediaManager::StopPresenters()
while (cursor.Next(presenter))
presenter->EndAction();
}
}

View File

@ -36,4 +36,4 @@ void MxMIDIPresenter::DoneTickle()
if (!MusicManager()->GetMIDIInitialized()) {
this->EndAction();
}
}
}

View File

@ -143,4 +143,4 @@ MxResult MxMusicManager::Create(MxU32 p_frequencyMS, MxBool p_createThread)
m_criticalSection.Leave();
return status;
}
}

View File

@ -40,4 +40,4 @@ class MxMusicManager : public MxAudioManager {
void InitData();
};
#endif // MXMUSICMANAGER_H
#endif // MXMUSICMANAGER_H

View File

@ -186,4 +186,4 @@ MxResult MxNotificationManager::Send(MxCore* p_listener, MxNotificationParam* p_
}
return FAILURE;
}
}

View File

@ -37,4 +37,4 @@ MxBool MxRegion::vtable20()
{
// TODO
return FALSE;
}
}

View File

@ -26,4 +26,4 @@ void MxSemaphore::Wait(MxU32 p_timeoutMS)
void MxSemaphore::Release(MxU32 p_releaseCount)
{
ReleaseSemaphore(m_hSemaphore, p_releaseCount, NULL);
}
}

View File

@ -21,4 +21,4 @@ class MxSemaphore {
HANDLE m_hSemaphore;
};
#endif // MX_SEMAPHORE_H
#endif // MX_SEMAPHORE_H

View File

@ -184,4 +184,4 @@ MxStreamerSubClass1::MxStreamerSubClass1(undefined4 size)
for (int i = 0; i >= 0; i--) {
ptr[i] = 0;
}
}
}

View File

@ -96,4 +96,4 @@ MxResult MxTickleThread::Run()
Sleep(timeRemainingMS);
}
return MxThread::Run();
}
}

View File

@ -1,3 +1,3 @@
#include "mxtype17notificationparam.h"
DECOMP_SIZE_ASSERT(MxType17NotificationParam, 0x2c)
DECOMP_SIZE_ASSERT(MxType17NotificationParam, 0x2c)

View File

@ -17,4 +17,4 @@ class MxType17NotificationParam : public MxNotificationParam {
MxU16 m_unk28;
};
#endif // MXTYPE17NOTIFICATIONPARAM_H
#endif // MXTYPE17NOTIFICATIONPARAM_H

View File

@ -35,4 +35,4 @@ class MxUnkList {
MxU32 m_count;
};
#endif // MXUNKLIST_H
#endif // MXUNKLIST_H

View File

@ -21,4 +21,13 @@ class MxVariableTable : public MxHashTable<MxVariable> {
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

View File

@ -10,4 +10,4 @@ PizzaMissionStateEntry* PizzaMissionState::GetState(MxU8 id)
if (m_state[i].m_id == id)
return m_state + i;
return NULL;
}
}

View File

@ -20,4 +20,4 @@ RaceStateEntry* RaceState::GetState(MxU8 id)
if (m_state[i].m_id == id)
return m_state + i;
}
}
}

View File

@ -4,4 +4,4 @@
Radio::~Radio()
{
// TODO
}
}

View File

@ -324,4 +324,4 @@ MxBool Score::VTable0x64()
DeleteScript();
m_unkf8 = 2;
return TRUE;
}
}