Files
dusklight/src/JSystem/JAudio2/JAISoundStarter.cpp
T
TakaRikka a6e76c0841 project cleanup (#2895)
* some wii OS fixes

* remove old dol2asm comments

* remove dol2asm.h

* remove function address comments

* normalize ATTRIBUTE_ALIGN usage

* DECL_WEAK macro

* fix gcc attribute weak macro

* wrap more mwcc specific things in ifdefs

* fixes

* fix revo sdk version flags

* fixes
2025-11-30 15:23:42 -07:00

29 lines
833 B
C++

#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/JAudio2/JAISoundStarter.h"
#include "JSystem/JAudio2/JAISoundHandles.h"
JAISoundStarter::JAISoundStarter(bool setInstance) :
JASGlobalInstance<JAISoundStarter>(setInstance) {}
JAISoundStarter::~JAISoundStarter() {}
bool JAISoundStarter::startLevelSound(JAISoundID id, JAISoundHandle* handlePtr, const JGeometry::TVec3<f32>* posPtr) {
JUT_ASSERT(20, handlePtr);
if (*handlePtr) {
if ((*handlePtr)->getID() == id) {
(*handlePtr)->updateLifeTime(1);
if (posPtr != NULL) {
(*handlePtr)->setPos(*posPtr);
}
return true;
}
}
bool rt = startSound(id, handlePtr, posPtr);
if (rt && *handlePtr) {
(*handlePtr)->setLifeTime(1, false);
}
return rt;
}