Better boo init within CMain; shader fixes

This commit is contained in:
Jack Andersen 2016-08-16 20:18:18 -10:00
parent e9a5e4b7f6
commit 3acc93f1c0
7 changed files with 51 additions and 31 deletions

View File

@ -134,7 +134,7 @@ makeProj:
m_vm.SetupEditorView();
m_factoryMP1.IndexMP1Resources(*m_proj);
m_mainMP1.emplace(m_factoryMP1, m_objStore);
m_mainMP1.emplace(m_factoryMP1, m_objStore, m_vm.m_mainBooFactory, m_vm.m_mainCommandQueue, m_vm.m_renderTex);
m_vm.InitMP1(*m_mainMP1);
m_vm.BuildTestPART(m_objStore);

View File

@ -15,6 +15,8 @@
#include "Runtime/Character/CSkinRules.hpp"
#include "Graphics/CMetroidModelInstance.hpp"
#include "World/CWorldTransManager.hpp"
#include "Graphics/Shaders/CColoredQuadFilter.hpp"
#include "Graphics/Shaders/CTexturedQuadFilter.hpp"
#include <cstdio>
using YAMLNode = athena::io::YAMLNode;
@ -25,6 +27,8 @@ namespace urde
URDE_DECL_SPECIALIZE_SHADER(CThermalColdFilter)
URDE_DECL_SPECIALIZE_SHADER(CThermalHotFilter)
URDE_DECL_SPECIALIZE_SHADER(CSpaceWarpFilter)
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CColoredQuadFilter)
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilter)
void ViewManager::BuildTestPART(urde::IObjectStore& objStore)
{
@ -78,7 +82,7 @@ void ViewManager::BuildTestPART(urde::IObjectStore& objStore)
void ViewManager::InitMP1(MP1::CMain& main)
{
main.Init(m_mainBooFactory, m_mainCommandQueue, m_renderTex, m_fileStoreManager, m_voiceEngine.get());
main.Init(m_fileStoreManager, m_voiceEngine.get());
}
void ViewManager::ParticleView::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub)
@ -403,6 +407,8 @@ void ViewManager::stop()
TShader<CThermalColdFilter>::Shutdown();
TShader<CThermalHotFilter>::Shutdown();
TShader<CSpaceWarpFilter>::Shutdown();
TMultiBlendShader<CColoredQuadFilter>::Shutdown();
TMultiBlendShader<CTexturedQuadFilter>::Shutdown();
CElementGen::Shutdown();
CMoviePlayer::Shutdown();
CLineRenderer::Shutdown();

View File

@ -28,7 +28,7 @@ static const char* VS =
"{\n"
" VertToFrag vtf;\n"
" vtf.color = cqu.color;\n"
" vtf.position = vec4(v.posIn.xyz, 1.0);\n"
" vtf.position = float4(v.posIn.xyz, 1.0);\n"
" return vtf;\n"
"}\n";

View File

@ -31,7 +31,7 @@ static const char* VS =
" VertToFrag vtf;\n"
" vtf.color = tqu.color;\n"
" vtf.uv = v.uvIn.xy;\n"
" vtf.position = vec4(v.posIn.xyz, 1.0);\n"
" vtf.position = float4(v.posIn.xyz, 1.0);\n"
" return vtf;\n"
"}\n";

View File

@ -3,23 +3,42 @@
#include "Graphics/Shaders/CThermalColdFilter.hpp"
#include "Graphics/Shaders/CThermalHotFilter.hpp"
#include "Graphics/Shaders/CSpaceWarpFilter.hpp"
#include "Graphics/Shaders/CColoredQuadFilter.hpp"
#include "Graphics/Shaders/CTexturedQuadFilter.hpp"
namespace urde
{
URDE_DECL_SPECIALIZE_SHADER(CThermalColdFilter)
URDE_DECL_SPECIALIZE_SHADER(CThermalHotFilter)
URDE_DECL_SPECIALIZE_SHADER(CSpaceWarpFilter)
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CColoredQuadFilter)
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilter)
namespace MP1
{
CMain::CMain(IFactory& resFactory, CSimplePool& resStore)
: x128_globalObjects(resFactory, resStore)
CMain::CMain(IFactory& resFactory, CSimplePool& resStore,
boo::IGraphicsDataFactory* gfxFactory,
boo::IGraphicsCommandQueue* cmdQ,
boo::ITextureR* spareTex)
: m_booSetter(gfxFactory, cmdQ, spareTex), x128_globalObjects(resFactory, resStore)
{
xe4_gameplayResult = EGameplayResult::Playing;
g_Main = this;
}
CMain::BooSetter::BooSetter(boo::IGraphicsDataFactory* factory,
boo::IGraphicsCommandQueue* cmdQ,
boo::ITextureR* spareTex)
{
CGraphics::InitializeBoo(factory, cmdQ, spareTex);
TShader<CThermalColdFilter>::Initialize();
TShader<CThermalHotFilter>::Initialize();
TShader<CSpaceWarpFilter>::Initialize();
TMultiBlendShader<CColoredQuadFilter>::Initialize();
TMultiBlendShader<CTexturedQuadFilter>::Initialize();
}
void CMain::RegisterResourceTweaks()
{
}
@ -27,17 +46,10 @@ void CMain::ResetGameState()
{
}
void CMain::InitializeSubsystems(boo::IGraphicsDataFactory* factory,
boo::IGraphicsCommandQueue* cc,
boo::ITextureR* renderTex,
const hecl::Runtime::FileStoreManager& storeMgr,
void CMain::InitializeSubsystems(const hecl::Runtime::FileStoreManager& storeMgr,
boo::IAudioVoiceEngine* voiceEngine)
{
CGraphics::InitializeBoo(factory, cc, renderTex);
CModelShaders::Initialize(storeMgr, factory);
TShader<CThermalColdFilter>::Initialize();
TShader<CThermalHotFilter>::Initialize();
TShader<CSpaceWarpFilter>::Initialize();
CModelShaders::Initialize(storeMgr, CGraphics::g_BooFactory);
CMoviePlayer::Initialize();
CLineRenderer::Initialize();
CElementGen::Initialize();
@ -52,13 +64,10 @@ void CMain::LoadAudio()
{
}
void CMain::Init(boo::IGraphicsDataFactory* factory,
boo::IGraphicsCommandQueue* cc,
boo::ITextureR* renderTex,
const hecl::Runtime::FileStoreManager& storeMgr,
void CMain::Init(const hecl::Runtime::FileStoreManager& storeMgr,
boo::IAudioVoiceEngine* voiceEngine)
{
InitializeSubsystems(factory, cc, renderTex, storeMgr, voiceEngine);
InitializeSubsystems(storeMgr, voiceEngine);
x128_globalObjects.PostInitialize();
x70_tweaks.RegisterTweaks();
//g_TweakManager->ReadFromMemoryCard("AudioTweaks");

View File

@ -80,7 +80,8 @@ class CGameGlobalObjects
}
public:
CGameGlobalObjects(IFactory& resFactory, CSimplePool& objStore)
CGameGlobalObjects(IFactory& resFactory,
CSimplePool& objStore)
: x20_resFactory(resFactory), x114_simplePool(objStore)
{
g_MemoryCardSys = &x0_memoryCardSys;
@ -220,6 +221,13 @@ public:
};
private:
struct BooSetter
{
BooSetter(boo::IGraphicsDataFactory* factory,
boo::IGraphicsCommandQueue* cmdQ,
boo::ITextureR* spareTex);
} m_booSetter;
//CMemorySys x6c_memSys;
CTweaks x70_tweaks;
EGameplayResult xe4_gameplayResult;
@ -252,24 +260,21 @@ private:
u32 x164_ = 0;
void InitializeSubsystems(boo::IGraphicsDataFactory* factory,
boo::IGraphicsCommandQueue* cc,
boo::ITextureR* renderTex,
const hecl::Runtime::FileStoreManager& storeMgr,
void InitializeSubsystems(const hecl::Runtime::FileStoreManager& storeMgr,
boo::IAudioVoiceEngine* voiceEngine);
public:
CMain(IFactory& resFactory, CSimplePool& resStore);
CMain(IFactory& resFactory, CSimplePool& resStore,
boo::IGraphicsDataFactory* gfxFactory,
boo::IGraphicsCommandQueue* cmdQ,
boo::ITextureR* spareTex);
void RegisterResourceTweaks();
void ResetGameState();
void StreamNewGameState(CInputStream&);
void CheckTweakManagerDebugOptions() {}
//int RsMain(int argc, const boo::SystemChar* argv[]);
void Init(boo::IGraphicsDataFactory* factory,
boo::IGraphicsCommandQueue* cc,
boo::ITextureR* renderTex,
const hecl::Runtime::FileStoreManager& storeMgr,
void Init(const hecl::Runtime::FileStoreManager& storeMgr,
boo::IAudioVoiceEngine* voiceEngine);
bool Proc();
void Shutdown();

2
hecl

@ -1 +1 @@
Subproject commit f978570bf0f8297fd6b81acb122bb2b256bfae92
Subproject commit effad6f44787daa620a7a3b4655c872dac7c1d4d