mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
Don't render the preview in wireframe mode. Closes #219.
This commit is contained in:
parent
718b31a2bd
commit
05cf0d6b90
3 changed files with 10 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue