mirror of
https://github.com/zeldaret/tp
synced 2026-05-23 15:01:53 -04:00
ec9b03241d
Removes the strong dependency on a single header file and moves declarations to their respective header file. This allows for making dependencies explicit in cpp files and other headers, and also makes it much easier to track where everything related to a particular component is. This change also creates a few header files that previously didn't exist, making it much nicer for people implementing things, as they won't need to create the header file, it'll just be there ready to go. Ideally functions.h wouldn't even be a thing, as this header adds a lot of preprocessing overhead due to its size, and will continue to grow significantly larger over the lifespan of the project, which can also impact the performance of editors that do dependency lookups and context-aware syntax highlighting.
110 lines
3.2 KiB
C++
110 lines
3.2 KiB
C++
/* Z2SoundHandles.cpp autogenerated by split.py v0.3 at 2021-01-05 01:21:30.657620 */
|
|
|
|
#include "Z2AudioLib/Z2SoundHandles/Z2SoundHandles.h"
|
|
#include "JSystem/JAudio2/JASGenericMemPool.h"
|
|
#include "JSystem/JAudio2/JASMemPool.h"
|
|
#include "global.h"
|
|
|
|
Z2SoundHandles::Z2SoundHandles() {
|
|
mNumHandles = 0;
|
|
}
|
|
|
|
Z2SoundHandles::~Z2SoundHandles() {
|
|
deleteHandlesPool();
|
|
}
|
|
|
|
void Z2SoundHandles::initHandlesPool(u8 pNumHandles) {
|
|
mNumHandles = pNumHandles;
|
|
}
|
|
|
|
asm void Z2SoundHandles::deleteHandlesPool() {
|
|
nofralloc
|
|
#include "Z2AudioLib/Z2SoundHandles/asm/func_802AB120.s"
|
|
}
|
|
|
|
extern "C" {
|
|
// __dt__31JASMemPool<17Z2SoundHandlePool>Fv
|
|
// JASMemPool<17Z2SoundHandlePool>::~JASMemPool<17Z2SoundHandlePool>(void)
|
|
asm void JASMemPool_NS_dtor_X4_(void) {
|
|
nofralloc
|
|
#include "Z2AudioLib/Z2SoundHandles/asm/func_802AB200.s"
|
|
}
|
|
};
|
|
|
|
JAISoundHandle* Z2SoundHandles::getHandleSoundID(JAISoundID pSoundId) {
|
|
JSULink<Z2SoundHandlePool>* link;
|
|
for (link = this->getFirst(); link != NULL; link = link->getNext()) {
|
|
JAISoundHandle* handle = link->getObject();
|
|
if (handle->isSoundAttached()) {
|
|
if ((*handle)->getID() == pSoundId) {
|
|
return handle;
|
|
}
|
|
}
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
JAISoundHandle* Z2SoundHandles::getHandleUserData(u32 pUserData) {
|
|
JSULink<Z2SoundHandlePool>* link;
|
|
for (link = this->getFirst(); link != NULL; link = link->getNext()) {
|
|
JAISoundHandle* handle = link->getObject();
|
|
if (handle->isSoundAttached()) {
|
|
if ((*handle)->getUserData() == pUserData) {
|
|
return handle;
|
|
}
|
|
}
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
extern "C" {
|
|
// getFreeHandle__14Z2SoundHandlesFv
|
|
// Z2SoundHandles::getFreeHandle(void)
|
|
asm void Z2SoundHandles_NS_getFreeHandle(void) {
|
|
nofralloc
|
|
#include "Z2AudioLib/Z2SoundHandles/asm/func_802AB2D8.s"
|
|
}
|
|
|
|
// getLowPrioSound__14Z2SoundHandlesF10JAISoundID
|
|
// Z2SoundHandles::getLowPrioSound(JAISoundID)
|
|
asm void Z2SoundHandles_NS_getLowPrioSound(void) {
|
|
nofralloc
|
|
#include "Z2AudioLib/Z2SoundHandles/asm/func_802AB3D0.s"
|
|
}
|
|
};
|
|
|
|
// stopAllSounds__14Z2SoundHandlesFUl
|
|
// Z2SoundHandles::stopAllSounds(unsigned long)
|
|
void Z2SoundHandles::stopAllSounds(u32 fadeout) {
|
|
JSULink<Z2SoundHandlePool>* link;
|
|
for (link = this->getFirst(); link != NULL; link = link->getNext()) {
|
|
JAISoundHandle* handle = link->getObject();
|
|
//! @meme: explicit operator bool call required to match and be similar
|
|
//! to CHN_debug; could more concisely write handle->isSoundAttached
|
|
//! (for some reason cast-to-bool doesn't work?)
|
|
if (handle && handle->operator bool()) {
|
|
(*handle)->stop(fadeout);
|
|
}
|
|
}
|
|
}
|
|
|
|
bool Z2SoundHandles::isActive() const {
|
|
JSULink<Z2SoundHandlePool>* link;
|
|
for (link = this->getFirst(); link != NULL; link = link->getNext()) {
|
|
if (link->getObject()->isSoundAttached()) {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
// setPos__14Z2SoundHandlesFRCQ29JGeometry8TVec3<f>
|
|
// Z2SoundHandles::setPos(JGeometry::TVec3<f>)
|
|
asm void Z2SoundHandles::setPos(const JGeometry::TVec3<f32>& pos) {
|
|
nofralloc
|
|
#include "Z2AudioLib/Z2SoundHandles/asm/func_802AB538.s"
|
|
}
|