mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-11 05:04:40 -04:00
Merge branch 'main' into 26-02-27-allocator-isolation
This commit is contained in:
@@ -454,7 +454,7 @@ f32 Z2SpotMic::calcMicVolume(f32 param_0, int camID, f32 param_2) {
|
||||
JUT_ASSERT(687, camID >= 0);
|
||||
JUT_ASSERT(688, camID < 1);
|
||||
|
||||
if (mMicOn == NULL) {
|
||||
if (mMicOn == false) {
|
||||
return param_2;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "Z2AudioLib/Z2FxLineMgr.h"
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
#include <cstring>
|
||||
|
||||
Z2AudioArcLoader::Z2AudioArcLoader(JAUSection* section) : JAUAudioArcLoader(section) {}
|
||||
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
#include "d/dolzel.h" // IWYU pragma: keep
|
||||
|
||||
#include "Z2AudioLib/Z2AudioMgr.h"
|
||||
#include "JSystem/JAudio2/JASAiCtrl.h"
|
||||
#include "JSystem/JAudio2/JASAudioThread.h"
|
||||
#include "JSystem/JAudio2/JASDriverIF.h"
|
||||
#include "JSystem/JAudio2/JASResArcLoader.h"
|
||||
#include "JSystem/JAudio2/JASSeqParser.h"
|
||||
#include "JSystem/JAudio2/JAUInitializer.h"
|
||||
#include "JSystem/JAudio2/JAUSectionHeap.h"
|
||||
#include "JSystem/JAudio2/JAUStreamAramMgr.h"
|
||||
#include "JSystem/JAudio2/JAUSeqCollection.h"
|
||||
#include "JSystem/JAudio2/JAUStreamAramMgr.h"
|
||||
#include "JSystem/JKernel/JKRSolidHeap.h"
|
||||
#include "Z2AudioLib/Z2AudioArcLoader.h"
|
||||
#include "Z2AudioLib/Z2AudioMgr.h"
|
||||
#include "Z2AudioLib/Z2Param.h"
|
||||
#include "Z2AudioLib/Z2SoundHandles.h"
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
#include "Z2AudioLib/Z2AudioCS.h"
|
||||
#include "Z2AudioCS/Z2AudioCS.h"
|
||||
#endif
|
||||
|
||||
Z2AudioMgr* Z2AudioMgr::mAudioMgrPtr;
|
||||
@@ -105,6 +106,19 @@ void Z2AudioMgr::init(JKRSolidHeap* heap, u32 memSize, void* baaData, JKRArchive
|
||||
JASPoolAllocObject<Z2SoundHandlePool>::newMemPool(0x4e);
|
||||
OS_REPORT("[Z2AudioMgr::init]before Create Section: %d\n", heap->getFreeSize());
|
||||
|
||||
#if TARGET_PC
|
||||
// Fix a race condition with OS threading where JAUNewSectionHeap will use all the remaining
|
||||
// space in the JASDram heap before JASAudioThread has finished initializing.
|
||||
|
||||
OSLockMutex(&JASAudioThread::sThreadInitCompleteMutex);
|
||||
while (!JASAudioThread::sThreadInitComplete) {
|
||||
OSWaitCond(
|
||||
&JASAudioThread::sThreadInitCompleteCond,
|
||||
&JASAudioThread::sThreadInitCompleteMutex);
|
||||
}
|
||||
OSUnlockMutex(&JASAudioThread::sThreadInitCompleteMutex);
|
||||
#endif
|
||||
|
||||
JAUSectionHeap* sectionHeap = JAUNewSectionHeap(true);
|
||||
sectionHeap->setSeqDataArchive(seqArc);
|
||||
size_t resMaxSize = JASResArcLoader::getResMaxSize(seqArc);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Z2AudioLib/Z2Param.h"
|
||||
#include "Z2AudioLib/Z2Calc.h"
|
||||
#include "Z2AudioLib/Z2AudioMgr.h"
|
||||
#include "os_report.h"
|
||||
|
||||
static void Z2_E_sw_modPitch(Z2SoundHandlePool*, u32);
|
||||
static void Z2_E_ms_modVol(Z2SoundHandlePool*, u32);
|
||||
@@ -137,6 +138,10 @@ void Z2Creature::setSoundStarter(Z2SoundStarter* soundStarter) {
|
||||
}
|
||||
|
||||
void Z2Creature::initAnime(void* animation, bool param_1, f32 startFrame, f32 param_3) {
|
||||
#if TARGET_PC
|
||||
puts("In this house we HATE anime!!!");
|
||||
return;
|
||||
#endif
|
||||
mSoundObjAnime.initAnime(animation, param_1, startFrame, param_3);
|
||||
}
|
||||
|
||||
@@ -204,6 +209,11 @@ Z2SoundHandlePool* Z2Creature::startCreatureSoundLevel(JAISoundID soundID, u32 m
|
||||
}
|
||||
|
||||
Z2SoundHandlePool* Z2Creature::startCreatureVoice(JAISoundID soundID, s8 reverb) {
|
||||
#if TARGET_PC
|
||||
// stubbed
|
||||
return nullptr;
|
||||
#endif
|
||||
|
||||
switch (soundID) {
|
||||
case Z2SE_MDN_V_FLY_OUT:
|
||||
case Z2SE_MDN_V_MGN_TAME:
|
||||
@@ -718,11 +728,11 @@ void Z2SoundObjBeeGroup::playBeeGroupSound(JAISoundID soundID, u8 param_1) {
|
||||
Z2SoundHandlePool* handle1 = startLevelSound((u32)soundID, 0, -1);
|
||||
Z2SoundHandlePool* handle2 = startLevelSound(sound_id2, 0, -1);
|
||||
|
||||
if (handle1 != NULL && *handle1 != NULL) {
|
||||
if (handle1 != NULL && *handle1 != false) {
|
||||
f32 volume = Z2Calc::linearTransform(param_1, 1.0f, 5.0f, 0.5f, 1.0f, false);
|
||||
(*handle1)->getAuxiliary().moveVolume(volume, 0);
|
||||
}
|
||||
if (handle2 != NULL && *handle2 != NULL) {
|
||||
if (handle2 != NULL && *handle2 != false) {
|
||||
f32 volume = Z2Calc::linearTransform(param_1, 1.0f, 20.0f, 0.1f, 1.0f, false);
|
||||
(*handle2)->getAuxiliary().moveVolume(volume, 0);
|
||||
}
|
||||
@@ -924,28 +934,28 @@ Z2SoundHandlePool* Z2CreatureOI::startCreatureSoundLevel(JAISoundID soundID, u32
|
||||
f32 pitch = Z2Calc::getParamByExp(mapinfo, 0.0f, 42.0f, 0.4f, 0.9f, 1.1f,
|
||||
Z2Calc::CURVE_POSITIVE);
|
||||
|
||||
if (handle1 != NULL && *handle1 != NULL) {
|
||||
if (handle1 != NULL && *handle1 != false) {
|
||||
(*handle1)->getAuxiliary().moveVolume(volume, 0);
|
||||
(*handle1)->getAuxiliary().movePitch(pitch, 0);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (handle2 != NULL && *handle2 != NULL) {
|
||||
if (handle2 != NULL && *handle2 != false) {
|
||||
(*handle2)->getAuxiliary().moveVolume(volume, 0);
|
||||
(*handle2)->getAuxiliary().movePitch(pitch, 0);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (handle3 != NULL && *handle3 != NULL) {
|
||||
if (handle3 != NULL && *handle3 != false) {
|
||||
(*handle3)->getAuxiliary().moveVolume(volume, 0);
|
||||
(*handle3)->getAuxiliary().movePitch(pitch, 0);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (handle4 != NULL && *handle4 != NULL) {
|
||||
if (handle4 != NULL && *handle4 != false) {
|
||||
(*handle4)->getAuxiliary().moveVolume(volume, 0);
|
||||
(*handle4)->getAuxiliary().movePitch(pitch, 0);
|
||||
return handle4;
|
||||
@@ -979,7 +989,7 @@ Z2SoundHandlePool* Z2CreatureOI::startTentacleSoundLevel(JAISoundID soundID, u8
|
||||
}
|
||||
|
||||
static void Z2_E_sw_modPitch(Z2SoundHandlePool* handle, u32 mapinfo) {
|
||||
if (handle != NULL && *handle != NULL) {
|
||||
if (handle != NULL && *handle != false) {
|
||||
f32 pitch = 1.0f;
|
||||
switch (mapinfo) {
|
||||
case 1:
|
||||
@@ -994,7 +1004,7 @@ static void Z2_E_sw_modPitch(Z2SoundHandlePool* handle, u32 mapinfo) {
|
||||
}
|
||||
|
||||
static void Z2_E_ms_modVol(Z2SoundHandlePool* handle, u32 mapinfo) {
|
||||
if (handle != NULL && *handle != NULL) {
|
||||
if (handle != NULL && *handle != false) {
|
||||
f32 var_f31 = 0.2f;
|
||||
if (mapinfo == 1) {
|
||||
(*handle)->getAuxiliary().moveVolume(var_f31, 0);
|
||||
@@ -1003,7 +1013,7 @@ static void Z2_E_ms_modVol(Z2SoundHandlePool* handle, u32 mapinfo) {
|
||||
}
|
||||
|
||||
static void Z2_E_mm_modPitch(Z2SoundHandlePool* handle, u32 mapinfo) {
|
||||
if (handle != NULL && *handle != NULL) {
|
||||
if (handle != NULL && *handle != false) {
|
||||
f32 var_f31 = 0.7f;
|
||||
if (mapinfo == 3) {
|
||||
(*handle)->getAuxiliary().movePitch(var_f31, 0);
|
||||
@@ -1012,7 +1022,7 @@ static void Z2_E_mm_modPitch(Z2SoundHandlePool* handle, u32 mapinfo) {
|
||||
}
|
||||
|
||||
static void Z2_B_zan_modPitch(Z2SoundHandlePool* handle, u32 mapinfo) {
|
||||
if (handle != NULL && *handle != NULL) {
|
||||
if (handle != NULL && *handle != false) {
|
||||
f32 pitch = 1.0f;
|
||||
f32 volume = 1.0f;
|
||||
if (mapinfo > 400) {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "JSystem/JSupport/JSUMemoryStream.h"
|
||||
#include "os_report.h"
|
||||
|
||||
Z2FxLineMgr::Z2FxLineMgr() : JASGlobalInstance<Z2FxLineMgr>(true) {
|
||||
mConfig = NULL;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "d/d_com_inf_game.h"
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
#include "Z2AudioLib/Z2AudioCS.h"
|
||||
#include "Z2AudioCS/Z2AudioCS.h"
|
||||
#endif
|
||||
|
||||
void Z2CreatureLink::setLinkGroupInfo(u8) {}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "Z2AudioLib/Z2SoundObjMgr.h"
|
||||
#include "Z2AudioLib/Z2StatusMgr.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include <cstring>
|
||||
|
||||
Z2SceneMgr::Z2SceneMgr() : JASGlobalInstance<Z2SceneMgr>(true) {
|
||||
sceneNum = -1;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "Z2AudioLib/Z2Calc.h"
|
||||
#include "JSystem/JAudio2/JAISoundChild.h"
|
||||
#include "JSystem/JAudio2/JAISeq.h"
|
||||
#include "os_report.h"
|
||||
|
||||
static const char* sSpotName[] = {
|
||||
"F_SP00",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "d/d_com_inf_game.h"
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
#include "Z2AudioLib/Z2AudioCS.h"
|
||||
#include "Z2AudioCS/Z2AudioCS.h"
|
||||
#endif
|
||||
|
||||
static void dummy() {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Z2AudioLib/Z2Calc.h"
|
||||
#include "Z2AudioLib/Z2SceneMgr.h"
|
||||
#include "Z2AudioLib/Z2LinkMgr.h"
|
||||
#include <cstring>
|
||||
|
||||
Z2SoundObjMgr::Z2SoundObjMgr() : JASGlobalInstance<Z2SoundObjMgr>(true) {
|
||||
ghostEnemyState_ = 0;
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
#endif
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
#include "Z2AudioLib/Z2AudioCS.h"
|
||||
#include "Z2AudioCS/Z2AudioCS.h"
|
||||
#endif
|
||||
#include "os_report.h"
|
||||
|
||||
Z2SoundObjBase::Z2SoundObjBase()
|
||||
#if DEBUG
|
||||
@@ -164,7 +165,7 @@ Z2SoundHandlePool* Z2SoundObjBase::startLevelSound(JAISoundID soundID, u32 mapin
|
||||
if (handle != NULL) {
|
||||
soundStarter_->startSound(soundID, handle, pos_, mapinfo, fxMix,
|
||||
1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
if (handle != NULL && (*handle) != NULL) {
|
||||
if (handle != NULL && (*handle) != false) {
|
||||
(*handle)->setLifeTime(1, false);
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
@@ -210,7 +211,7 @@ Z2SoundHandlePool* Z2SoundObjBase::startCollisionSE(u32 hitID, u32 mapinfo, Z2So
|
||||
}
|
||||
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(JAISoundID(hitID), mapinfo, -1);
|
||||
if (handle != NULL && (*handle) != NULL) {
|
||||
if (handle != NULL && (*handle) != false) {
|
||||
(*handle)->setUserData(mapinfo);
|
||||
if (30 <= mapinfo && mapinfo <= 52) {
|
||||
Z2Audible* audible = (Z2Audible*)(*handle)->getAudible();
|
||||
@@ -251,7 +252,7 @@ Z2SoundHandlePool* Z2DopplerSoundObjBase::startSound(JAISoundID soundID, u32 map
|
||||
pos_ = NULL;
|
||||
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(soundID, mapinfo, reverb);
|
||||
if (pos != NULL && handle != NULL && (*handle) != NULL) {
|
||||
if (pos != NULL && handle != NULL && (*handle) != false) {
|
||||
if ((*handle)->acceptsNewAudible()) {
|
||||
(*handle)->newAudible(*pos, &field_0x20, 0, NULL);
|
||||
}
|
||||
@@ -266,7 +267,7 @@ Z2SoundHandlePool* Z2DopplerSoundObjBase::startLevelSound(JAISoundID soundID, u3
|
||||
pos_ = NULL;
|
||||
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startLevelSound(soundID, mapinfo, reverb);
|
||||
if (pos != NULL && handle != NULL && (*handle) != NULL) {
|
||||
if (pos != NULL && handle != NULL && (*handle) != false) {
|
||||
if ((*handle)->acceptsNewAudible()) {
|
||||
(*handle)->newAudible(*pos, &field_0x20, 0, NULL);
|
||||
}
|
||||
@@ -285,7 +286,7 @@ void Z2SoundObjSimple::init(Vec* posPtr, u8 handleNum) {
|
||||
Z2SoundHandlePool* Z2SoundObjSimple::startSound(JAISoundID soundID, u32 mapinfo, s8 reverb) {
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(soundID, mapinfo, reverb);
|
||||
|
||||
if (soundID == Z2SE_AL_UKI_POKOPOKO && handle != NULL && (*handle) != NULL) {
|
||||
if (soundID == Z2SE_AL_UKI_POKOPOKO && handle != NULL && (*handle) != false) {
|
||||
f32 volume = Z2Calc::getParamByExp((f32)mapinfo, 0.0f, 127.0f, 0.2f, 0.4f, 1.0f, Z2Calc::CURVE_POSITIVE);
|
||||
f32 pitch = Z2Calc::getParamByExp((f32)mapinfo, 0.0f, 127.0f, 0.2f, 0.6f, 1.2f, Z2Calc::CURVE_POSITIVE);
|
||||
(*handle)->getAuxiliary().movePitch(pitch, 0);
|
||||
@@ -298,7 +299,7 @@ Z2SoundHandlePool* Z2SoundObjSimple::startSound(JAISoundID soundID, u32 mapinfo,
|
||||
Z2SoundHandlePool* Z2SoundObjSimple::startLevelSound(JAISoundID soundID, u32 mapinfo, s8 reverb) {
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startLevelSound(soundID, mapinfo, reverb);
|
||||
|
||||
if (handle != NULL && (*handle) != NULL) {
|
||||
if (handle != NULL && (*handle) != false) {
|
||||
f32 pitch = 1.0f;
|
||||
f32 volume = 1.0f;
|
||||
switch (soundID) {
|
||||
@@ -502,7 +503,7 @@ void Z2SoundObjAnime::startSoundInner(const JGeometry::TVec3<f32>& pos, f32 para
|
||||
u32 id = getSoundID(animationSound, pos, param_1);
|
||||
if (!Z2GetSeMgr()->isSoundCulling(id)) {
|
||||
JAISoundHandle* handle = getHandleUserData(user_data);
|
||||
if (handle != NULL && (*handle) != NULL && (*handle)->getAnimationState() != 1) {
|
||||
if (handle != NULL && (*handle) != false && (*handle)->getAnimationState() != 1) {
|
||||
handle = NULL;
|
||||
}
|
||||
|
||||
@@ -514,7 +515,7 @@ void Z2SoundObjAnime::startSoundInner(const JGeometry::TVec3<f32>& pos, f32 para
|
||||
bool result = soundStarter->startSound(id, handle, &pos, mapinfo, (f32)reverb / 127.0f,
|
||||
animationSound->field_0x0c, (f32)animationSound->field_0x14 / 127.0f,
|
||||
-1.0f, -1.0f, 0);
|
||||
if ((*handle) != NULL) {
|
||||
if ((*handle) != false) {
|
||||
(*handle)->setAnimationState(1);
|
||||
(*handle)->setUserData(user_data);
|
||||
if (animationSound->setsLifeTime()) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Z2AudioLib/Z2Param.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_s_play.h"
|
||||
#include <cstring>
|
||||
|
||||
static const char* sSpotName[] = {
|
||||
"F_SP00",
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "Z2AudioLib/Z2SoundMgr.h"
|
||||
#include "Z2AudioLib/Z2Audience.h"
|
||||
#include "d/d_demo.h"
|
||||
#include "os_report.h"
|
||||
|
||||
static f32 cPitchDown = 0.8909f;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user