Work on CFrontEndUI

This commit is contained in:
Jack Andersen 2016-12-14 12:56:59 -10:00
parent c3bf6ec5cc
commit 6b765838a7
21 changed files with 471 additions and 35 deletions

View File

@ -0,0 +1,8 @@
#include "CAudioSys.hpp"
namespace urde
{
CAudioSys* CAudioSys::g_SharedSys = nullptr;
}

View File

@ -4,12 +4,15 @@
#include "../GCNTypes.hpp"
#include "zeus/CVector3f.hpp"
#include "amuse/amuse.hpp"
#include "boo/audiodev/IAudioVoiceEngine.hpp"
namespace urde
{
class CAudioSys
{
static CAudioSys* g_SharedSys;
boo::IAudioVoiceEngine* m_voiceEngine;
amuse::Engine m_engine;
public:
struct C3DEmitterParmData
@ -24,9 +27,32 @@ public:
u8 x27_minVol;
u8 x28_extra[2];
};
CAudioSys(amuse::IBackendVoiceAllocator& backend, u8,u8,u8,u8,u32)
: m_engine(backend)
CAudioSys(boo::IAudioVoiceEngine* voiceEngine,
amuse::IBackendVoiceAllocator& backend, u8,u8,u8,u8,u32)
: m_voiceEngine(voiceEngine), m_engine(backend)
{
g_SharedSys = this;
}
~CAudioSys()
{
g_SharedSys = nullptr;
}
static void AddAudioGroup(const amuse::AudioGroupData& data)
{
g_SharedSys->m_engine.addAudioGroup(data);
}
static void RemoveAudioGroup(const amuse::AudioGroupData& data)
{
g_SharedSys->m_engine.removeAudioGroup(data);
}
static boo::IAudioVoiceEngine* GetVoiceEngine()
{
return g_SharedSys->m_voiceEngine;
}
static amuse::Engine& GetAmuseEngine()
{
return g_SharedSys->m_engine;
}
};

View File

@ -5,6 +5,8 @@
namespace urde
{
#define RSF_BUFFER_SIZE 0x20000
CStaticAudioPlayer::CStaticAudioPlayer(boo::IAudioVoiceEngine& engine, const std::string& path,
int loopStart, int loopEnd)
: x0_path(path), x1c_loopStartSamp(loopStart & 0xfffffffe), x20_loopEndSamp(loopEnd & 0xfffffffe),
@ -18,14 +20,14 @@ CStaticAudioPlayer::CStaticAudioPlayer(boo::IAudioVoiceEngine& engine, const std
x10_rsfRem = file.Length();
x14_rsfLength = x10_rsfRem;
u32 bufCount = (x10_rsfRem + 0x20000 - 1) / 0x20000;
u32 bufCount = (x10_rsfRem + RSF_BUFFER_SIZE - 1) / RSF_BUFFER_SIZE;
x48_buffers.reserve(bufCount);
x38_dvdRequests.reserve(bufCount);
for (int remBytes = x10_rsfRem; remBytes > 0; remBytes -= 0x20000)
for (int remBytes = x10_rsfRem; remBytes > 0; remBytes -= RSF_BUFFER_SIZE)
{
u32 thisSz = 0x20000;
if (remBytes < 0x20000)
u32 thisSz = RSF_BUFFER_SIZE;
if (remBytes < RSF_BUFFER_SIZE)
thisSz = ROUND_UP_32(remBytes);
x48_buffers.emplace_back(new u8[thisSz]);
@ -50,14 +52,14 @@ void CStaticAudioPlayer::DecodeMonoAndMix(s16* bufOut, u32 numSamples,
{
for (u32 remBytes = numSamples / 2; remBytes;)
{
u32 curBuf = cur / 0x20000;
u32 thisBytes = (curBuf + 1) * 0x20000 - cur;
u32 curBuf = cur / RSF_BUFFER_SIZE;
u32 thisBytes = (curBuf + 1) * RSF_BUFFER_SIZE - cur;
thisBytes = std::min(thisBytes, remBytes);
u32 remTillLoop = loopEndCur - cur;
remTillLoop = std::min(remTillLoop, thisBytes);
const std::unique_ptr<u8[]>& buf = x48_buffers[curBuf];
const u8* byte = &buf[cur - curBuf * 0x20000];
const u8* byte = &buf[cur - curBuf * RSF_BUFFER_SIZE];
for (int i=0; i<remTillLoop; ++i, ++byte)
{

View File

@ -1,6 +1,7 @@
#ifndef __URDE_CSTATICAUDIOPLAYER_HPP__
#define __URDE_CSTATICAUDIOPLAYER_HPP__
#include "CAudioSys.hpp"
#include "RetroTypes.hpp"
#include "g721.h"
#include "boo/audiodev/IAudioVoice.hpp"
@ -43,7 +44,10 @@ class CStaticAudioPlayer
size_t supplyAudio(boo::IAudioVoice& voice, size_t frames, int16_t* data)
{
if (m_parent.IsReady())
{
m_parent.x38_dvdRequests.clear();
m_parent.Decode(data, frames);
}
else
memset(data, 0, 4 * frames);
return frames;
@ -55,12 +59,20 @@ class CStaticAudioPlayer
public:
CStaticAudioPlayer(boo::IAudioVoiceEngine& engine, const std::string& path,
int loopStart, int loopEnd);
CStaticAudioPlayer(const std::string& path,
int loopStart, int loopEnd)
: CStaticAudioPlayer(*CAudioSys::GetVoiceEngine(), path, loopStart, loopEnd) {}
bool IsReady();
void DecodeMonoAndMix(s16* bufOut, u32 numSamples,
u32 cur, u32 loopEndCur, u32 loopStartCur,
int vol, g72x_state& state,
std::experimental::optional<g72x_state>& loopState) const;
void Decode(s16* bufOut, u32 numSamples);
void SetVolume(float vol)
{
xc0_volume = zeus::clamp(0.f, vol, 1.f) / 32768.f;
}
void StartMixing()
{

View File

@ -80,7 +80,7 @@ CGameOptions::CGameOptions(CBitStreamReader& stream)
x50_ = stream.ReadEncoded(6);
x54_ = stream.ReadEncoded(5);
x58_ = stream.ReadEncoded(7);
x5c_ = stream.ReadEncoded(7);
x5c_musicVol = stream.ReadEncoded(7);
x60_ = stream.ReadEncoded(8);
x64_ = stream.ReadEncoded(8);
@ -103,7 +103,7 @@ void CGameOptions::PutTo(CBitStreamWriter& writer) const
writer.WriteEncoded(x50_, 6);
writer.WriteEncoded(x54_, 5);
writer.WriteEncoded(x58_, 7);
writer.WriteEncoded(x5c_, 7);
writer.WriteEncoded(x5c_musicVol, 7);
writer.WriteEncoded(x60_, 8);
writer.WriteEncoded(x64_, 8);

View File

@ -61,7 +61,7 @@ private:
u32 x50_ = 0;
u32 x54_ = 0;
u32 x58_ = 0x7f;
u32 x5c_ = 0x7f;
u32 x5c_musicVol = 0x7f;
u32 x60_ = 0xff;
u32 x64_ = 0xff;
@ -87,6 +87,7 @@ public:
CGameOptions(CBitStreamReader& stream);
void InitSoundMode();
void PutTo(CBitStreamWriter& writer) const;
u32 GetMusicVolume() const { return x5c_musicVol; }
};
class CHintOptions

View File

@ -16,6 +16,7 @@ class CAiFuncMap* g_AiFuncMap = nullptr;
class CGameState* g_GameState = nullptr;
class CInGameTweakManagerBase* g_TweakManager = nullptr;
class CBooRenderer* g_Renderer = nullptr;
class CStringTable* g_MainStringTable = nullptr;
DataSpec::ITweakGame* g_tweakGame = nullptr;
DataSpec::ITweakPlayer* g_tweakPlayer = nullptr;

View File

@ -27,6 +27,7 @@ extern class CAiFuncMap* g_AiFuncMap;
extern class CGameState* g_GameState;
extern class CInGameTweakManagerBase* g_TweakManager;
extern class CBooRenderer* g_Renderer;
extern class CStringTable* g_MainStringTable;
extern DataSpec::ITweakGame* g_tweakGame;
extern DataSpec::ITweakPlayer* g_tweakPlayer;

View File

@ -49,6 +49,9 @@ public:
{
};
private:
std::function<void(const CGuiTableGroup*)> xd4_doMenuAdvance;
std::function<void(const CGuiTableGroup*)> xec_doMenuCancel;
std::function<void(const CGuiTableGroup*)> x104_doMenuSelChange;
int xf8_;
int xfc_;
int x100_[3][2];
@ -81,6 +84,21 @@ public:
bool MAF_MenuAdvance(CGuiFunctionDef* def, CGuiControllerInfo* info);
bool MAF_MenuCancel(CGuiFunctionDef* def, CGuiControllerInfo* info);
void SetMenuAdvanceCallback(std::function<void(const CGuiTableGroup*)>&& cb)
{
xd4_doMenuAdvance = std::move(cb);
}
void SetMenuCancelCallback(std::function<void(const CGuiTableGroup*)>&& cb)
{
xec_doMenuCancel = std::move(cb);
}
void SetMenuSelectionChangeCallback(std::function<void(const CGuiTableGroup*)>&& cb)
{
x104_doMenuSelChange = std::move(cb);
}
static CGuiTableGroup* Create(CGuiFrame* frame, CInputStream& in, bool);
};

View File

@ -11,6 +11,11 @@ CIOWin::EMessageReturn CSaveUI::Update(float dt)
}
bool CSaveUI::PumpLoad()
{
return false;
}
CSaveUI::CSaveUI(u32 instIdx, u32 a, u32 b)
: x0_instIdx(instIdx), x8_a(a), xc_b(b)
{

View File

@ -36,6 +36,7 @@ struct CSaveUI
bool x93_secondaryInst;
CIOWin::EMessageReturn Update(float dt);
bool PumpLoad();
CSaveUI(u32 inst, u32 a, u32 b);
};

View File

@ -9,12 +9,24 @@
#include "Audio/CSfxManager.hpp"
#include "Graphics/CMoviePlayer.hpp"
#include "GuiSys/CSaveUI.hpp"
#include "GuiSys/CGuiTextPane.hpp"
#include "GuiSys/CGuiFrame.hpp"
#include "GuiSys/CStringTable.hpp"
#include "GuiSys/CGuiTableGroup.hpp"
#include "CGameState.hpp"
#include "CDependencyGroup.hpp"
#include "Audio/CAudioGroupSet.hpp"
#include "CNESEmulator.hpp"
namespace urde
{
namespace MP1
{
/* Music volume constants */
#define FE1_VOL 0.7421875f
#define FE2_VOL 0.7421875f
/* L/R Stereo transition cues */
static const u16 FETransitionBackSFX[3][2] =
{
@ -51,6 +63,116 @@ static const FEMovie FEMovies[] =
SObjectTag g_DefaultWorldTag = {FOURCC('MLVL'), 0x158efe17};
CFrontEndUI::SNewFileSelectFrame::SNewFileSelectFrame(CSaveUI* sui, u32 rnd)
: x0_rnd(rnd), x4_saveUI(sui)
{
x10_frme = g_SimplePool->GetObj("FRME_NewFileSelect");
}
bool CFrontEndUI::SNewFileSelectFrame::PumpLoad()
{
return false;
}
void CFrontEndUI::SGuiTextPair::SetPairText(const std::wstring& str)
{
x0_panes[0]->TextSupport()->SetText(str);
x0_panes[1]->TextSupport()->SetText(str);
}
void CFrontEndUI::SFrontEndFrame::FinishedLoading()
{
x18_tablegroup_mainmenu = static_cast<CGuiTableGroup*>(x14_loadedFrme->FindWidget("tablegroup_mainmenu"));
x1c_gbaPair = FindTextPanePair(x14_loadedFrme, "textpane_gba");
x1c_gbaPair.SetPairText(g_MainStringTable->GetString(37));
x24_cheatPair = FindTextPanePair(x14_loadedFrme, "textpane_cheats");
x24_cheatPair.SetPairText(g_MainStringTable->GetString(96));
FindAndSetPairText(x14_loadedFrme, "textpane_start", g_MainStringTable->GetString(67));
FindAndSetPairText(x14_loadedFrme, "textpane_options", g_MainStringTable->GetString(94));
FindAndSetPairText(x14_loadedFrme, "textpane_title", g_MainStringTable->GetString(98));
CGuiTextPane* proceed = static_cast<CGuiTextPane*>(x14_loadedFrme->FindWidget("textpane_proceed"));
if (proceed)
proceed->TextSupport()->SetText(g_MainStringTable->GetString(85));
/* These appear to be unused leftovers from the CGuiFrame scripting system */
x18_tablegroup_mainmenu->SetMenuAdvanceCallback(
std::bind(&SFrontEndFrame::DoMenuAdvance, this, std::placeholders::_1));
x18_tablegroup_mainmenu->SetMenuSelectionChangeCallback(
std::bind(&SFrontEndFrame::DoMenuSelectionChange, this, std::placeholders::_1));
x18_tablegroup_mainmenu->SetMenuCancelCallback(
std::bind(&SFrontEndFrame::DoMenuAdvance, this, std::placeholders::_1));
}
bool CFrontEndUI::SFrontEndFrame::PumpLoad()
{
if (x14_loadedFrme)
return true;
if (x8_frme.IsLoaded())
{
if (CGuiFrame* frme = x8_frme.GetObj())
{
if (frme->GetIsFinishedLoading())
{
x14_loadedFrme = frme;
FinishedLoading();
return true;
}
}
}
return false;
}
CFrontEndUI::SGuiTextPair CFrontEndUI::SFrontEndFrame::FindTextPanePair(CGuiFrame* frame, const char* name)
{
SGuiTextPair ret;
ret.x0_panes[0] = static_cast<CGuiTextPane*>(frame->FindWidget(name));
ret.x0_panes[1] = static_cast<CGuiTextPane*>(frame->FindWidget(hecl::Format("%sb", name).c_str()));
return ret;
}
void CFrontEndUI::SFrontEndFrame::FindAndSetPairText(CGuiFrame* frame, const char* name, const std::wstring& str)
{
CGuiTextPane* w1 = static_cast<CGuiTextPane*>(frame->FindWidget(name));
w1->TextSupport()->SetText(str);
CGuiTextPane* w2 = static_cast<CGuiTextPane*>(frame->FindWidget(hecl::Format("%sb", name).c_str()));
w2->TextSupport()->SetText(str);
}
void CFrontEndUI::SFrontEndFrame::DoMenuSelectionChange(const CGuiTableGroup* caller)
{
}
void CFrontEndUI::SFrontEndFrame::DoMenuAdvance(const CGuiTableGroup* caller)
{
}
CFrontEndUI::SFrontEndFrame::SFrontEndFrame(u32 rnd)
: x0_rnd(rnd)
{
x8_frme = g_SimplePool->GetObj("FRME_FrontEndPL");
}
CFrontEndUI::SFusionBonusFrame::SFusionBonusFrame()
{
x4_nesEmu = std::make_unique<CNESEmulator>();
const SObjectTag* deface = g_ResFactory->GetResourceIdByName("FONT_Deface14B");
CGuiTextProperties props(false, true, EJustification::Left,
EVerticalJustification::Center,
ETextDirection::Horizontal);
xc_textSupport = std::make_unique<CGuiTextSupport>(deface->id, props, zeus::CColor::skWhite,
zeus::CColor::skBlack, zeus::CColor::skWhite,
0, 0, g_SimplePool);
}
CFrontEndUI::SOptionsFrontEndFrame::SOptionsFrontEndFrame()
{
x4_frme = g_SimplePool->GetObj("FRME_OptionsFrontEnd");
x10_pauseScreen = g_SimplePool->GetObj("STRG_PauseScreen");
}
CFrontEndUI::CFrontEndUI(CArchitectureQueue& queue)
: CIOWin("FrontEndUI")
{
@ -249,6 +371,15 @@ void CFrontEndUI::UpdateMovies(float dt)
xc4_attractMovie->Update(dt);
}
void CFrontEndUI::FinishedLoadingDepsGroup()
{
}
bool CFrontEndUI::PumpLoad()
{
return false;
}
bool CFrontEndUI::PumpMovieLoad()
{
if (xd1_moviesLoaded)
@ -257,7 +388,8 @@ bool CFrontEndUI::PumpMovieLoad()
{
if (!x70_menuMovies[i])
{
x70_menuMovies[i] = std::make_unique<CMoviePlayer>(FEMovies[i].path, 0.05f, FEMovies[i].loop, false);
const FEMovie& movie = FEMovies[i];
x70_menuMovies[i] = std::make_unique<CMoviePlayer>(movie.path, 0.05f, movie.loop, false);
x70_menuMovies[i]->SetPlayMode(CMoviePlayer::EPlayMode::Stopped);
return false;
}
@ -283,10 +415,18 @@ void CFrontEndUI::TransitionToFive()
StartStateTransition(EScreen::Five);
}
void CFrontEndUI::UpdateMusicVolume()
{
float volMul = (xf4_curAudio == xd4_audio1.get()) ? FE1_VOL : FE2_VOL;
if (xf4_curAudio)
{
float vol = volMul * x68_musicVol * (g_GameState->GameOptions().GetMusicVolume() / 127.f);
xf4_curAudio->SetVolume(vol);
}
}
CIOWin::EMessageReturn CFrontEndUI::Update(float dt, CArchitectureQueue& queue)
{
//printf("UPDATE\n");
if (xdc_saveUI && x50_curScreen >= EScreen::Three)
{
switch (xdc_saveUI->Update(dt))
@ -302,6 +442,73 @@ CIOWin::EMessageReturn CFrontEndUI::Update(float dt, CArchitectureQueue& queue)
}
}
UpdateMusicVolume();
switch (x14_screen)
{
case EScreen::Zero:
if (!x20_depsGroup.IsLoaded())
return EMessageReturn::Exit;
FinishedLoadingDepsGroup();
x20_depsGroup.Unlock();
x14_screen = EScreen::One;
case EScreen::One:
if (PumpLoad())
{
xe0_newFileSel = std::make_unique<SNewFileSelectFrame>(xdc_saveUI.get(), x1c_rndB);
xe4_gbaSupport = std::make_unique<CGBASupport>();
xe8_frontendFrme = std::make_unique<SFrontEndFrame>(x1c_rndB);
x38_pressStart.GetObj();
CAudioSys::AddAudioGroup(x44_frontendAudioGrp->GetAudioGroupData());
xd4_audio1 = std::make_unique<CStaticAudioPlayer>("Audio/frontend_1.rsf", 416480, 1973664);
xd8_audio2 = std::make_unique<CStaticAudioPlayer>("Audio/frontend_2.rsf", 273556, 1636980);
x14_screen = EScreen::Two;
}
if (x14_screen == EScreen::One)
return EMessageReturn::Exit;
case EScreen::Two:
if (!xd4_audio1->IsReady() || !xd8_audio2->IsReady() ||
!xe0_newFileSel->PumpLoad() || !xe4_gbaSupport->PumpLoad() ||
!xe8_frontendFrme->PumpLoad() || !xdc_saveUI->PumpLoad())
return EMessageReturn::Exit;
xf4_curAudio = xd4_audio1.get();
xf4_curAudio->StartMixing();
x14_screen = EScreen::Three;
case EScreen::Three:
{
bool moviesReady = true;
if (PumpMovieLoad())
{
UpdateMovies(dt);
for (int i=0 ; i<9 ; ++i)
{
if (!x70_menuMovies[i]->GetIsFullyCached())
{
moviesReady = false;
break;
}
}
}
else
moviesReady = false;
if (moviesReady)
{
x14_screen = EScreen::Four;
StartStateTransition(EScreen::One);
}
else
return EMessageReturn::Exit;
}
case EScreen::Four:
if (xec_)
{
xdc_saveUI->Update(dt);
}
}
return EMessageReturn::Exit;
}

View File

@ -5,6 +5,11 @@
#include "CGameDebug.hpp"
#include "RetroTypes.hpp"
#include "CToken.hpp"
#include "Audio/CStaticAudioPlayer.hpp"
#include "CGBASupport.hpp"
#include "zeus/CVector3f.hpp"
#include "Input/CRumbleGenerator.hpp"
#include "GuiSys/CGuiTextSupport.hpp"
namespace urde
{
@ -19,9 +24,13 @@ class CSaveWorld;
class CStringTable;
class CGuiFrame;
class CSaveUI;
class CGuiTextPane;
class CGuiWidget;
class CGuiTableGroup;
namespace MP1
{
class CNESEmulator;
class CFrontEndUI : public CIOWin
{
@ -35,10 +44,6 @@ public:
Four,
Five,
Six
};
struct SNewFileSelect
{
};
enum class EMenuMovie
{
@ -54,6 +59,97 @@ public:
GBAFileSelectB
};
struct SGuiTextPair
{
CGuiTextPane* x0_panes[2] = {};
void SetPairText(const std::wstring& str);
};
struct SNewFileSelectFrame
{
u32 x0_rnd;
CSaveUI* x4_saveUI;
TLockedToken<CGuiFrame> x10_frme;
CGuiFrame* x1c_ = nullptr;
CGuiWidget* x20_ = nullptr;
CGuiWidget* x24_ = nullptr;
SGuiTextPair x28_;
SGuiTextPair x30_;
SGuiTextPair x38_;
CGuiWidget* x40_ = nullptr;
CGuiWidget* x44_ = nullptr;
SGuiTextPair x48_;
SGuiTextPair x50_;
SGuiTextPair x58_;
CGuiWidget* x60_ = nullptr;
CGuiWidget* x64_ = nullptr;
zeus::CVector3f xf8_;
float x104_ = 0.f;
float x108_ = 0.f;
bool x10c_ = false;
bool x10d_ = false;
bool x10e_ = false;
SNewFileSelectFrame(CSaveUI* sui, u32 rnd);
bool PumpLoad();
};
struct SFrontEndFrame
{
u32 x0_rnd;
TLockedToken<CGuiFrame> x8_frme;
CGuiFrame* x14_loadedFrme = nullptr;
CGuiTableGroup* x18_tablegroup_mainmenu = nullptr;
SGuiTextPair x1c_gbaPair;
SGuiTextPair x24_cheatPair;
SFrontEndFrame(u32 rnd);
void FinishedLoading();
bool PumpLoad();
static SGuiTextPair FindTextPanePair(CGuiFrame* frame, const char* name);
static void FindAndSetPairText(CGuiFrame* frame, const char* name, const std::wstring& str);
void DoMenuSelectionChange(const CGuiTableGroup* caller);
void DoMenuAdvance(const CGuiTableGroup* caller);
};
struct SFusionBonusFrame
{
u32 x0_ = 0;
std::unique_ptr<CNESEmulator> x4_nesEmu;
std::unique_ptr<CGuiTextSupport> xc_textSupport;
float x10_ = 8.f;
bool x14_ = false;
bool x15_ = true;
SFusionBonusFrame();
};
struct SOptionsFrontEndFrame
{
float x0_ = 0.f;
TLockedToken<CGuiFrame> x4_frme;
TLockedToken<CStringTable> x10_pauseScreen;
u32 x1c_ = 0;
u32 x20_ = 0;
u32 x24_ = 0;
u32 x28_ = 0;
u32 x2c_ = 0;
u32 x30_ = 0;
u32 x34_ = 0;
float x38_ = 0.f;
u32 x3c_ = 0;
CRumbleGenerator x40_rumbleGen;
union
{
u8 _dummy = 0;
struct
{
bool x134_24_;
bool x134_25_;
};
};
SOptionsFrontEndFrame();
};
private:
EScreen x14_screen = EScreen::Zero;
u32 x18_rndA;
@ -67,7 +163,7 @@ private:
bool x5c_movieSecondsNeeded = false;
float x60_ = 0.f;
float x64_ = 0.f;
float x68_ = 1.f;
float x68_musicVol = 1.f;
u32 x6c_;
std::unique_ptr<CMoviePlayer> x70_menuMovies[9];
EMenuMovie xb8_curMovie = EMenuMovie::Stopped;
@ -78,14 +174,15 @@ private:
bool xd0_ = false;
bool xd1_moviesLoaded = false;
bool xd2_ = false;
u32 xd4_ = 0;
u32 xd8_ = 0;
std::unique_ptr<CStaticAudioPlayer> xd4_audio1;
std::unique_ptr<CStaticAudioPlayer> xd8_audio2;
std::unique_ptr<CSaveUI> xdc_saveUI;
std::unique_ptr<SNewFileSelect> xe0_newFileSel;
u32 xe4_ = 0;
std::unique_ptr<SNewFileSelectFrame> xe0_newFileSel;
std::unique_ptr<CGBASupport> xe4_gbaSupport;
std::unique_ptr<SFrontEndFrame> xe8_frontendFrme;
u32 xec_ = 0;
u32 xf0_ = 0;
u32 xf4_ = 0;
CStaticAudioPlayer* xf4_curAudio = nullptr;
void SetMovieSecondsDeferred()
{
@ -100,6 +197,9 @@ private:
}
void TransitionToFive();
void UpdateMusicVolume();
void FinishedLoadingDepsGroup();
bool PumpLoad();
public:
CFrontEndUI(CArchitectureQueue& queue);

View File

@ -0,0 +1,14 @@
#include "CGBASupport.hpp"
namespace urde
{
namespace MP1
{
bool CGBASupport::PumpLoad()
{
return false;
}
}
}

View File

@ -0,0 +1,18 @@
#ifndef __URDE_CGBASUPPORT_HPP__
#define __URDE_CGBASUPPORT_HPP__
namespace urde
{
namespace MP1
{
class CGBASupport
{
public:
bool PumpLoad();
};
}
}
#endif // __URDE_CGBASUPPORT_HPP__

View File

@ -5,6 +5,8 @@ set(MP1_SOURCES
Tweaks/CTweakAutoMapper.hpp Tweaks/CTweakAutoMapper.cpp
Tweaks/CTweakPlayer.hpp Tweaks/CTweakPlayer.cpp
Tweaks/CTweakGui.hpp Tweaks/CTweakGui.cpp
CGBASupport.hpp CGBASupport.cpp
CNESEmulator.hpp CNESEmulator.cpp
CMainFlow.hpp CMainFlow.cpp
CMFGame.hpp CMFGame.cpp
CPlayMovie.hpp CPlayMovie.cpp

View File

View File

@ -0,0 +1,17 @@
#ifndef __URDE_CNESEMULATOR_HPP__
#define __URDE_CNESEMULATOR_HPP__
namespace urde
{
namespace MP1
{
class CNESEmulator
{
};
}
}
#endif // __URDE_CNESEMULATOR_HPP__

View File

@ -23,9 +23,10 @@ URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilterAlpha)
namespace MP1
{
CGameArchitectureSupport::CGameArchitectureSupport(CMain& parent, amuse::IBackendVoiceAllocator& backend)
CGameArchitectureSupport::CGameArchitectureSupport(CMain& parent, boo::IAudioVoiceEngine* voiceEngine,
amuse::IBackendVoiceAllocator& backend)
: m_parent(parent),
m_audioSys(backend, 0,0,0,0,0),
m_audioSys(voiceEngine, backend, 0,0,0,0,0),
m_inputGenerator(g_tweakPlayer->GetLeftLogicalThreshold(),
g_tweakPlayer->GetRightLogicalThreshold()),
m_guiSys(*g_ResFactory, *g_SimplePool, CGuiSys::EUsageMode::Zero)
@ -124,8 +125,7 @@ void CMain::ResetGameState()
{
}
void CMain::InitializeSubsystems(const hecl::Runtime::FileStoreManager& storeMgr,
boo::IAudioVoiceEngine* voiceEngine)
void CMain::InitializeSubsystems(const hecl::Runtime::FileStoreManager& storeMgr)
{
CModelShaders::Initialize(storeMgr, CGraphics::g_BooFactory);
CMoviePlayer::Initialize();
@ -146,11 +146,11 @@ void CMain::Init(const hecl::Runtime::FileStoreManager& storeMgr,
boo::IAudioVoiceEngine* voiceEngine,
amuse::IBackendVoiceAllocator& backend)
{
InitializeSubsystems(storeMgr, voiceEngine);
InitializeSubsystems(storeMgr);
x128_globalObjects.PostInitialize();
x70_tweaks.RegisterTweaks();
x70_tweaks.RegisterResourceTweaks();
m_archSupport.reset(new CGameArchitectureSupport(*this, backend));
m_archSupport.reset(new CGameArchitectureSupport(*this, voiceEngine, backend));
g_archSupport = m_archSupport.get();
//g_TweakManager->ReadFromMemoryCard("AudioTweaks");
FillInAssetIDs();

View File

@ -55,11 +55,14 @@ class CGameGlobalObjects
CCharacterFactoryBuilder xec_charFactoryBuilder;
CAiFuncMap x110_aiFuncMap;
CGameState x134_gameState;
TLockedToken<CStringTable> x13c_mainStringTable;
CInGameTweakManager x150_tweakManager;
std::unique_ptr<CBooRenderer> m_renderer;
void LoadStringTable()
{
x13c_mainStringTable = g_SimplePool->GetObj("STRG_Main");
g_MainStringTable = x13c_mainStringTable.GetObj();
}
static CBooRenderer*
AllocateRenderer(IObjectStore& store, IFactory& resFactory)
@ -144,7 +147,8 @@ class CGameArchitectureSupport
}
public:
CGameArchitectureSupport(CMain& parent, amuse::IBackendVoiceAllocator& backend);
CGameArchitectureSupport(CMain& parent, boo::IAudioVoiceEngine* voiceEngine,
amuse::IBackendVoiceAllocator& backend);
void PreloadAudio();
bool Update();
void Draw();
@ -218,8 +222,7 @@ private:
u32 x164_ = 0;
void InitializeSubsystems(const hecl::Runtime::FileStoreManager& storeMgr,
boo::IAudioVoiceEngine* voiceEngine);
void InitializeSubsystems(const hecl::Runtime::FileStoreManager& storeMgr);
public:
CMain(IFactory& resFactory, CSimplePool& resStore,

2
hecl

@ -1 +1 @@
Subproject commit 4f4ddb902ac6144051ef23d8a35f7b94db46cf41
Subproject commit 2af7e12aa04e8028e7334a6371c3354c67f1c7fc