mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-16 19:12:07 +03:00
feat(sound): finish implementing SI2::InitSoundKitDefs
This commit is contained in:
2 files changed
+18
-4
No files matched your search
+13
-3
@@ -3,9 +3,11 @@
|
||||
#include "sound/CVarHandlers.hpp"
|
||||
#include "sound/SESound.hpp"
|
||||
#include "sound/SOUNDKITDEF.hpp"
|
||||
#include "sound/SOUNDKITLOOKUP.hpp"
|
||||
#include "ui/FrameScript.hpp"
|
||||
|
||||
TSGrowableArray<SOUNDKITDEF*> SI2::s_SoundKitDefs;
|
||||
TSHashTable<SOUNDKITLOOKUP, HASHKEY_CONSTSTRI> SI2::s_SoundKitLookupTable;
|
||||
|
||||
int32_t SI2::Init(int32_t a1) {
|
||||
// TODO
|
||||
@@ -108,7 +110,7 @@ void SI2::InitSoundKitDefs() {
|
||||
for (uint32_t i = 0; i < g_soundEntriesDB.GetNumRecords(); i++) {
|
||||
auto soundEntriesRec = g_soundEntriesDB.GetRecordByIndex(i);
|
||||
|
||||
// Sound kit definition
|
||||
// Populate sound kit definitions
|
||||
|
||||
auto soundKitDef = STORM_NEW(SOUNDKITDEF);
|
||||
|
||||
@@ -145,6 +147,8 @@ void SI2::InitSoundKitDefs() {
|
||||
soundKitDef->fileCount++;
|
||||
}
|
||||
|
||||
// Copy relevant record fields
|
||||
|
||||
soundKitDef->flags = soundEntriesRec->m_flags;
|
||||
soundKitDef->name = soundEntriesRec->m_name;
|
||||
soundKitDef->minDistance = soundEntriesRec->m_minDistance;
|
||||
@@ -160,9 +164,15 @@ void SI2::InitSoundKitDefs() {
|
||||
|
||||
SI2::s_SoundKitDefs[soundEntriesRec->GetID()] = soundKitDef;
|
||||
|
||||
// Sound kit lookup
|
||||
// Populate sound kit lookups
|
||||
|
||||
// TODO SOUNDKITLOOKUP
|
||||
auto soundKitLookup = SI2::s_SoundKitLookupTable.Ptr(soundEntriesRec->m_name);
|
||||
|
||||
if (!soundKitLookup) {
|
||||
soundKitLookup = SI2::s_SoundKitLookupTable.New(soundEntriesRec->m_name, 0, 0x0);
|
||||
}
|
||||
|
||||
soundKitLookup->ID = soundEntriesRec->GetID();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -1,10 +1,13 @@
|
||||
#ifndef SOUND_SI2_HPP
|
||||
#define SOUND_SI2_HPP
|
||||
|
||||
#include "SOUNDKITLOOKUP.hpp"
|
||||
#include "sound/SI2Script.hpp"
|
||||
#include "storm/hash/Hashkey.hpp"
|
||||
#include "storm/hash/TSHashTable.hpp"
|
||||
#include "ui/Types.hpp"
|
||||
#include <storm/Array.hpp>
|
||||
#include <cstdint>
|
||||
#include <storm/Array.hpp>
|
||||
|
||||
class SOUNDKITDEF;
|
||||
|
||||
@@ -13,6 +16,7 @@ class SI2 {
|
||||
// Static variables
|
||||
static FrameScript_Method s_ScriptFunctions[NUM_SCRIPT_FUNCTIONS_SI2];
|
||||
static TSGrowableArray<SOUNDKITDEF*> s_SoundKitDefs;
|
||||
static TSHashTable<SOUNDKITLOOKUP, HASHKEY_CONSTSTRI> s_SoundKitLookupTable;
|
||||
|
||||
// Static functions
|
||||
static int32_t Init(int32_t a1);
|
||||
|
||||
Reference in new issue
Block a user