mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-16 08:27:01 +00:00
Added support for editing and resaving EGMC files + improved its preview rendering
This commit is contained in:
@@ -10,6 +10,7 @@ CModelNode::CModelNode(CScene *pScene, CSceneNode *pParent, CModel *pModel) : CS
|
||||
mScale = CVector3f(1.f);
|
||||
mLightingEnabled = true;
|
||||
mForceAlphaOn = false;
|
||||
mEnableScanOverlay = false;
|
||||
mTintColor = CColor::skWhite;
|
||||
}
|
||||
|
||||
@@ -59,6 +60,18 @@ void CModelNode::Draw(FRenderOptions Options, int ComponentIndex, const SViewInf
|
||||
mpModel->Draw(Options, mActiveMatSet);
|
||||
else
|
||||
mpModel->DrawSurface(Options, ComponentIndex, mActiveMatSet);
|
||||
|
||||
if (mEnableScanOverlay)
|
||||
{
|
||||
CDrawUtil::UseColorShader(mScanOverlayColor);
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ZERO);
|
||||
Options |= eNoMaterialSetup;
|
||||
|
||||
if (ComponentIndex < 0)
|
||||
mpModel->Draw(Options, 0);
|
||||
else
|
||||
mpModel->DrawSurface(Options, ComponentIndex, mActiveMatSet);
|
||||
}
|
||||
}
|
||||
|
||||
void CModelNode::DrawSelection()
|
||||
|
||||
@@ -11,6 +11,8 @@ class CModelNode : public CSceneNode
|
||||
bool mLightingEnabled;
|
||||
bool mForceAlphaOn;
|
||||
CColor mTintColor;
|
||||
bool mEnableScanOverlay;
|
||||
CColor mScanOverlayColor;
|
||||
|
||||
public:
|
||||
explicit CModelNode(CScene *pScene, CSceneNode *pParent = 0, CModel *pModel = 0);
|
||||
@@ -26,15 +28,17 @@ public:
|
||||
// Setters
|
||||
void SetModel(CModel *pModel);
|
||||
|
||||
inline void SetMatSet(u32 MatSet) { mActiveMatSet = MatSet; }
|
||||
inline void SetDynamicLighting(bool Enable) { mLightingEnabled = Enable; }
|
||||
inline void ForceAlphaEnabled(bool Enable) { mForceAlphaOn = Enable; }
|
||||
inline void SetTintColor(const CColor& rkTintColor) { mTintColor = rkTintColor; }
|
||||
inline void ClearTintColor() { mTintColor = CColor::skWhite; }
|
||||
inline CModel* Model() const { return mpModel; }
|
||||
inline u32 MatSet() const { return mActiveMatSet; }
|
||||
inline bool IsDynamicLightingEnabled() const { return mLightingEnabled; }
|
||||
inline u32 FindMeshID() const { return mpModel->GetSurface(0)->MeshID; }
|
||||
inline void SetMatSet(u32 MatSet) { mActiveMatSet = MatSet; }
|
||||
inline void SetDynamicLighting(bool Enable) { mLightingEnabled = Enable; }
|
||||
inline void ForceAlphaEnabled(bool Enable) { mForceAlphaOn = Enable; }
|
||||
inline void SetTintColor(const CColor& rkTintColor) { mTintColor = rkTintColor; }
|
||||
inline void ClearTintColor() { mTintColor = CColor::skWhite; }
|
||||
inline void SetScanOverlayEnabled(bool Enable) { mEnableScanOverlay = Enable; }
|
||||
inline void SetScanOverlayColor(const CColor& rkColor) { mScanOverlayColor = rkColor; }
|
||||
inline CModel* Model() const { return mpModel; }
|
||||
inline u32 MatSet() const { return mActiveMatSet; }
|
||||
inline bool IsDynamicLightingEnabled() const { return mLightingEnabled; }
|
||||
inline u32 FindMeshID() const { return mpModel->GetSurface(0)->MeshID; }
|
||||
};
|
||||
|
||||
#endif // CMODELNODE_H
|
||||
|
||||
Reference in New Issue
Block a user