mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-08-12 17:39:06 +00:00
Work on CSaveUI and CSfxManager
This commit is contained in:
parent
e05d69376e
commit
b3cae0d4d5
@ -23,8 +23,8 @@ public:
|
|||||||
float x1c_distComp;
|
float x1c_distComp;
|
||||||
u32 x20_flags;
|
u32 x20_flags;
|
||||||
u16 x24_sfxId;
|
u16 x24_sfxId;
|
||||||
u8 x26_maxVol;
|
float x26_maxVol;
|
||||||
u8 x27_minVol;
|
float x27_minVol;
|
||||||
u8 x28_extra[2];
|
u8 x28_extra[2];
|
||||||
};
|
};
|
||||||
CAudioSys(boo::IAudioVoiceEngine* voiceEngine,
|
CAudioSys(boo::IAudioVoiceEngine* voiceEngine,
|
||||||
|
@ -3,7 +3,6 @@ set(AUDIO_SOURCES
|
|||||||
CAudioStateWin.hpp CAudioStateWin.cpp
|
CAudioStateWin.hpp CAudioStateWin.cpp
|
||||||
CAudioGroupSet.hpp CAudioGroupSet.cpp
|
CAudioGroupSet.hpp CAudioGroupSet.cpp
|
||||||
CSfxManager.hpp CSfxManager.cpp
|
CSfxManager.hpp CSfxManager.cpp
|
||||||
CSfxHandle.hpp CSfxHandle.cpp
|
|
||||||
CStaticAudioPlayer.hpp CStaticAudioPlayer.cpp
|
CStaticAudioPlayer.hpp CStaticAudioPlayer.cpp
|
||||||
g721.c g721.h)
|
g721.c g721.h)
|
||||||
|
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
#include "CSfxHandle.hpp"
|
|
||||||
|
|
||||||
namespace urde
|
|
||||||
{
|
|
||||||
u32 CSfxHandle::mRefCount = 0;
|
|
||||||
|
|
||||||
CSfxHandle::CSfxHandle(u32 idx)
|
|
||||||
{
|
|
||||||
x0_index = (idx & 0xFFF) | ((++mRefCount) << 14);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSfxHandle::operator =(const CSfxHandle& other)
|
|
||||||
{
|
|
||||||
if (x0_index == other.x0_index)
|
|
||||||
return;
|
|
||||||
x0_index = other.x0_index;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CSfxHandle::operator !=(const CSfxHandle& other) const
|
|
||||||
{
|
|
||||||
return x0_index != other.x0_index;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CSfxHandle::operator ==(const CSfxHandle& other) const
|
|
||||||
{
|
|
||||||
return x0_index == other.x0_index;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
#ifndef __URDE_CSFXHANDLE_HPP__
|
|
||||||
#define __URDE_CSFXHANDLE_HPP__
|
|
||||||
|
|
||||||
#include "RetroTypes.hpp"
|
|
||||||
|
|
||||||
namespace urde
|
|
||||||
{
|
|
||||||
|
|
||||||
class CSfxHandle
|
|
||||||
{
|
|
||||||
static u32 mRefCount;
|
|
||||||
u32 x0_index = 0;
|
|
||||||
public:
|
|
||||||
CSfxHandle() = default;
|
|
||||||
CSfxHandle(const CSfxHandle&) = default;
|
|
||||||
CSfxHandle(u32 idx);
|
|
||||||
|
|
||||||
void operator =(const CSfxHandle& other);
|
|
||||||
bool operator !=(const CSfxHandle& other) const;
|
|
||||||
bool operator ==(const CSfxHandle& other) const;
|
|
||||||
u32 GetIndex() const { return x0_index; }
|
|
||||||
static CSfxHandle NullHandle() { return {}; }
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __URDE_CSFXHANDLE_HPP__
|
|
@ -4,6 +4,120 @@ namespace urde
|
|||||||
{
|
{
|
||||||
std::vector<s16>* CSfxManager::mpSfxTranslationTable = nullptr;
|
std::vector<s16>* CSfxManager::mpSfxTranslationTable = nullptr;
|
||||||
|
|
||||||
|
CSfxManager::CSfxChannel CSfxManager::m_channels[4];
|
||||||
|
rstl::reserved_vector<std::shared_ptr<CSfxManager::CSfxEmitterWrapper>, 128> CSfxManager::m_emitterWrapperPool;
|
||||||
|
rstl::reserved_vector<std::shared_ptr<CSfxManager::CSfxWrapper>, 128> CSfxManager::m_wrapperPool;
|
||||||
|
CSfxManager::ESfxChannels CSfxManager::m_currentChannel;
|
||||||
|
bool CSfxManager::m_doUpdate;
|
||||||
|
void* CSfxManager::m_usedSounds;
|
||||||
|
bool CSfxManager::m_muted;
|
||||||
|
bool CSfxManager::m_auxProcessingEnabled;
|
||||||
|
float CSfxManager::m_reverbAmount = 1.f;
|
||||||
|
|
||||||
|
u16 CSfxManager::kMaxPriority;
|
||||||
|
u16 CSfxManager::kMedPriority;
|
||||||
|
u16 CSfxManager::kInternalInvalidSfxId;
|
||||||
|
u32 CSfxManager::kAllAreas;
|
||||||
|
|
||||||
|
bool CSfxManager::CSfxWrapper::IsPlaying() const
|
||||||
|
{
|
||||||
|
if (CBaseSfxWrapper::IsPlaying() && x1c_voiceHandle)
|
||||||
|
return x1c_voiceHandle->state() == amuse::VoiceState::Playing;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSfxManager::CSfxWrapper::Play()
|
||||||
|
{
|
||||||
|
x1c_voiceHandle = CAudioSys::GetAmuseEngine().fxStart(x18_sfxId, x20_vol, x22_pan);
|
||||||
|
if (x1c_voiceHandle)
|
||||||
|
{
|
||||||
|
if (CSfxManager::IsAuxProcessingEnabled() && UseAcoustics())
|
||||||
|
x1c_voiceHandle->setReverbVol(m_reverbAmount);
|
||||||
|
SetPlaying(true);
|
||||||
|
}
|
||||||
|
x24_ready = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSfxManager::CSfxWrapper::Stop()
|
||||||
|
{
|
||||||
|
if (x1c_voiceHandle)
|
||||||
|
{
|
||||||
|
x1c_voiceHandle->keyOff();
|
||||||
|
SetPlaying(false);
|
||||||
|
x1c_voiceHandle.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CSfxManager::CSfxWrapper::Ready()
|
||||||
|
{
|
||||||
|
if (IsLooped())
|
||||||
|
return true;
|
||||||
|
return x24_ready;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CSfxManager::CSfxEmitterWrapper::IsPlaying() const
|
||||||
|
{
|
||||||
|
if (IsLooped())
|
||||||
|
return CBaseSfxWrapper::IsPlaying();
|
||||||
|
if (CBaseSfxWrapper::IsPlaying() && x50_emitterHandle)
|
||||||
|
return x50_emitterHandle->getVoice()->state() == amuse::VoiceState::Playing;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSfxManager::CSfxEmitterWrapper::Play()
|
||||||
|
{
|
||||||
|
if (CSfxManager::IsAuxProcessingEnabled() && UseAcoustics())
|
||||||
|
x1a_reverb = m_reverbAmount;
|
||||||
|
else
|
||||||
|
x1a_reverb = 0.f;
|
||||||
|
|
||||||
|
x50_emitterHandle = CAudioSys::GetAmuseEngine().addEmitter(
|
||||||
|
x24_parmData.x0_pos.v, x24_parmData.xc_dir.v,
|
||||||
|
x24_parmData.x18_maxDist, x24_parmData.x1c_distComp,
|
||||||
|
x24_parmData.x24_sfxId, x24_parmData.x27_minVol,
|
||||||
|
x24_parmData.x26_maxVol);
|
||||||
|
|
||||||
|
if (x50_emitterHandle)
|
||||||
|
SetPlaying(true);
|
||||||
|
x54_ready = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSfxManager::CSfxEmitterWrapper::Stop()
|
||||||
|
{
|
||||||
|
if (x50_emitterHandle)
|
||||||
|
{
|
||||||
|
x50_emitterHandle->getVoice()->keyOff();
|
||||||
|
SetPlaying(false);
|
||||||
|
x50_emitterHandle.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CSfxManager::CSfxEmitterWrapper::Ready()
|
||||||
|
{
|
||||||
|
if (IsLooped())
|
||||||
|
return true;
|
||||||
|
return x54_ready;
|
||||||
|
}
|
||||||
|
|
||||||
|
CSfxManager::ESfxAudibility CSfxManager::CSfxEmitterWrapper::GetAudible(const zeus::CVector3f& vec)
|
||||||
|
{
|
||||||
|
float magSq = (x24_parmData.x0_pos - vec).magSquared();
|
||||||
|
float maxDist = x24_parmData.x18_maxDist * x24_parmData.x18_maxDist;
|
||||||
|
if (magSq < maxDist * 0.25f)
|
||||||
|
return ESfxAudibility::Aud3;
|
||||||
|
else if (magSq < maxDist * 0.5f)
|
||||||
|
return ESfxAudibility::Aud2;
|
||||||
|
else if (magSq < maxDist)
|
||||||
|
return ESfxAudibility::Aud1;
|
||||||
|
return ESfxAudibility::Aud0;
|
||||||
|
}
|
||||||
|
|
||||||
|
CSfxManager::CSfxManager()
|
||||||
|
{
|
||||||
|
m_emitterWrapperPool.resize(128);
|
||||||
|
m_wrapperPool.resize(128);
|
||||||
|
}
|
||||||
|
|
||||||
void CSfxManager::AddListener(ESfxChannels,
|
void CSfxManager::AddListener(ESfxChannels,
|
||||||
const zeus::CVector3f& vec1, const zeus::CVector3f& vec2,
|
const zeus::CVector3f& vec1, const zeus::CVector3f& vec2,
|
||||||
const zeus::CVector3f& right, const zeus::CVector3f& up,
|
const zeus::CVector3f& right, const zeus::CVector3f& up,
|
||||||
@ -32,14 +146,36 @@ u16 CSfxManager::TranslateSFXID(u16 id)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
CSfxHandle CSfxManager::SfxStop(const CSfxHandle& handle)
|
void CSfxManager::SfxStop(const CSfxHandle& handle)
|
||||||
{
|
{
|
||||||
return {};
|
if (handle)
|
||||||
|
handle->Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
CSfxHandle CSfxManager::SfxStart(u16 id, float vol, float pan, bool active, s16 prio, bool inArea, s32 areaId)
|
CSfxHandle CSfxManager::SfxStart(u16 id, float vol, float pan, bool useAcoustics, s16 prio, bool looped, s32 areaId)
|
||||||
{
|
{
|
||||||
return {};
|
if (m_muted || id == 0xffff)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
std::shared_ptr<CSfxWrapper>* wrapper = AllocateCSfxWrapper();
|
||||||
|
if (!wrapper)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
*wrapper = std::make_shared<CSfxWrapper>(looped, prio, id, vol, pan, useAcoustics, areaId);
|
||||||
|
return std::static_pointer_cast<CBaseSfxWrapper>(*wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<CSfxManager::CSfxWrapper>* CSfxManager::AllocateCSfxWrapper()
|
||||||
|
{
|
||||||
|
for (std::shared_ptr<CSfxWrapper>& existing : m_wrapperPool)
|
||||||
|
if (!existing || existing->Available())
|
||||||
|
return &existing;
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSfxManager::Update()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "../RetroTypes.hpp"
|
#include "../RetroTypes.hpp"
|
||||||
#include "CSfxHandle.hpp"
|
|
||||||
#include "zeus/CVector3f.hpp"
|
#include "zeus/CVector3f.hpp"
|
||||||
#include "CAudioSys.hpp"
|
#include "CAudioSys.hpp"
|
||||||
|
|
||||||
@ -14,6 +13,8 @@ class CSfxManager
|
|||||||
{
|
{
|
||||||
static std::vector<s16>* mpSfxTranslationTable;
|
static std::vector<s16>* mpSfxTranslationTable;
|
||||||
public:
|
public:
|
||||||
|
CSfxManager();
|
||||||
|
|
||||||
enum class ESfxChannels
|
enum class ESfxChannels
|
||||||
{
|
{
|
||||||
Zero,
|
Zero,
|
||||||
@ -32,57 +33,61 @@ public:
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
class CBaseSfxWrapper
|
class CBaseSfxWrapper;
|
||||||
|
using CSfxHandle = std::shared_ptr<CBaseSfxWrapper>;
|
||||||
|
|
||||||
|
class CBaseSfxWrapper : public std::enable_shared_from_this<CBaseSfxWrapper>
|
||||||
{
|
{
|
||||||
float x4_ = 15.f;
|
float x4_ = 15.f;
|
||||||
s16 x8_rank = 0;
|
s16 x8_rank = 0;
|
||||||
s16 xa_prio;
|
s16 xa_prio;
|
||||||
CSfxHandle xc_handle;
|
//CSfxHandle xc_handle;
|
||||||
TAreaId x10_area;
|
TAreaId x10_area;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
bool x14_24_useAcoustics:1;
|
bool x14_24_isActive:1;
|
||||||
bool x14_25_available:1;
|
bool x14_25_isPlaying:1;
|
||||||
bool x14_26_inArea:1;
|
bool x14_26_looped:1;
|
||||||
bool x14_27_looped:1;
|
bool x14_27_inArea:1;
|
||||||
bool x14_28_playing:1;
|
bool x14_28_available:1;
|
||||||
bool x14_29_active:1;
|
bool x14_29_useAcoustics:1;
|
||||||
};
|
};
|
||||||
u16 _dummy = 0;
|
u16 _dummy = 0;
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
virtual ~CBaseSfxWrapper() {}
|
virtual ~CBaseSfxWrapper() = default;
|
||||||
virtual void SetActive(bool v) {x14_29_active = v;}
|
virtual void SetActive(bool v) { x14_24_isActive = v; }
|
||||||
virtual void SetPlaying(bool v) {x14_28_playing = v;}
|
virtual void SetPlaying(bool v) { x14_25_isPlaying = v; }
|
||||||
virtual void SetRank(short v) {x8_rank = v;}
|
virtual void SetRank(short v) { x8_rank = v; }
|
||||||
virtual void SetInArea(bool v) {x14_26_inArea = v;}
|
virtual void SetInArea(bool v) { x14_27_inArea = v; }
|
||||||
virtual bool IsLooped() const {return x14_27_looped;}
|
virtual bool IsInArea() const { return x14_27_inArea; }
|
||||||
virtual bool IsPlaying() const {return x14_28_playing;}
|
virtual bool IsPlaying() const { return x14_25_isPlaying; }
|
||||||
virtual bool IsActive() const {return x14_29_active;}
|
virtual bool UseAcoustics() const { return x14_29_useAcoustics; }
|
||||||
virtual bool IsInArea() const {return x14_26_inArea;}
|
virtual bool IsLooped() const { return x14_26_looped; }
|
||||||
virtual bool UseAcoustics() const {return x14_24_useAcoustics;}
|
virtual bool IsActive() const { return x14_24_isActive; }
|
||||||
virtual s16 GetRank() const {return x8_rank;}
|
virtual s16 GetRank() const { return x8_rank; }
|
||||||
virtual s16 GetPriority() const {return xa_prio;}
|
virtual s16 GetPriority() const { return xa_prio; }
|
||||||
virtual TAreaId GetArea() const {return x10_area;}
|
virtual TAreaId GetArea() const { return x10_area; }
|
||||||
virtual CSfxHandle GetSfxHandle() const {return xc_handle;}
|
virtual CSfxHandle GetSfxHandle() { return shared_from_this(); }
|
||||||
virtual void Play()=0;
|
virtual void Play()=0;
|
||||||
virtual void Stop()=0;
|
virtual void Stop()=0;
|
||||||
virtual bool Ready()=0;
|
virtual bool Ready()=0;
|
||||||
virtual ESfxAudibility GetAudible(const zeus::CVector3f&)=0;
|
virtual ESfxAudibility GetAudible(const zeus::CVector3f&)=0;
|
||||||
virtual const std::shared_ptr<amuse::Voice>& GetVoice() const=0;
|
virtual const std::shared_ptr<amuse::Voice>& GetVoice() const=0;
|
||||||
|
|
||||||
void Release() {x14_25_available = true;}
|
void Release() { x14_28_available = true; }
|
||||||
bool Available() const {return x14_25_available;}
|
bool Available() const { return x14_28_available; }
|
||||||
|
|
||||||
CBaseSfxWrapper(bool looped, s16 prio, const CSfxHandle& handle, bool useAcoustics, TAreaId area)
|
CBaseSfxWrapper(bool looped, s16 prio, /*const CSfxHandle& handle,*/ bool useAcoustics, TAreaId area)
|
||||||
: x8_rank(0), xa_prio(prio), xc_handle(handle), x10_area(area), x14_24_useAcoustics(useAcoustics),
|
: x8_rank(0), xa_prio(prio), /*xc_handle(handle),*/ x10_area(area), x14_24_isActive(true), x14_25_isPlaying(false),
|
||||||
x14_26_inArea(0), x14_27_looped(looped), x14_28_playing(0), x14_29_active(0) {}
|
x14_26_looped(looped), x14_27_inArea(true), x14_28_available(false), x14_29_useAcoustics(useAcoustics) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class CSfxEmitterWrapper : public CBaseSfxWrapper
|
class CSfxEmitterWrapper : public CBaseSfxWrapper
|
||||||
{
|
{
|
||||||
|
float x1a_reverb;
|
||||||
CAudioSys::C3DEmitterParmData x24_parmData;
|
CAudioSys::C3DEmitterParmData x24_parmData;
|
||||||
std::shared_ptr<amuse::Emitter> x50_emitterHandle;
|
std::shared_ptr<amuse::Emitter> x50_emitterHandle;
|
||||||
bool x54_ready = true;
|
bool x54_ready = true;
|
||||||
@ -97,47 +102,49 @@ public:
|
|||||||
const std::shared_ptr<amuse::Emitter>& GetHandle() const { return x50_emitterHandle; }
|
const std::shared_ptr<amuse::Emitter>& GetHandle() const { return x50_emitterHandle; }
|
||||||
|
|
||||||
CSfxEmitterWrapper(bool looped, s16 prio, const CAudioSys::C3DEmitterParmData& data,
|
CSfxEmitterWrapper(bool looped, s16 prio, const CAudioSys::C3DEmitterParmData& data,
|
||||||
const CSfxHandle& handle, bool useAcoustics, TAreaId area)
|
/*const CSfxHandle& handle,*/ bool useAcoustics, TAreaId area)
|
||||||
: CBaseSfxWrapper(looped, prio, handle, useAcoustics, area), x24_parmData(data) {}
|
: CBaseSfxWrapper(looped, prio, /*handle,*/ useAcoustics, area), x24_parmData(data) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class CSfxWrapper : public CBaseSfxWrapper
|
class CSfxWrapper : public CBaseSfxWrapper
|
||||||
{
|
{
|
||||||
u16 x18_sfxId;
|
u16 x18_sfxId;
|
||||||
std::shared_ptr<amuse::Voice> x1c_voiceHandle;
|
std::shared_ptr<amuse::Voice> x1c_voiceHandle;
|
||||||
s16 x20_vol;
|
float x20_vol;
|
||||||
s16 x22_pan;
|
float x22_pan;
|
||||||
bool x24_ready = true;
|
bool x24_ready = true;
|
||||||
public:
|
public:
|
||||||
bool IsPlaying() const;
|
bool IsPlaying() const;
|
||||||
void Play();
|
void Play();
|
||||||
void Stop();
|
void Stop();
|
||||||
bool Ready();
|
bool Ready();
|
||||||
ESfxAudibility GetAudible(const zeus::CVector3f&) {return ESfxAudibility::Aud3;}
|
ESfxAudibility GetAudible(const zeus::CVector3f&) { return ESfxAudibility::Aud3; }
|
||||||
const std::shared_ptr<amuse::Voice>& GetVoice() const {return x1c_voiceHandle;}
|
const std::shared_ptr<amuse::Voice>& GetVoice() const { return x1c_voiceHandle; }
|
||||||
|
|
||||||
void SetVolume(s16 vol) {x20_vol = vol;}
|
void SetVolume(s16 vol) { x20_vol = vol; }
|
||||||
|
|
||||||
CSfxWrapper(bool looped, s16 prio, u16 sfxId, s16 vol, s16 pan,
|
CSfxWrapper(bool looped, s16 prio, u16 sfxId, float vol, float pan,
|
||||||
const CSfxHandle& handle, bool useAcoustics, TAreaId area)
|
/*const CSfxHandle& handle,*/ bool useAcoustics, TAreaId area)
|
||||||
: CBaseSfxWrapper(looped, prio, handle, useAcoustics, area),
|
: CBaseSfxWrapper(looped, prio, /*handle,*/ useAcoustics, area),
|
||||||
x18_sfxId(sfxId), x20_vol(vol), x22_pan(pan) {}
|
x18_sfxId(sfxId), x20_vol(vol), x22_pan(pan) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
static CSfxChannel m_channels[4];
|
static CSfxChannel m_channels[4];
|
||||||
static rstl::reserved_vector<CSfxEmitterWrapper, 128> m_emitterWrapperPool;
|
static rstl::reserved_vector<std::shared_ptr<CSfxEmitterWrapper>, 128> m_emitterWrapperPool;
|
||||||
static rstl::reserved_vector<CSfxWrapper, 128> m_wrapperPool;
|
static rstl::reserved_vector<std::shared_ptr<CSfxWrapper>, 128> m_wrapperPool;
|
||||||
static ESfxChannels m_currentChannel;
|
static ESfxChannels m_currentChannel;
|
||||||
static bool m_doUpdate;
|
static bool m_doUpdate;
|
||||||
static void* m_usedSounds;
|
static void* m_usedSounds;
|
||||||
static bool m_muted;
|
static bool m_muted;
|
||||||
static bool m_auxProcessingEnabled;
|
static bool m_auxProcessingEnabled;
|
||||||
|
static float m_reverbAmount;
|
||||||
|
|
||||||
static u16 kMaxPriority;
|
static u16 kMaxPriority;
|
||||||
static u16 kMedPriority;
|
static u16 kMedPriority;
|
||||||
static u16 kInternalInvalidSfxId;
|
static u16 kInternalInvalidSfxId;
|
||||||
static u32 kAllAreas;
|
static u32 kAllAreas;
|
||||||
|
|
||||||
|
static bool IsAuxProcessingEnabled() { return m_auxProcessingEnabled; }
|
||||||
static void SetChannel(ESfxChannels) {}
|
static void SetChannel(ESfxChannels) {}
|
||||||
static void KillAll(ESfxChannels) {}
|
static void KillAll(ESfxChannels) {}
|
||||||
static void TurnOnChannel(ESfxChannels) {}
|
static void TurnOnChannel(ESfxChannels) {}
|
||||||
@ -154,10 +161,17 @@ public:
|
|||||||
static void RemoveEmitter(const CSfxHandle&) {}
|
static void RemoveEmitter(const CSfxHandle&) {}
|
||||||
static void PitchBend(const CSfxHandle&, s32) {}
|
static void PitchBend(const CSfxHandle&, s32) {}
|
||||||
static u16 TranslateSFXID(u16);
|
static u16 TranslateSFXID(u16);
|
||||||
static CSfxHandle SfxStop(const CSfxHandle& handle);
|
static void SfxStop(const CSfxHandle& handle);
|
||||||
static CSfxHandle SfxStart(u16 id, float vol, float pan, bool active, s16 prio, bool inArea, s32 areaId);
|
static CSfxHandle SfxStart(u16 id, float vol, float pan, bool useAcoustics, s16 prio, bool looped, s32 areaId);
|
||||||
|
|
||||||
|
static void Update();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static std::shared_ptr<CSfxWrapper>* AllocateCSfxWrapper();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
using CSfxHandle = CSfxManager::CSfxHandle;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __URDE_CSFXMANAGER_HPP__
|
#endif // __URDE_CSFXMANAGER_HPP__
|
||||||
|
@ -22,13 +22,13 @@ CGuiTextSupport::CGuiTextSupport(ResId fontId, const CGuiTextProperties& props,
|
|||||||
|
|
||||||
CTextRenderBuffer* CGuiTextSupport::GetCurrentLineRenderBuffer() const
|
CTextRenderBuffer* CGuiTextSupport::GetCurrentLineRenderBuffer() const
|
||||||
{
|
{
|
||||||
if (x60_renderBuf && !x308_multilineFlag)
|
if (x60_renderBuf && !x308_multipageFlag)
|
||||||
return const_cast<CTextRenderBuffer*>(&*x60_renderBuf);
|
return const_cast<CTextRenderBuffer*>(&*x60_renderBuf);
|
||||||
if (!x308_multilineFlag || x300_ <= x304_lineCounter)
|
if (!x308_multipageFlag || x300_ <= x304_pageCounter)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
for (const CTextRenderBuffer& buf : x2f0_lineRenderBufs)
|
for (const CTextRenderBuffer& buf : x2f0_pageRenderBufs)
|
||||||
if (idx++ == x304_lineCounter)
|
if (idx++ == x304_pageCounter)
|
||||||
return const_cast<CTextRenderBuffer*>(&buf);
|
return const_cast<CTextRenderBuffer*>(&buf);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -192,7 +192,7 @@ void CGuiTextSupport::AddText(const std::wstring& str)
|
|||||||
ClearRenderBuffer();
|
ClearRenderBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGuiTextSupport::SetText(const std::wstring& str, bool multiline)
|
void CGuiTextSupport::SetText(const std::wstring& str, bool multipage)
|
||||||
{
|
{
|
||||||
if (x0_string.compare(str))
|
if (x0_string.compare(str))
|
||||||
{
|
{
|
||||||
@ -200,14 +200,14 @@ void CGuiTextSupport::SetText(const std::wstring& str, bool multiline)
|
|||||||
x3c_curTime = 0.f;
|
x3c_curTime = 0.f;
|
||||||
x0_string = str;
|
x0_string = str;
|
||||||
ClearRenderBuffer();
|
ClearRenderBuffer();
|
||||||
x308_multilineFlag = multiline;
|
x308_multipageFlag = multipage;
|
||||||
x304_lineCounter = 0;
|
x304_pageCounter = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGuiTextSupport::SetText(const std::string& str, bool multiline)
|
void CGuiTextSupport::SetText(const std::string& str, bool multipage)
|
||||||
{
|
{
|
||||||
SetText(hecl::UTF8ToWide(str), multiline);
|
SetText(hecl::UTF8ToWide(str), multipage);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGuiTextSupport::GetIsTextSupportFinishedLoading() const
|
bool CGuiTextSupport::GetIsTextSupportFinishedLoading() const
|
||||||
|
@ -97,10 +97,10 @@ class CGuiTextSupport
|
|||||||
zeus::CVector2f x2dc_;
|
zeus::CVector2f x2dc_;
|
||||||
zeus::CVector2f x2e4_;
|
zeus::CVector2f x2e4_;
|
||||||
|
|
||||||
std::list<CTextRenderBuffer> x2f0_lineRenderBufs;
|
std::list<CTextRenderBuffer> x2f0_pageRenderBufs;
|
||||||
u32 x300_ = 0;
|
u32 x300_ = 0;
|
||||||
u32 x304_lineCounter = 0;
|
u32 x304_pageCounter = 0;
|
||||||
bool x308_multilineFlag = false;
|
bool x308_multipageFlag = false;
|
||||||
|
|
||||||
CTextRenderBuffer* GetCurrentLineRenderBuffer() const;
|
CTextRenderBuffer* GetCurrentLineRenderBuffer() const;
|
||||||
|
|
||||||
@ -121,8 +121,8 @@ public:
|
|||||||
void SetOutlineColor(const zeus::CColor& col);
|
void SetOutlineColor(const zeus::CColor& col);
|
||||||
void SetFontColor(const zeus::CColor& col);
|
void SetFontColor(const zeus::CColor& col);
|
||||||
void AddText(const std::wstring& str);
|
void AddText(const std::wstring& str);
|
||||||
void SetText(const std::wstring& str, bool multiline=false);
|
void SetText(const std::wstring& str, bool multipage=false);
|
||||||
void SetText(const std::string& str, bool multiline=false);
|
void SetText(const std::string& str, bool multipage=false);
|
||||||
bool GetIsTextSupportFinishedLoading() const;
|
bool GetIsTextSupportFinishedLoading() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
#include "CGuiWidgetDrawParms.hpp"
|
||||||
|
|
||||||
|
namespace urde
|
||||||
|
{
|
||||||
|
CGuiWidgetDrawParms CGuiWidgetDrawParms::Default;
|
||||||
|
}
|
@ -6,10 +6,12 @@ namespace urde
|
|||||||
|
|
||||||
struct CGuiWidgetDrawParms
|
struct CGuiWidgetDrawParms
|
||||||
{
|
{
|
||||||
float x0_alphaMod;
|
float x0_alphaMod = 1.f;
|
||||||
float x4_;
|
float x4_ = 0.f;
|
||||||
float x8_;
|
float x8_ = 0.f;
|
||||||
float xc_;
|
float xc_ = 0.f;
|
||||||
|
|
||||||
|
static CGuiWidgetDrawParms Default;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -676,7 +676,7 @@ CFrontEndUI::SFusionBonusFrame::SFusionBonusFrame()
|
|||||||
|
|
||||||
bool CFrontEndUI::SFusionBonusFrame::DoUpdateWithSaveUI(float dt, CSaveUI* saveUi)
|
bool CFrontEndUI::SFusionBonusFrame::DoUpdateWithSaveUI(float dt, CSaveUI* saveUi)
|
||||||
{
|
{
|
||||||
bool flag = (saveUi && saveUi->GetUIType() != CSaveUI::UIType::Sixteen) ? false : true;
|
bool flag = (saveUi && saveUi->GetUIType() != CSaveUI::UIType::SaveProgress) ? false : true;
|
||||||
x10_remTime = std::max(x10_remTime - dt, 0.f);
|
x10_remTime = std::max(x10_remTime - dt, 0.f);
|
||||||
|
|
||||||
zeus::CColor geomCol(zeus::CColor::skWhite);
|
zeus::CColor geomCol(zeus::CColor::skWhite);
|
||||||
|
@ -194,7 +194,7 @@ public:
|
|||||||
return v >= EState::CardMount && v <= EState::CardFormat;
|
return v >= EState::CardMount && v <= EState::CardFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsOperationDestructive(EState v)
|
static bool IsCardWriting(EState v)
|
||||||
{
|
{
|
||||||
if (v < EState::CardProbe)
|
if (v < EState::CardProbe)
|
||||||
return false;
|
return false;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "GuiSys/CGuiTableGroup.hpp"
|
#include "GuiSys/CGuiTableGroup.hpp"
|
||||||
#include "GuiSys/CGuiTextPane.hpp"
|
#include "GuiSys/CGuiTextPane.hpp"
|
||||||
#include "GuiSys/CGuiWidgetDrawParms.hpp"
|
#include "GuiSys/CGuiWidgetDrawParms.hpp"
|
||||||
|
#include "Audio/CSfxManager.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
@ -22,8 +23,8 @@ void CSaveUI::ResetCardDriver()
|
|||||||
bool importState = (x0_instIdx == 0 && !x90_needsDriverReset);
|
bool importState = (x0_instIdx == 0 && !x90_needsDriverReset);
|
||||||
x6c_cardDriver = ConstructCardDriver(importState);
|
x6c_cardDriver = ConstructCardDriver(importState);
|
||||||
x6c_cardDriver->StartCardProbe();
|
x6c_cardDriver->StartCardProbe();
|
||||||
x10_uiType = UIType::Zero;
|
x10_uiType = UIType::Empty;
|
||||||
FinishedLoading();
|
SetUIText();
|
||||||
}
|
}
|
||||||
|
|
||||||
CIOWin::EMessageReturn CSaveUI::Update(float dt)
|
CIOWin::EMessageReturn CSaveUI::Update(float dt)
|
||||||
@ -44,14 +45,14 @@ CIOWin::EMessageReturn CSaveUI::Update(float dt)
|
|||||||
else
|
else
|
||||||
x80_iowRet = CIOWin::EMessageReturn::Exit;
|
x80_iowRet = CIOWin::EMessageReturn::Exit;
|
||||||
}
|
}
|
||||||
else if (x6c_cardDriver->x10_state == EState::CardCheckDone && x10_uiType != UIType::Fourteen)
|
else if (x6c_cardDriver->x10_state == EState::CardCheckDone && x10_uiType != UIType::NotOriginalCard)
|
||||||
{
|
{
|
||||||
if (x6c_cardDriver->x28_cardSerial && x8_serial)
|
if (x6c_cardDriver->x28_cardSerial != x8_serial)
|
||||||
{
|
{
|
||||||
if (x93_secondaryInst)
|
if (x93_secondaryInst)
|
||||||
{
|
{
|
||||||
x10_uiType = UIType::Fourteen;
|
x10_uiType = UIType::NotOriginalCard;
|
||||||
x91_ = true;
|
x91_uiTextDirty = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -71,8 +72,8 @@ CIOWin::EMessageReturn CSaveUI::Update(float dt)
|
|||||||
|
|
||||||
UIType oldTp = x10_uiType;
|
UIType oldTp = x10_uiType;
|
||||||
x10_uiType = SelectUIType();
|
x10_uiType = SelectUIType();
|
||||||
if (oldTp == x10_uiType || x91_)
|
if (oldTp != x10_uiType || x91_uiTextDirty)
|
||||||
FinishedLoading();
|
SetUIText();
|
||||||
|
|
||||||
if (x6c_cardDriver->x10_state == EState::NoCard)
|
if (x6c_cardDriver->x10_state == EState::NoCard)
|
||||||
{
|
{
|
||||||
@ -129,79 +130,282 @@ bool CSaveUI::PumpLoad()
|
|||||||
x6c_cardDriver->StartCardProbe();
|
x6c_cardDriver->StartCardProbe();
|
||||||
|
|
||||||
x10_uiType = SelectUIType();
|
x10_uiType = SelectUIType();
|
||||||
FinishedLoading();
|
SetUIText();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
CSaveUI::UIType CSaveUI::SelectUIType() const
|
CSaveUI::UIType CSaveUI::SelectUIType() const
|
||||||
{
|
{
|
||||||
if (x6c_cardDriver->x10_state == EState::NoCard)
|
if (x6c_cardDriver->x10_state == EState::NoCard)
|
||||||
return UIType::Three;
|
return UIType::NoCardFound;
|
||||||
|
|
||||||
switch (x10_uiType)
|
switch (x10_uiType)
|
||||||
{
|
{
|
||||||
case UIType::Thirteen:
|
case UIType::ProgressWillBeLost:
|
||||||
case UIType::Fourteen:
|
case UIType::NotOriginalCard:
|
||||||
case UIType::Fifteen:
|
case UIType::AllDataWillBeLost:
|
||||||
return x10_uiType;
|
return x10_uiType;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CMemoryCardDriver::IsCardBusy(x6c_cardDriver->x10_state))
|
if (CMemoryCardDriver::IsCardBusy(x6c_cardDriver->x10_state))
|
||||||
{
|
{
|
||||||
if (!CMemoryCardDriver::IsOperationDestructive(x6c_cardDriver->x10_state))
|
if (CMemoryCardDriver::IsCardWriting(x6c_cardDriver->x10_state))
|
||||||
return UIType::Two;
|
return UIType::BusyWriting;
|
||||||
return UIType::One;
|
return UIType::BusyReading;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x6c_cardDriver->x10_state == EState::Ready)
|
if (x6c_cardDriver->x10_state == EState::Ready)
|
||||||
{
|
{
|
||||||
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardStillFull)
|
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardStillFull)
|
||||||
return UIType::Twelve;
|
return UIType::StillInsufficientSpace;
|
||||||
return UIType::Sixteen;
|
return UIType::SaveProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardBroken)
|
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardBroken)
|
||||||
return UIType::Four;
|
return UIType::NeedsFormatBroken;
|
||||||
|
|
||||||
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardWrongCharacterSet)
|
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardWrongCharacterSet)
|
||||||
return UIType::Five;
|
return UIType::NeedsFormatEncoding;
|
||||||
|
|
||||||
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardWrongDevice)
|
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardWrongDevice)
|
||||||
return UIType::Seven;
|
return UIType::WrongDevice;
|
||||||
|
|
||||||
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardFull)
|
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardFull)
|
||||||
{
|
{
|
||||||
if (x6c_cardDriver->x10_state == EState::CardCheckFailed)
|
if (x6c_cardDriver->x10_state == EState::CardCheckFailed)
|
||||||
return UIType::Eight;
|
return UIType::InsufficientSpaceBadCheck;
|
||||||
return UIType::Nine;
|
return UIType::InsufficientSpaceOKCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardNon8KSectors)
|
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardNon8KSectors)
|
||||||
return UIType::Ten;
|
return UIType::IncompatibleCard;
|
||||||
|
|
||||||
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::FileCorrupted)
|
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::FileCorrupted)
|
||||||
return UIType::Eleven;
|
return UIType::SaveCorrupt;
|
||||||
|
|
||||||
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardIOError)
|
if (x6c_cardDriver->x14_error == CMemoryCardDriver::EError::CardIOError)
|
||||||
return UIType::Six;
|
return UIType::CardDamaged;
|
||||||
|
|
||||||
return UIType::Zero;
|
return UIType::Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSaveUI::FinishedLoading()
|
void CSaveUI::SetUIText()
|
||||||
{
|
{
|
||||||
|
x91_uiTextDirty = false;
|
||||||
|
|
||||||
|
u32 msgA = -1;
|
||||||
|
u32 msgB = -1;
|
||||||
|
u32 opt0 = -1;
|
||||||
|
u32 opt1 = -1;
|
||||||
|
u32 opt2 = -1;
|
||||||
|
|
||||||
|
switch (x10_uiType)
|
||||||
|
{
|
||||||
|
case UIType::BusyReading:
|
||||||
|
msgB = 24; // Reading
|
||||||
|
break;
|
||||||
|
case UIType::BusyWriting:
|
||||||
|
msgB = 25; // Writing
|
||||||
|
break;
|
||||||
|
case UIType::NoCardFound:
|
||||||
|
msgB = 0; // No card found
|
||||||
|
opt0 = 17; // Continue without saving
|
||||||
|
opt1 = 18; // Retry
|
||||||
|
break;
|
||||||
|
case UIType::NeedsFormatBroken:
|
||||||
|
msgB = 1; // Needs format (card broken)
|
||||||
|
opt0 = 17; // Continue without saving
|
||||||
|
opt1 = 18; // Retry
|
||||||
|
opt2 = 20; // Format
|
||||||
|
break;
|
||||||
|
case UIType::NeedsFormatEncoding:
|
||||||
|
msgB = 2; // Needs format (wrong char set)
|
||||||
|
opt0 = 17; // Continue without saving
|
||||||
|
opt1 = 18; // Retry
|
||||||
|
opt2 = 20; // Format
|
||||||
|
break;
|
||||||
|
case UIType::CardDamaged:
|
||||||
|
msgB = 3; // Damaged
|
||||||
|
opt0 = 17; // Continue without saving
|
||||||
|
opt1 = 18; // Retry
|
||||||
|
break;
|
||||||
|
case UIType::WrongDevice:
|
||||||
|
msgB = 5; // Invalid device
|
||||||
|
opt0 = 17; // Continue without saving
|
||||||
|
opt1 = 18; // Retry
|
||||||
|
break;
|
||||||
|
case UIType::InsufficientSpaceOKCheck:
|
||||||
|
msgB = 6; // Insufficient space (completely filled)
|
||||||
|
opt0 = 17; // Continue without saving
|
||||||
|
opt1 = 18; // Retry
|
||||||
|
opt2 = 19; // Manage memory card
|
||||||
|
break;
|
||||||
|
case UIType::InsufficientSpaceBadCheck:
|
||||||
|
msgB = bool(x0_instIdx) + 9; // Insufficient space A or B
|
||||||
|
opt0 = 17; // Continue without saving
|
||||||
|
opt1 = 18; // Retry
|
||||||
|
opt2 = 19; // Manage memory card
|
||||||
|
break;
|
||||||
|
case UIType::IncompatibleCard:
|
||||||
|
msgB = 7; // Incompatible card
|
||||||
|
opt0 = 17; // Continue without saving
|
||||||
|
opt1 = 18; // Retry
|
||||||
|
break;
|
||||||
|
case UIType::SaveCorrupt:
|
||||||
|
msgB = 4; // Save corrupt
|
||||||
|
opt0 = 22; // Delete corrupt file
|
||||||
|
opt1 = 17; // Continue without saving
|
||||||
|
opt2 = 18; // Retry
|
||||||
|
break;
|
||||||
|
case UIType::StillInsufficientSpace:
|
||||||
|
if (x0_instIdx == 1)
|
||||||
|
{
|
||||||
|
msgB = 10; // Insufficient space B
|
||||||
|
opt0 = 17; // Continue without saving
|
||||||
|
opt1 = 18; // Retry
|
||||||
|
opt2 = 19; // Manage memory card
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msgB = 9; // Insufficient space A
|
||||||
|
opt0 = 17; // Continue without saving
|
||||||
|
opt1 = 18; // Retry
|
||||||
|
opt2 = 19; // Manage memory card
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case UIType::ProgressWillBeLost:
|
||||||
|
msgA = 28; // Warning
|
||||||
|
msgB = 11; // Progress will be lost
|
||||||
|
opt0 = 21; // Cancel
|
||||||
|
opt1 = 16; // Continue
|
||||||
|
break;
|
||||||
|
case UIType::NotOriginalCard:
|
||||||
|
msgA = 28; // Warning
|
||||||
|
msgB = 12; // Not the original card
|
||||||
|
opt0 = x0_instIdx == 1 ? 21 : 17; // Cancel : continue without saving
|
||||||
|
opt1 = 16; // Continue
|
||||||
|
break;
|
||||||
|
case UIType::AllDataWillBeLost:
|
||||||
|
msgA = 28; // Warning
|
||||||
|
msgB = 13; // All card data will be erased
|
||||||
|
opt0 = 16; // Continue
|
||||||
|
opt1 = 21; // Cancel
|
||||||
|
break;
|
||||||
|
case UIType::SaveProgress:
|
||||||
|
if (x0_instIdx == 1)
|
||||||
|
{
|
||||||
|
msgB = 8; // Save progress?
|
||||||
|
opt0 = 14; // Yes
|
||||||
|
opt1 = 15; // No
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::wstring msgAStr;
|
||||||
|
if (msgA != -1)
|
||||||
|
msgAStr = x38_strgMemoryCard->GetString(msgA);
|
||||||
|
std::wstring msgBStr;
|
||||||
|
if (msgB != -1)
|
||||||
|
msgBStr = x38_strgMemoryCard->GetString(msgB);
|
||||||
|
x54_textpane_message->TextSupport()->SetText(msgAStr + msgBStr);
|
||||||
|
|
||||||
|
std::wstring opt0Str;
|
||||||
|
if (opt0 != -1)
|
||||||
|
opt0Str = x38_strgMemoryCard->GetString(opt0);
|
||||||
|
x5c_textpane_choice0->TextSupport()->SetText(opt0Str);
|
||||||
|
|
||||||
|
std::wstring opt1Str;
|
||||||
|
if (opt1 != -1)
|
||||||
|
opt1Str = x38_strgMemoryCard->GetString(opt1);
|
||||||
|
x60_textpane_choice1->TextSupport()->SetText(opt1Str);
|
||||||
|
|
||||||
|
std::wstring opt2Str;
|
||||||
|
if (opt2 != -1)
|
||||||
|
opt2Str = x38_strgMemoryCard->GetString(opt2);
|
||||||
|
x64_textpane_choice2->TextSupport()->SetText(opt2Str);
|
||||||
|
|
||||||
|
std::wstring opt3Str;
|
||||||
|
x68_textpane_choice3->TextSupport()->SetText(opt3Str);
|
||||||
|
|
||||||
|
x5c_textpane_choice0->SetB627(opt0 != -1);
|
||||||
|
x60_textpane_choice1->SetB627(opt1 != -1);
|
||||||
|
x64_textpane_choice2->SetB627(opt2 != -1);
|
||||||
|
x68_textpane_choice3->SetB627(false);
|
||||||
|
|
||||||
|
x58_tablegroup_choices->SetIsActive(opt0 != -1 || opt1 != -1 || opt2 != -1);
|
||||||
|
SetUIColors();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSaveUI::SetUIColors()
|
||||||
|
{
|
||||||
|
x58_tablegroup_choices->SetColors(zeus::CColor::skWhite,
|
||||||
|
zeus::CColor{0.627450f, 0.627450f, 0.627450f, 0.784313f});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSaveUI::Draw() const
|
void CSaveUI::Draw() const
|
||||||
{
|
{
|
||||||
//if (x50_loadedFrame)
|
if (x50_loadedFrame)
|
||||||
//x50_loadedFrame->Draw(CGuiWidgetDrawParams::Default());
|
x50_loadedFrame->Draw(CGuiWidgetDrawParms::Default);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSaveUI::ContinueWithoutSaving()
|
||||||
|
{
|
||||||
|
x80_iowRet = CIOWin::EMessageReturn::RemoveIOWin;
|
||||||
|
g_GameState->SetCardSerial(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSaveUI::DoAdvance(CGuiTableGroup* caller)
|
void CSaveUI::DoAdvance(CGuiTableGroup* caller)
|
||||||
{
|
{
|
||||||
|
int userSel = x58_tablegroup_choices->GetUserSelection();
|
||||||
|
s32 sfx = -1;
|
||||||
|
|
||||||
|
switch (x10_uiType)
|
||||||
|
{
|
||||||
|
case UIType::NoCardFound:
|
||||||
|
case UIType::CardDamaged:
|
||||||
|
case UIType::WrongDevice:
|
||||||
|
case UIType::IncompatibleCard:
|
||||||
|
if (userSel == 0)
|
||||||
|
{
|
||||||
|
/* Continue without saving */
|
||||||
|
if (x0_instIdx == 1)
|
||||||
|
x80_iowRet = CIOWin::EMessageReturn::RemoveIOWinAndExit;
|
||||||
|
else
|
||||||
|
ContinueWithoutSaving();
|
||||||
|
sfx = x8c_navBackSfx;
|
||||||
|
}
|
||||||
|
else if (userSel == 1)
|
||||||
|
{
|
||||||
|
/* Retry */
|
||||||
|
ResetCardDriver();
|
||||||
|
sfx = x84_navConfirmSfx;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case UIType::NeedsFormatBroken:
|
||||||
|
case UIType::NeedsFormatEncoding:
|
||||||
|
|
||||||
|
case UIType::InsufficientSpaceBadCheck:
|
||||||
|
case UIType::InsufficientSpaceOKCheck:
|
||||||
|
|
||||||
|
case UIType::SaveCorrupt:
|
||||||
|
|
||||||
|
case UIType::StillInsufficientSpace:
|
||||||
|
|
||||||
|
case UIType::NotOriginalCard:
|
||||||
|
|
||||||
|
case UIType::AllDataWillBeLost:
|
||||||
|
|
||||||
|
case UIType::SaveProgress:
|
||||||
|
|
||||||
|
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sfx >= 0)
|
||||||
|
CSfxManager::SfxStart(sfx, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSaveUI::DoSelectionChange(CGuiTableGroup* caller)
|
void CSaveUI::DoSelectionChange(CGuiTableGroup* caller)
|
||||||
|
@ -24,33 +24,33 @@ class CSaveUI
|
|||||||
public:
|
public:
|
||||||
enum class UIType
|
enum class UIType
|
||||||
{
|
{
|
||||||
Zero,
|
Empty = 0,
|
||||||
One,
|
BusyReading = 1,
|
||||||
Two,
|
BusyWriting = 2,
|
||||||
Three,
|
NoCardFound = 3,
|
||||||
Four,
|
NeedsFormatBroken = 4,
|
||||||
Five,
|
NeedsFormatEncoding = 5,
|
||||||
Six,
|
CardDamaged = 6,
|
||||||
Seven,
|
WrongDevice = 7,
|
||||||
Eight,
|
InsufficientSpaceBadCheck = 8,
|
||||||
Nine,
|
InsufficientSpaceOKCheck = 9,
|
||||||
Ten,
|
IncompatibleCard = 10,
|
||||||
Eleven,
|
SaveCorrupt = 11,
|
||||||
Twelve,
|
StillInsufficientSpace = 12,
|
||||||
Thirteen,
|
ProgressWillBeLost = 13,
|
||||||
Fourteen,
|
NotOriginalCard = 14,
|
||||||
Fifteen,
|
AllDataWillBeLost = 15,
|
||||||
Sixteen
|
SaveProgress = 16
|
||||||
};
|
};
|
||||||
|
|
||||||
bool IsDrawConditional()
|
bool IsDrawConditional()
|
||||||
{
|
{
|
||||||
switch (x10_uiType)
|
switch (x10_uiType)
|
||||||
{
|
{
|
||||||
case UIType::Sixteen:
|
case UIType::SaveProgress:
|
||||||
case UIType::Zero:
|
case UIType::Empty:
|
||||||
case UIType::One:
|
case UIType::BusyReading:
|
||||||
case UIType::Two:
|
case UIType::BusyWriting:
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
return true;
|
return true;
|
||||||
@ -60,7 +60,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
u32 x0_instIdx;
|
u32 x0_instIdx;
|
||||||
u64 x8_serial;
|
u64 x8_serial;
|
||||||
UIType x10_uiType = UIType::Zero;
|
UIType x10_uiType = UIType::Empty;
|
||||||
TLockedToken<CTexture> x14_txtrSaveBanner;
|
TLockedToken<CTexture> x14_txtrSaveBanner;
|
||||||
TLockedToken<CTexture> x20_txtrSaveIcon0;
|
TLockedToken<CTexture> x20_txtrSaveIcon0;
|
||||||
TLockedToken<CTexture> x2c_txtrSaveIcon1;
|
TLockedToken<CTexture> x2c_txtrSaveIcon1;
|
||||||
@ -80,18 +80,20 @@ private:
|
|||||||
u32 x88_navMoveSfx = 1461;
|
u32 x88_navMoveSfx = 1461;
|
||||||
u32 x8c_navBackSfx = 1459;
|
u32 x8c_navBackSfx = 1459;
|
||||||
bool x90_needsDriverReset = false;
|
bool x90_needsDriverReset = false;
|
||||||
bool x91_ = false;
|
bool x91_uiTextDirty = false;
|
||||||
bool x92_ = false;
|
bool x92_ = false;
|
||||||
bool x93_secondaryInst;
|
bool x93_secondaryInst;
|
||||||
|
|
||||||
void ResetCardDriver();
|
void ResetCardDriver();
|
||||||
|
void ContinueWithoutSaving();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static std::unique_ptr<CMemoryCardDriver> ConstructCardDriver(bool importState);
|
static std::unique_ptr<CMemoryCardDriver> ConstructCardDriver(bool importState);
|
||||||
CIOWin::EMessageReturn Update(float dt);
|
CIOWin::EMessageReturn Update(float dt);
|
||||||
bool PumpLoad();
|
bool PumpLoad();
|
||||||
UIType SelectUIType() const;
|
UIType SelectUIType() const;
|
||||||
void FinishedLoading();
|
void SetUIText();
|
||||||
|
void SetUIColors();
|
||||||
void Draw() const;
|
void Draw() const;
|
||||||
|
|
||||||
void DoAdvance(CGuiTableGroup* caller);
|
void DoAdvance(CGuiTableGroup* caller);
|
||||||
|
@ -6,12 +6,11 @@
|
|||||||
#include "CToken.hpp"
|
#include "CToken.hpp"
|
||||||
#include "GuiSys/CGuiTextSupport.hpp"
|
#include "GuiSys/CGuiTextSupport.hpp"
|
||||||
#include "Graphics/Shaders/CTexturedQuadFilter.hpp"
|
#include "Graphics/Shaders/CTexturedQuadFilter.hpp"
|
||||||
#include "Audio/CSfxHandle.hpp"
|
#include "Audio/CSfxManager.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class CTexture;
|
class CTexture;
|
||||||
class CSfxHandle;
|
|
||||||
class CDependencyGroup;
|
class CDependencyGroup;
|
||||||
|
|
||||||
class CSlideShow : public CIOWin
|
class CSlideShow : public CIOWin
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
#include "CEntity.hpp"
|
#include "CEntity.hpp"
|
||||||
#include "Graphics/CGraphics.hpp"
|
#include "Graphics/CGraphics.hpp"
|
||||||
#include "Graphics/CSimpleShadow.hpp"
|
#include "Graphics/CSimpleShadow.hpp"
|
||||||
#include "Audio/CSfxHandle.hpp"
|
|
||||||
#include "zeus/zeus.hpp"
|
#include "zeus/zeus.hpp"
|
||||||
#include "Collision/CMaterialFilter.hpp"
|
#include "Collision/CMaterialFilter.hpp"
|
||||||
#include "Character/CModelData.hpp"
|
#include "Character/CModelData.hpp"
|
||||||
#include "Character/CActorLights.hpp"
|
#include "Character/CActorLights.hpp"
|
||||||
#include "Collision/CCollisionResponseData.hpp"
|
#include "Collision/CCollisionResponseData.hpp"
|
||||||
|
#include "Audio/CSfxManager.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
@ -22,7 +22,6 @@ class CDamageVulnerability;
|
|||||||
class CLightParameters;
|
class CLightParameters;
|
||||||
class CScannableObjectInfo;
|
class CScannableObjectInfo;
|
||||||
class CScriptWater;
|
class CScriptWater;
|
||||||
class CSfxHandle;
|
|
||||||
class CSimpleShadow;
|
class CSimpleShadow;
|
||||||
|
|
||||||
class CActor : public CEntity
|
class CActor : public CEntity
|
||||||
|
2
amuse
2
amuse
@ -1 +1 @@
|
|||||||
Subproject commit 72d0df7d461841b7fca2b3c38c3dd61ccb798fd6
|
Subproject commit df167556fbded7d8bcdf72306921a6594374121c
|
Loading…
x
Reference in New Issue
Block a user