Fix maxVerts < 2 case

This commit is contained in:
Phillip Stephens 2016-02-27 17:35:45 -08:00
parent 37da86838d
commit 97c8af9aa2
3 changed files with 7 additions and 2 deletions

View File

@ -21,7 +21,7 @@ namespace URDE
void ViewManager::BuildTestPART(pshag::IObjectStore& objStore) void ViewManager::BuildTestPART(pshag::IObjectStore& objStore)
{ {
//m_partGenDesc = objStore.GetObj({HECL::FOURCC('PART'), 0x972A5CD2}); //m_partGenDesc = objStore.GetObj({HECL::FOURCC('PART'), 0x972A5CD2});
m_partGenDesc = objStore.GetObj("PART_EnvRainSplash"); m_partGenDesc = objStore.GetObj("BusterSparks");
m_partGen.reset(new pshag::CElementGen(m_partGenDesc, m_partGen.reset(new pshag::CElementGen(m_partGenDesc,
pshag::CElementGen::EModelOrientationType::Normal, pshag::CElementGen::EModelOrientationType::Normal,
pshag::CElementGen::EOptionalSystemFlags::None)); pshag::CElementGen::EOptionalSystemFlags::None));

View File

@ -3,6 +3,7 @@
namespace pshag namespace pshag
{ {
LogVisor::LogModule LineRendererLog("pshag::CLineRenderer");
boo::IShaderPipeline* CLineRendererShaders::m_texAlpha = nullptr; boo::IShaderPipeline* CLineRendererShaders::m_texAlpha = nullptr;
boo::IShaderPipeline* CLineRendererShaders::m_texAdditive = nullptr; boo::IShaderPipeline* CLineRendererShaders::m_texAdditive = nullptr;
@ -107,7 +108,10 @@ CLineRenderer::CLineRenderer(EPrimitiveMode mode, u32 maxVerts, boo::ITexture* t
: m_mode(mode), m_maxVerts(maxVerts) : m_mode(mode), m_maxVerts(maxVerts)
{ {
if (maxVerts < 2) if (maxVerts < 2)
{
LineRendererLog.report(LogVisor::FatalError, _S("maxVerts < 2, maxVerts = %i"), maxVerts);
return; return;
}
m_textured = texture != nullptr; m_textured = texture != nullptr;
u32 maxTriVerts; u32 maxTriVerts;

View File

@ -426,8 +426,9 @@ CElementGen::CElementGen(const TToken<CGenDescription>& gen,
boo::ITexture* tex = nullptr; boo::ITexture* tex = nullptr;
if (texr) if (texr)
tex = texr->GetValueTexture(0).GetObj()->GetBooTexture(); tex = texr->GetValueTexture(0).GetObj()->GetBooTexture();
int maxVerts = (x70_MAXP == 0 ? 256 : x70_MAXP);
m_lineRenderer.reset(new CLineRenderer(CLineRenderer::EPrimitiveMode::Lines, m_lineRenderer.reset(new CLineRenderer(CLineRenderer::EPrimitiveMode::Lines,
x70_MAXP * 2, tex, x224_26_AAPH)); maxVerts * 2, tex, x224_26_AAPH));
} }
else else
{ {