Skip to content

Commit

Permalink
Main: MaterialSerializer - further reduce TextureEffect usage
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Aug 24, 2024
1 parent 2db61a3 commit c1f1672
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions OgreMain/include/OgreMaterialSerializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ namespace Ogre {
void writeLayerBlendOperationEx(const LayerBlendOperationEx op);
void writeLayerBlendSource(const LayerBlendSource lbs);

void writeRotationEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex);
void writeRotationEffect(float speed);
void writeTransformEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex);
void writeScrollEffect(float scrollAnimU, float scrollAnimV);
void writeEnvironmentMapEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex);
void writeEnvironmentMapEffect(TextureUnitState::EnvMapType type);

String convertFiltering(FilterOptions fo);

Expand Down
14 changes: 7 additions & 7 deletions OgreMain/src/OgreMaterialSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,10 +1065,10 @@ namespace Ogre
switch (ef.type)
{
case TextureUnitState::ET_ENVIRONMENT_MAP :
writeEnvironmentMapEffect(ef, pTex);
writeEnvironmentMapEffect((TextureUnitState::EnvMapType)ef.subtype);
break;
case TextureUnitState::ET_ROTATE :
writeRotationEffect(ef, pTex);
writeRotationEffect(ef.arg1);
break;
case TextureUnitState::ET_UVSCROLL :
scrollAnimU = scrollAnimV = ef.arg1;
Expand Down Expand Up @@ -1124,10 +1124,10 @@ namespace Ogre

}
//-----------------------------------------------------------------------
void MaterialSerializer::writeEnvironmentMapEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex)
void MaterialSerializer::writeEnvironmentMapEffect(TextureUnitState::EnvMapType type)
{
writeAttribute(4, "env_map");
switch (effect.subtype)
switch (type)
{
case TextureUnitState::ENV_PLANAR:
writeValue("planar");
Expand All @@ -1144,12 +1144,12 @@ namespace Ogre
}
}
//-----------------------------------------------------------------------
void MaterialSerializer::writeRotationEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex)
void MaterialSerializer::writeRotationEffect(float speed)
{
if (effect.arg1)
if (speed)
{
writeAttribute(4, "rotate_anim");
writeValue(StringConverter::toString(effect.arg1));
writeValue(StringConverter::toString(speed));
}
}
//-----------------------------------------------------------------------
Expand Down

0 comments on commit c1f1672

Please sign in to comment.