Added set_use_effect_clock_for_texcoords to Sprite. Updated changelog.

This commit is contained in:
Kyzentun Keeslala
2015-09-21 20:42:56 -06:00
parent 731bc0984a
commit a10c0c4f01
5 changed files with 64 additions and 9 deletions
+26
View File
@@ -5,6 +5,32 @@ from StepMania 4 alpha 5 to sm-ssc v1.2.5, see Changelog_sm-ssc.txt.
________________________________________________________________________________
2015/09/21
----------
* [Sprite] Added set_use_effect_clock_for_texcoords for toggling whether the
tex coord velocity uses the effect clock instead of the time.
2015/09/10
----------
* [MusicWheel] Fixed SetItemPosition so that it actually passes the item
index and the number of items to the transform function. [kyzentun]
2015/09/09
----------
* [Notefield] Fixed bug where the hold body doesn't scroll if it goes off the
top of the screen. [waiei]
2015/09/08
----------
* [Compiling] Compiling stepmania on Windows with the locale set to Japanese
should work now. [wolfman]
2015/09/06
----------
* [Preferences] Fixed crash on Advanced Input Options on OS X caused by the
Axis Fix preference not existing on OS X. The preference does nothing on
OS X, but the game no longer crashes on that screen. [kyzentun]
2015/09/03
----------
* [Fonts] Respliced large kanji sprite sheets from 32x106 and 32x61 to 63x54
+2
View File
@@ -1699,10 +1699,12 @@
<Function name='addimagecoords'/>
<Function name='cropto'/>
<Function name='customtexturerect'/>
<Function name='get_use_effect_clock_for_texcoords'/>
<Function name='loop'/>
<Function name='position'/>
<Function name='rate'/>
<Function name='scaletoclipped'/>
<Function name='set_use_effect_clock_for_texcoords'/>
<Function name='setstate'/>
<Function name='stretchtexcoords'/>
<Function name='texcoordvelocity'/>
+7 -1
View File
@@ -4969,6 +4969,9 @@ save yourself some time, copy this for undocumented things:
<Function name='customtexturerect' return='void' arguments='float fLeft, float fTop, float fRight, float fBottom'>
Allows the themer to set a custom texture rectangle that effects the way the texture is drawn.
</Function>
<Function name='get_use_effect_clock_for_texcoords' return='bool' arguments=''>
Returns true if the sprite is using the effect clock for texcoordvelocity.
</Function>
<Function name='loop' theme='_fallback' return='void' arguments='bool bLoop'>
[02 Sprite.lua] Call <Link class='RageTexture' function='loop'><code>RageTexture:loop</code></Link><code>( bLoop )</code> on the texture.
</Function>
@@ -4984,11 +4987,14 @@ save yourself some time, copy this for undocumented things:
<Function name='setstate' return='void' arguments='int iNewState'>
Set the Sprite's state to <code>iNewState</code>.
</Function>
<Function name='set_use_effect_clock_for_texcoords' return='' arguments='bool use'>
If <code>use</code> is true, then the sprite will use the effect clock for texcoordvelocity.
</Function>
<Function name='stretchtexcoords' return='void' arguments='float fX, float fY'>
<!-- XXX: What does this do? -->
</Function>
<Function name='texcoordvelocity' return='void' arguments='float fVelX, float fVelY'>
Set the texture coordinate velocity which controls how the Sprite changes as it animates. <!-- XXX: Can we be more specific? -->
Set the texture coordinate velocity which controls how the Sprite changes as it animates. A velocity of 1 makes the texture scroll all the way once per second.
</Function>
<!-- sm-ssc addons -->
<Function name='CropTo' return='void' arguments='float fWidth, float fHeight'>
+27 -8
View File
@@ -36,6 +36,7 @@ Sprite::Sprite()
m_fTexCoordVelocityX = 0;
m_fTexCoordVelocityY = 0;
m_use_effect_clock_for_texcoords= false;
}
// NoteSkinManager needs a sprite with a texture set to return in cases where
@@ -74,6 +75,7 @@ Sprite::Sprite( const Sprite &cpy ):
CPY( m_fRememberedClipHeight );
CPY( m_fTexCoordVelocityX );
CPY( m_fTexCoordVelocityY );
CPY(m_use_effect_clock_for_texcoords);
#undef CPY
if( cpy.m_pTexture != NULL )
@@ -426,18 +428,23 @@ void Sprite::Update( float fDelta )
// update scrolling
if( m_fTexCoordVelocityX != 0 || m_fTexCoordVelocityY != 0 )
{
float coord_delta= fDelta;
if(m_use_effect_clock_for_texcoords)
{
coord_delta= fTimePassed;
}
float fTexCoords[8];
Sprite::GetActiveTextureCoords( fTexCoords );
// top left, bottom left, bottom right, top right
fTexCoords[0] += fDelta*m_fTexCoordVelocityX;
fTexCoords[1] += fDelta*m_fTexCoordVelocityY;
fTexCoords[2] += fDelta*m_fTexCoordVelocityX;
fTexCoords[3] += fDelta*m_fTexCoordVelocityY;
fTexCoords[4] += fDelta*m_fTexCoordVelocityX;
fTexCoords[5] += fDelta*m_fTexCoordVelocityY;
fTexCoords[6] += fDelta*m_fTexCoordVelocityX;
fTexCoords[7] += fDelta*m_fTexCoordVelocityY;
fTexCoords[0] += coord_delta * m_fTexCoordVelocityX;
fTexCoords[1] += coord_delta * m_fTexCoordVelocityY;
fTexCoords[2] += coord_delta * m_fTexCoordVelocityX;
fTexCoords[3] += coord_delta * m_fTexCoordVelocityY;
fTexCoords[4] += coord_delta * m_fTexCoordVelocityX;
fTexCoords[5] += coord_delta * m_fTexCoordVelocityY;
fTexCoords[6] += coord_delta * m_fTexCoordVelocityX;
fTexCoords[7] += coord_delta * m_fTexCoordVelocityY;
/* When wrapping, avoid gradual loss of precision and sending
* unreasonably large texture coordinates to the renderer by pushing
@@ -1110,6 +1117,16 @@ public:
}
static int StopUsingCustomPosCoords( T* p, lua_State *L ) { p->StopUsingCustomPosCoords(); COMMON_RETURN_SELF; }
static int texcoordvelocity( T* p, lua_State *L ) { p->SetTexCoordVelocity( FArg(1),FArg(2) ); COMMON_RETURN_SELF; }
static int get_use_effect_clock_for_texcoords(T* p, lua_State* L)
{
lua_pushboolean(L, p->m_use_effect_clock_for_texcoords);
return 1;
}
static int set_use_effect_clock_for_texcoords(T* p, lua_State* L)
{
p->m_use_effect_clock_for_texcoords= BArg(1);
COMMON_RETURN_SELF;
}
static int scaletoclipped( T* p, lua_State *L ) { p->ScaleToClipped( FArg(1),FArg(2) ); COMMON_RETURN_SELF; }
static int CropTo( T* p, lua_State *L ) { p->CropTo( FArg(1),FArg(2) ); COMMON_RETURN_SELF; }
static int stretchtexcoords( T* p, lua_State *L ) { p->StretchTexCoords( FArg(1),FArg(2) ); COMMON_RETURN_SELF; }
@@ -1240,6 +1257,8 @@ public:
ADD_METHOD( SetCustomPosCoords );
ADD_METHOD( StopUsingCustomPosCoords );
ADD_METHOD( texcoordvelocity );
ADD_METHOD(get_use_effect_clock_for_texcoords);
ADD_METHOD(set_use_effect_clock_for_texcoords);
ADD_METHOD( scaletoclipped );
ADD_METHOD( CropTo );
ADD_METHOD( stretchtexcoords );
+2
View File
@@ -94,6 +94,8 @@ public:
bool m_DecodeMovie;
bool m_use_effect_clock_for_texcoords;
protected:
void LoadFromTexture( RageTextureID ID );