Don't render the preview in wireframe mode. Closes #219.

This commit is contained in:
Leonardo Zide 2018-04-07 15:28:44 -07:00
parent 718b31a2bd
commit 05cf0d6b90
3 changed files with 10 additions and 0 deletions

View file

@ -368,6 +368,7 @@ void lcPartSelectionListModel::DrawPreview(int InfoIndex)
Context->SetProjectionMatrix(ProjectionMatrix);
lcScene Scene;
Scene.SetAllowWireframe(false);
Scene.Begin(ViewMatrix);
Info->AddRenderMeshes(Scene, lcMatrix44Identity(), mColorIndex, lcRenderMeshState::NORMAL, true);

View file

@ -11,6 +11,7 @@ lcScene::lcScene()
: mRenderMeshes(0, 1024), mOpaqueMeshes(0, 1024), mTranslucentMeshes(0, 1024), mInterfaceObjects(0, 1024)
{
mActiveSubmodelInstance = nullptr;
mAllowWireframe = true;
}
void lcScene::Begin(const lcMatrix44& ViewMatrix)
@ -239,6 +240,8 @@ void lcScene::Draw(lcContext* Context) const
const bool DrawConditional = false;
lcShadingMode ShadingMode = lcGetPreferences().mShadingMode;
if (ShadingMode == LC_SHADING_WIREFRAME && !mAllowWireframe)
ShadingMode = LC_SHADING_FLAT;
if (ShadingMode == LC_SHADING_WIREFRAME)
{

View file

@ -28,6 +28,11 @@ public:
return mDrawInterface;
}
void SetAllowWireframe(bool AllowWireframe)
{
mAllowWireframe = AllowWireframe;
}
void Begin(const lcMatrix44& ViewMatrix);
void End();
void AddMesh(lcMesh* Mesh, const lcMatrix44& WorldMatrix, int ColorIndex, lcRenderMeshState State, int Flags);
@ -46,6 +51,7 @@ protected:
lcMatrix44 mViewMatrix;
lcPiece* mActiveSubmodelInstance;
bool mDrawInterface;
bool mAllowWireframe;
lcArray<lcRenderMesh> mRenderMeshes;
lcArray<int> mOpaqueMeshes;