Skip to content

Commit

Permalink
Add NiShader::SetDoubleSided
Browse files Browse the repository at this point in the history
  • Loading branch information
ousnius committed Aug 21, 2023
1 parent 1517bb7 commit b1a9fd0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/Shaders.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ class NiShader : public NiCloneable<NiShader, NiProperty> {
virtual bool IsSkinned() const { return false; }
virtual void SetSkinned(const bool) {}
virtual bool IsDoubleSided() const { return false; }
virtual void SetDoubleSided(const bool) {}
virtual bool IsModelSpace() const { return false; }
virtual bool IsEmissive() const { return false; }
virtual bool HasSpecular() const { return true; }
Expand Down Expand Up @@ -482,6 +483,7 @@ class BSShaderProperty : public NiCloneableStreamable<BSShaderProperty, NiShader
bool IsSkinned() const override;
void SetSkinned(const bool enable) override;
bool IsDoubleSided() const override;
void SetDoubleSided(const bool enable) override;
bool IsModelSpace() const override;
bool IsEmissive() const override;
bool HasSpecular() const override;
Expand Down
7 changes: 7 additions & 0 deletions src/Shaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,13 @@ bool BSShaderProperty::IsDoubleSided() const {
return (shaderFlags2 & (1 << 4)) != 0;
}

void BSShaderProperty::SetDoubleSided(const bool enable) {
if (enable)
shaderFlags2 |= 1 << 4;
else
shaderFlags2 &= ~(1 << 4);
}

bool BSShaderProperty::IsModelSpace() const {
return (shaderFlags1 & (1 << 12)) != 0;
}
Expand Down

0 comments on commit b1a9fd0

Please sign in to comment.