Skip to content

Commit

Permalink
Main: TextureUnitState - texture matrix will be always float
Browse files Browse the repository at this point in the history
reflect that in the argument types
  • Loading branch information
paroj committed Aug 20, 2024
1 parent 38836c1 commit 835add4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
40 changes: 20 additions & 20 deletions OgreMain/include/OgreTextureUnitState.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,13 @@ namespace Ogre {
*/
struct TextureEffect {
TextureEffectType type;
Real arg1, arg2;
float arg1, arg2;
int subtype;
WaveformType waveType;
Real base;
Real frequency;
Real phase;
Real amplitude;
float base;
float frequency;
float phase;
float amplitude;
ControllerFloat* controller;
const Frustum* frustum;
};
Expand Down Expand Up @@ -587,31 +587,31 @@ namespace Ogre {
@param v
The amount the texture should be moved vertically (v direction).
*/
void setTextureScroll(Real u, Real v);
void setTextureScroll(float u, float v);

/** As setTextureScroll, but sets only U value.
*/
void setTextureUScroll(Real value);
void setTextureUScroll(float value);
/// Get texture uscroll value.
Real getTextureUScroll(void) const;
float getTextureUScroll(void) const;

/** As setTextureScroll, but sets only V value.
*/
void setTextureVScroll(Real value);
void setTextureVScroll(float value);
/// Get texture vscroll value.
Real getTextureVScroll(void) const;
float getTextureVScroll(void) const;

/** As setTextureScale, but sets only U value.
*/
void setTextureUScale(Real value);
void setTextureUScale(float value);
/// Get texture uscale value.
Real getTextureUScale(void) const;
float getTextureUScale(void) const;

/** As setTextureScale, but sets only V value.
*/
void setTextureVScale(Real value);
void setTextureVScale(float value);
/// Get texture vscale value.
Real getTextureVScale(void) const;
float getTextureVScale(void) const;

/** Sets the scaling factor applied to texture coordinates.
Expand All @@ -624,7 +624,7 @@ namespace Ogre {
@param vScale
The value by which the texture is to be scaled vertically.
*/
void setTextureScale(Real uScale, Real vScale);
void setTextureScale(float uScale, float vScale);

/** Sets the anticlockwise rotation factor applied to texture coordinates.
Expand Down Expand Up @@ -894,15 +894,15 @@ namespace Ogre {
@param vSpeed
The number of vertical loops per second (+ve=moving up, -ve= moving down).
*/
void setScrollAnimation(Real uSpeed, Real vSpeed);
void setScrollAnimation(float uSpeed, float vSpeed);

/** Sets up an animated texture rotation for this layer.
Useful for constant rotations (for varying rotations, see Ogre::TextureUnitState::setTransformAnimation).
@param speed
The number of complete anticlockwise revolutions per second (use -ve for clockwise)
*/
void setRotateAnimation(Real speed);
void setRotateAnimation(float speed);

/** Sets up a general time-relative texture modification effect.
Expand All @@ -922,7 +922,7 @@ namespace Ogre {
Scales the output so that instead of lying within 0..1 it lies within 0..1*amplitude for exaggerated effects.
*/
void setTransformAnimation( const TextureTransformType ttype,
const WaveformType waveType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1 );
const WaveformType waveType, float base = 0, float frequency = 1, float phase = 0, float amplitude = 1 );


/** Enables or disables projective texturing on this texture unit.
Expand Down Expand Up @@ -1077,8 +1077,8 @@ namespace Ogre {

LayerBlendModeEx mAlphaBlendMode;
Real mGamma;
Real mUMod, mVMod;
Real mUScale, mVScale;
float mUMod, mVMod;
float mUScale, mVScale;
Radian mRotate;
mutable Matrix4 mTexModMatrix;

Expand Down
26 changes: 13 additions & 13 deletions OgreMain/src/OgreTextureUnitState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,14 +712,14 @@ namespace Ogre {
mRecalcTexMatrix = false;
}
//-----------------------------------------------------------------------
void TextureUnitState::setTextureScroll(Real u, Real v)
void TextureUnitState::setTextureScroll(float u, float v)
{
mUMod = u;
mVMod = v;
mRecalcTexMatrix = true;
}
//-----------------------------------------------------------------------
void TextureUnitState::setTextureScale(Real uScale, Real vScale)
void TextureUnitState::setTextureScale(float uScale, float vScale)
{
mUScale = uScale;
mVScale = vScale;
Expand Down Expand Up @@ -785,31 +785,31 @@ namespace Ogre {

}
//-----------------------------------------------------------------------
void TextureUnitState::setTextureUScroll(Real value)
void TextureUnitState::setTextureUScroll(float value)
{
mUMod = value;
mRecalcTexMatrix = true;
}
//-----------------------------------------------------------------------
void TextureUnitState::setTextureVScroll(Real value)
void TextureUnitState::setTextureVScroll(float value)
{
mVMod = value;
mRecalcTexMatrix = true;
}
//-----------------------------------------------------------------------
void TextureUnitState::setTextureUScale(Real value)
void TextureUnitState::setTextureUScale(float value)
{
mUScale = value;
mRecalcTexMatrix = true;
}
//-----------------------------------------------------------------------
void TextureUnitState::setTextureVScale(Real value)
void TextureUnitState::setTextureVScale(float value)
{
mVScale = value;
mRecalcTexMatrix = true;
}
//-----------------------------------------------------------------------
void TextureUnitState::setScrollAnimation(Real uSpeed, Real vSpeed)
void TextureUnitState::setScrollAnimation(float uSpeed, float vSpeed)
{
// Remove existing effects
removeEffect(ET_UVSCROLL);
Expand Down Expand Up @@ -840,7 +840,7 @@ namespace Ogre {
}
}
//-----------------------------------------------------------------------
void TextureUnitState::setRotateAnimation(Real speed)
void TextureUnitState::setRotateAnimation(float speed)
{
// Remove existing effect
removeEffect(ET_ROTATE);
Expand All @@ -854,7 +854,7 @@ namespace Ogre {
}
//-----------------------------------------------------------------------
void TextureUnitState::setTransformAnimation(TextureTransformType ttype,
WaveformType waveType, Real base, Real frequency, Real phase, Real amplitude)
WaveformType waveType, float base, float frequency, float phase, float amplitude)
{
// Remove existing effect
// note, only remove for subtype, not entire ET_TRANSFORM
Expand Down Expand Up @@ -1074,25 +1074,25 @@ namespace Ogre {
}
}
//-----------------------------------------------------------------------
Real TextureUnitState::getTextureUScroll(void) const
float TextureUnitState::getTextureUScroll(void) const
{
return mUMod;
}

//-----------------------------------------------------------------------
Real TextureUnitState::getTextureVScroll(void) const
float TextureUnitState::getTextureVScroll(void) const
{
return mVMod;
}

//-----------------------------------------------------------------------
Real TextureUnitState::getTextureUScale(void) const
float TextureUnitState::getTextureUScale(void) const
{
return mUScale;
}

//-----------------------------------------------------------------------
Real TextureUnitState::getTextureVScale(void) const
float TextureUnitState::getTextureVScale(void) const
{
return mVScale;
}
Expand Down

0 comments on commit 835add4

Please sign in to comment.