@@ -94,8 +94,8 @@ void Actor::InitState()
94
94
m_baseRotation = Rage::Vector3 ( 0 , 0 , 0 );
95
95
m_baseScale = Rage::Vector3 ( 1 , 1 , 1 );
96
96
m_fBaseAlpha = 1 ;
97
- m_internalDiffuse = RageColor ( 1 , 1 , 1 , 1 );
98
- m_internalGlow = RageColor ( 0 , 0 , 0 , 0 );
97
+ m_internalDiffuse = Rage::Color ( 1 , 1 , 1 , 1 );
98
+ m_internalGlow = Rage::Color ( 0 , 0 , 0 , 0 );
99
99
100
100
m_start.Init ();
101
101
m_current.Init ();
@@ -114,13 +114,13 @@ void Actor::InitState()
114
114
m_fEffectOffset = 0 ;
115
115
m_EffectClock = CLOCK_TIMER;
116
116
m_vEffectMagnitude = Rage::Vector3 (0 ,0 ,10 );
117
- m_effectColor1 = RageColor (1 ,1 ,1 ,1 );
118
- m_effectColor2 = RageColor (1 ,1 ,1 ,1 );
117
+ m_effectColor1 = Rage::Color (1 ,1 ,1 ,1 );
118
+ m_effectColor2 = Rage::Color (1 ,1 ,1 ,1 );
119
119
120
120
m_bVisible = true ;
121
121
m_fShadowLengthX = 0 ;
122
122
m_fShadowLengthY = 0 ;
123
- m_ShadowColor = RageColor (0 ,0 ,0 ,0 .5f );
123
+ m_ShadowColor = Rage::Color (0 ,0 ,0 ,0 .5f );
124
124
m_bIsAnimating = true ;
125
125
m_fHibernateSecondsLeft = 0 ;
126
126
m_iDrawOrder = 0 ;
@@ -330,8 +330,8 @@ void Actor::Draw()
330
330
m_FakeParent->BeginDraw ();
331
331
}
332
332
size_t wrapper_states_used= 0 ;
333
- RageColor last_diffuse;
334
- RageColor last_glow;
333
+ Rage::Color last_diffuse;
334
+ Rage::Color last_glow;
335
335
bool use_last_diffuse= false ;
336
336
// dont_abort_draw exists because if one of the layers is invisible,
337
337
// there's no point in continuing. -Kyz
@@ -417,7 +417,7 @@ void Actor::Draw()
417
417
418
418
void Actor::PostDraw () // reset internal diffuse and glow
419
419
{
420
- m_internalDiffuse = RageColor (1 , 1 , 1 , 1 );
420
+ m_internalDiffuse = Rage::Color (1 , 1 , 1 , 1 );
421
421
m_internalGlow.a = 0 ;
422
422
}
423
423
@@ -517,7 +517,7 @@ void Actor::PreDraw() // calculate actor properties
517
517
tempState.glow .a *= fOriginalAlpha ; // don't glow if the Actor is transparent!
518
518
break ;
519
519
case rainbow:
520
- tempState.diffuse [0 ] = RageColor (
520
+ tempState.diffuse [0 ] = Rage::Color (
521
521
RageFastCos ( fPercentBetweenColors *2 *PI ) * 0 .5f + 0 .5f ,
522
522
RageFastCos ( fPercentBetweenColors *2 *PI + PI * 2 .0f / 3 .0f ) * 0 .5f + 0 .5f ,
523
523
RageFastCos ( fPercentBetweenColors *2 *PI + PI * 4 .0f / 3 .0f ) * 0 .5f + 0 .5f ,
@@ -569,7 +569,7 @@ void Actor::PreDraw() // calculate actor properties
569
569
if ( m_fBaseAlpha != 1 )
570
570
m_internalDiffuse.a *= m_fBaseAlpha;
571
571
572
- if ( m_internalDiffuse != RageColor (1 , 1 , 1 , 1 ) )
572
+ if ( m_internalDiffuse != Rage::Color (1 , 1 , 1 , 1 ) )
573
573
{
574
574
if ( m_pTempState != &tempState )
575
575
{
@@ -1115,7 +1115,7 @@ void Actor::ResetEffectTimeIfDifferent(Effect new_effect)
1115
1115
}
1116
1116
}
1117
1117
1118
- void Actor::SetEffectDiffuseBlink ( float fEffectPeriodSeconds , RageColor c1, RageColor c2 )
1118
+ void Actor::SetEffectDiffuseBlink ( float fEffectPeriodSeconds , Rage::Color c1, Rage::Color c2 )
1119
1119
{
1120
1120
ASSERT ( fEffectPeriodSeconds > 0 );
1121
1121
// todo: account for SSC_FUTURES -aj
@@ -1125,7 +1125,7 @@ void Actor::SetEffectDiffuseBlink( float fEffectPeriodSeconds, RageColor c1, Rag
1125
1125
m_effectColor2 = c2;
1126
1126
}
1127
1127
1128
- void Actor::SetEffectDiffuseShift ( float fEffectPeriodSeconds , RageColor c1, RageColor c2 )
1128
+ void Actor::SetEffectDiffuseShift ( float fEffectPeriodSeconds , Rage::Color c1, Rage::Color c2 )
1129
1129
{
1130
1130
ASSERT ( fEffectPeriodSeconds > 0 );
1131
1131
// todo: account for SSC_FUTURES -aj
@@ -1135,7 +1135,7 @@ void Actor::SetEffectDiffuseShift( float fEffectPeriodSeconds, RageColor c1, Rag
1135
1135
m_effectColor2 = c2;
1136
1136
}
1137
1137
1138
- void Actor::SetEffectDiffuseRamp ( float fEffectPeriodSeconds , RageColor c1, RageColor c2 )
1138
+ void Actor::SetEffectDiffuseRamp ( float fEffectPeriodSeconds , Rage::Color c1, Rage::Color c2 )
1139
1139
{
1140
1140
ASSERT ( fEffectPeriodSeconds > 0 );
1141
1141
// todo: account for SSC_FUTURES -aj
@@ -1145,7 +1145,7 @@ void Actor::SetEffectDiffuseRamp( float fEffectPeriodSeconds, RageColor c1, Rage
1145
1145
m_effectColor2 = c2;
1146
1146
}
1147
1147
1148
- void Actor::SetEffectGlowBlink ( float fEffectPeriodSeconds , RageColor c1, RageColor c2 )
1148
+ void Actor::SetEffectGlowBlink ( float fEffectPeriodSeconds , Rage::Color c1, Rage::Color c2 )
1149
1149
{
1150
1150
ASSERT ( fEffectPeriodSeconds > 0 );
1151
1151
// todo: account for SSC_FUTURES -aj
@@ -1155,7 +1155,7 @@ void Actor::SetEffectGlowBlink( float fEffectPeriodSeconds, RageColor c1, RageCo
1155
1155
m_effectColor2 = c2;
1156
1156
}
1157
1157
1158
- void Actor::SetEffectGlowShift ( float fEffectPeriodSeconds , RageColor c1, RageColor c2 )
1158
+ void Actor::SetEffectGlowShift ( float fEffectPeriodSeconds , Rage::Color c1, Rage::Color c2 )
1159
1159
{
1160
1160
ASSERT ( fEffectPeriodSeconds > 0 );
1161
1161
// todo: account for SSC_FUTURES -aj
@@ -1165,7 +1165,7 @@ void Actor::SetEffectGlowShift( float fEffectPeriodSeconds, RageColor c1, RageCo
1165
1165
m_effectColor2 = c2;
1166
1166
}
1167
1167
1168
- void Actor::SetEffectGlowRamp ( float fEffectPeriodSeconds , RageColor c1, RageColor c2 )
1168
+ void Actor::SetEffectGlowRamp ( float fEffectPeriodSeconds , Rage::Color c1, Rage::Color c2 )
1169
1169
{
1170
1170
ASSERT ( fEffectPeriodSeconds > 0 );
1171
1171
// todo: account for SSC_FUTURES -aj
@@ -1309,7 +1309,7 @@ float Actor::GetTweenTimeLeft() const
1309
1309
* we can simply say eg. "for x in states(Actor) do x.SetDiffuseColor(c) end".
1310
1310
* However, we'd then have to give every TweenState a userdata in Lua while it's
1311
1311
* being manipulated, which would add overhead ... */
1312
- void Actor::SetGlobalDiffuseColor ( RageColor c )
1312
+ void Actor::SetGlobalDiffuseColor ( Rage::Color c )
1313
1313
{
1314
1314
for ( int i=0 ; i<NUM_DIFFUSE_COLORS; i++ ) // color, not alpha
1315
1315
{
@@ -1328,7 +1328,7 @@ void Actor::SetGlobalDiffuseColor( RageColor c )
1328
1328
}
1329
1329
}
1330
1330
1331
- void Actor::SetDiffuseColor ( RageColor c )
1331
+ void Actor::SetDiffuseColor ( Rage::Color c )
1332
1332
{
1333
1333
for ( int i=0 ; i<NUM_DIFFUSE_COLORS; i++ )
1334
1334
{
@@ -1350,8 +1350,8 @@ void Actor::TweenState::Init()
1350
1350
crop = RectF ( 0 ,0 ,0 ,0 );
1351
1351
fade = RectF ( 0 ,0 ,0 ,0 );
1352
1352
for ( int i=0 ; i<NUM_DIFFUSE_COLORS; i++ )
1353
- diffuse[i] = RageColor ( 1 , 1 , 1 , 1 );
1354
- glow = RageColor ( 1 , 1 , 1 , 0 );
1353
+ diffuse[i] = Rage::Color ( 1 , 1 , 1 , 1 );
1354
+ glow = Rage::Color ( 1 , 1 , 1 , 0 );
1355
1355
aux = 0 ;
1356
1356
}
1357
1357
@@ -1644,18 +1644,88 @@ class LunaActor : public Luna<Actor>
1644
1644
static int fadetop ( T* p, lua_State *L ) { p->SetFadeTop (FArg (1 )); COMMON_RETURN_SELF; }
1645
1645
static int faderight ( T* p, lua_State *L ) { p->SetFadeRight (FArg (1 )); COMMON_RETURN_SELF; }
1646
1646
static int fadebottom ( T* p, lua_State *L ) { p->SetFadeBottom (FArg (1 )); COMMON_RETURN_SELF; }
1647
- static int diffuse ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetDiffuse ( c ); COMMON_RETURN_SELF; }
1648
- static int diffuseupperleft ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetDiffuseUpperLeft ( c ); COMMON_RETURN_SELF; }
1649
- static int diffuseupperright ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetDiffuseUpperRight ( c ); COMMON_RETURN_SELF; }
1650
- static int diffuselowerleft ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetDiffuseLowerLeft ( c ); COMMON_RETURN_SELF; }
1651
- static int diffuselowerright ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetDiffuseLowerRight ( c ); COMMON_RETURN_SELF; }
1652
- static int diffuseleftedge ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetDiffuseLeftEdge ( c ); COMMON_RETURN_SELF; }
1653
- static int diffuserightedge ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetDiffuseRightEdge ( c ); COMMON_RETURN_SELF; }
1654
- static int diffusetopedge ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetDiffuseTopEdge ( c ); COMMON_RETURN_SELF; }
1655
- static int diffusebottomedge ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetDiffuseBottomEdge ( c ); COMMON_RETURN_SELF; }
1656
- static int diffusealpha ( T* p, lua_State *L ) { p->SetDiffuseAlpha (FArg (1 )); COMMON_RETURN_SELF; }
1657
- static int diffusecolor ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetDiffuseColor ( c ); COMMON_RETURN_SELF; }
1658
- static int glow ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetGlow ( c ); COMMON_RETURN_SELF; }
1647
+ static int diffuse ( T* p, lua_State *L )
1648
+ {
1649
+ Rage::Color c;
1650
+ FromStackCompat ( c, L, 1 );
1651
+ p->SetDiffuse ( c );
1652
+ COMMON_RETURN_SELF;
1653
+ }
1654
+ static int diffuseupperleft ( T* p, lua_State *L )
1655
+ {
1656
+ Rage::Color c;
1657
+ FromStackCompat ( c, L, 1 );
1658
+ p->SetDiffuseUpperLeft ( c );
1659
+ COMMON_RETURN_SELF;
1660
+ }
1661
+ static int diffuseupperright ( T* p, lua_State *L )
1662
+ {
1663
+ Rage::Color c;
1664
+ FromStackCompat ( c, L, 1 );
1665
+ p->SetDiffuseUpperRight ( c );
1666
+ COMMON_RETURN_SELF;
1667
+ }
1668
+ static int diffuselowerleft ( T* p, lua_State *L )
1669
+ {
1670
+ Rage::Color c;
1671
+ FromStackCompat ( c, L, 1 );
1672
+ p->SetDiffuseLowerLeft ( c );
1673
+ COMMON_RETURN_SELF;
1674
+ }
1675
+ static int diffuselowerright ( T* p, lua_State *L )
1676
+ {
1677
+ Rage::Color c;
1678
+ FromStackCompat ( c, L, 1 );
1679
+ p->SetDiffuseLowerRight ( c );
1680
+ COMMON_RETURN_SELF;
1681
+ }
1682
+ static int diffuseleftedge ( T* p, lua_State *L )
1683
+ {
1684
+ Rage::Color c;
1685
+ FromStackCompat ( c, L, 1 );
1686
+ p->SetDiffuseLeftEdge ( c );
1687
+ COMMON_RETURN_SELF;
1688
+ }
1689
+ static int diffuserightedge ( T* p, lua_State *L )
1690
+ {
1691
+ Rage::Color c;
1692
+ FromStackCompat ( c, L, 1 );
1693
+ p->SetDiffuseRightEdge ( c );
1694
+ COMMON_RETURN_SELF;
1695
+ }
1696
+ static int diffusetopedge ( T* p, lua_State *L )
1697
+ {
1698
+ Rage::Color c;
1699
+ FromStackCompat ( c, L, 1 );
1700
+ p->SetDiffuseTopEdge ( c );
1701
+ COMMON_RETURN_SELF;
1702
+ }
1703
+ static int diffusebottomedge ( T* p, lua_State *L )
1704
+ {
1705
+ Rage::Color c;
1706
+ FromStackCompat ( c, L, 1 );
1707
+ p->SetDiffuseBottomEdge ( c );
1708
+ COMMON_RETURN_SELF;
1709
+ }
1710
+ static int diffusealpha ( T* p, lua_State *L )
1711
+ {
1712
+ p->SetDiffuseAlpha (FArg (1 ));
1713
+ COMMON_RETURN_SELF;
1714
+ }
1715
+ static int diffusecolor ( T* p, lua_State *L )
1716
+ {
1717
+ Rage::Color c;
1718
+ FromStackCompat ( c, L, 1 );
1719
+ p->SetDiffuseColor ( c );
1720
+ COMMON_RETURN_SELF;
1721
+ }
1722
+ static int glow ( T* p, lua_State *L )
1723
+ {
1724
+ Rage::Color c;
1725
+ FromStackCompat ( c, L, 1 );
1726
+ p->SetGlow ( c );
1727
+ COMMON_RETURN_SELF;
1728
+ }
1659
1729
static int aux ( T* p, lua_State *L ) { p->SetAux ( FArg (1 ) ); COMMON_RETURN_SELF; }
1660
1730
static int getaux ( T* p, lua_State *L ) { lua_pushnumber ( L, p->GetAux () ); return 1 ; }
1661
1731
static int rotationx ( T* p, lua_State *L ) { p->SetRotationX (FArg (1 )); COMMON_RETURN_SELF; }
@@ -1676,17 +1746,23 @@ class LunaActor : public Luna<Actor>
1676
1746
static int shadowlength ( T* p, lua_State *L ) { p->SetShadowLength (FArg (1 )); COMMON_RETURN_SELF; }
1677
1747
static int shadowlengthx ( T* p, lua_State *L ) { p->SetShadowLengthX (FArg (1 )); COMMON_RETURN_SELF; }
1678
1748
static int shadowlengthy ( T* p, lua_State *L ) { p->SetShadowLengthY (FArg (1 )); COMMON_RETURN_SELF; }
1679
- static int shadowcolor ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetShadowColor ( c ); COMMON_RETURN_SELF; }
1749
+ static int shadowcolor ( T* p, lua_State *L )
1750
+ {
1751
+ Rage::Color c;
1752
+ FromStackCompat ( c, L, 1 );
1753
+ p->SetShadowColor ( c );
1754
+ COMMON_RETURN_SELF;
1755
+ }
1680
1756
static int horizalign ( T* p, lua_State *L ) { p->SetHorizAlign (Enum::Check<HorizAlign>(L, 1 )); COMMON_RETURN_SELF; }
1681
1757
static int vertalign ( T* p, lua_State *L ) { p->SetVertAlign (Enum::Check<VertAlign>(L, 1 )); COMMON_RETURN_SELF; }
1682
1758
static int halign ( T* p, lua_State *L ) { p->SetHorizAlign (FArg (1 )); COMMON_RETURN_SELF; }
1683
1759
static int valign ( T* p, lua_State *L ) { p->SetVertAlign (FArg (1 )); COMMON_RETURN_SELF; }
1684
- static int diffuseblink ( T* p, lua_State *L ) { p->SetEffectDiffuseBlink (1 .0f , RageColor (0 .5f ,0 .5f ,0 .5f ,0 .5f ), RageColor (1 ,1 ,1 ,1 )); COMMON_RETURN_SELF; }
1685
- static int diffuseshift ( T* p, lua_State *L ) { p->SetEffectDiffuseShift (1 .0f , RageColor (0 ,0 ,0 ,1 ), RageColor (1 ,1 ,1 ,1 )); COMMON_RETURN_SELF; }
1686
- static int diffuseramp ( T* p, lua_State *L ) { p->SetEffectDiffuseRamp (1 .0f , RageColor (0 ,0 ,0 ,1 ), RageColor (1 ,1 ,1 ,1 )); COMMON_RETURN_SELF; }
1687
- static int glowblink ( T* p, lua_State *L ) { p->SetEffectGlowBlink (1 .0f , RageColor (1 ,1 ,1 ,0 .2f ), RageColor (1 ,1 ,1 ,0 .8f )); COMMON_RETURN_SELF; }
1688
- static int glowshift ( T* p, lua_State *L ) { p->SetEffectGlowShift (1 .0f , RageColor (1 ,1 ,1 ,0 .2f ), RageColor (1 ,1 ,1 ,0 .8f )); COMMON_RETURN_SELF; }
1689
- static int glowramp ( T* p, lua_State *L ) { p->SetEffectGlowRamp (1 .0f , RageColor (1 ,1 ,1 ,0 .2f ), RageColor (1 ,1 ,1 ,0 .8f )); COMMON_RETURN_SELF; }
1760
+ static int diffuseblink ( T* p, lua_State *L ) { p->SetEffectDiffuseBlink (1 .0f , Rage::Color (0 .5f ,0 .5f ,0 .5f ,0 .5f ), Rage::Color (1 ,1 ,1 ,1 )); COMMON_RETURN_SELF; }
1761
+ static int diffuseshift ( T* p, lua_State *L ) { p->SetEffectDiffuseShift (1 .0f , Rage::Color (0 ,0 ,0 ,1 ), Rage::Color (1 ,1 ,1 ,1 )); COMMON_RETURN_SELF; }
1762
+ static int diffuseramp ( T* p, lua_State *L ) { p->SetEffectDiffuseRamp (1 .0f , Rage::Color (0 ,0 ,0 ,1 ), Rage::Color (1 ,1 ,1 ,1 )); COMMON_RETURN_SELF; }
1763
+ static int glowblink ( T* p, lua_State *L ) { p->SetEffectGlowBlink (1 .0f , Rage::Color (1 ,1 ,1 ,0 .2f ), Rage::Color (1 ,1 ,1 ,0 .8f )); COMMON_RETURN_SELF; }
1764
+ static int glowshift ( T* p, lua_State *L ) { p->SetEffectGlowShift (1 .0f , Rage::Color (1 ,1 ,1 ,0 .2f ), Rage::Color (1 ,1 ,1 ,0 .8f )); COMMON_RETURN_SELF; }
1765
+ static int glowramp ( T* p, lua_State *L ) { p->SetEffectGlowRamp (1 .0f , Rage::Color (1 ,1 ,1 ,0 .2f ), Rage::Color (1 ,1 ,1 ,0 .8f )); COMMON_RETURN_SELF; }
1690
1766
static int rainbow ( T* p, lua_State *L ) { p->SetEffectRainbow (2 .0f ); COMMON_RETURN_SELF; }
1691
1767
static int wag ( T* p, lua_State *L ) { p->SetEffectWag (2 .0f , Rage::Vector3 (0 ,0 ,20 )); COMMON_RETURN_SELF; }
1692
1768
static int bounce ( T* p, lua_State *L ) { p->SetEffectBounce (2 .0f , Rage::Vector3 (0 ,20 ,0 )); COMMON_RETURN_SELF; }
@@ -1695,8 +1771,20 @@ class LunaActor : public Luna<Actor>
1695
1771
static int spin ( T* p, lua_State *L ) { p->SetEffectSpin (Rage::Vector3 (0 ,0 ,180 )); COMMON_RETURN_SELF; }
1696
1772
static int vibrate ( T* p, lua_State *L ) { p->SetEffectVibrate (Rage::Vector3 (10 ,10 ,10 )); COMMON_RETURN_SELF; }
1697
1773
static int stopeffect ( T* p, lua_State *L ) { p->StopEffect (); COMMON_RETURN_SELF; }
1698
- static int effectcolor1 ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetEffectColor1 ( c ); COMMON_RETURN_SELF; }
1699
- static int effectcolor2 ( T* p, lua_State *L ) { RageColor c; c.FromStackCompat ( L, 1 ); p->SetEffectColor2 ( c ); COMMON_RETURN_SELF; }
1774
+ static int effectcolor1 ( T* p, lua_State *L )
1775
+ {
1776
+ Rage::Color c;
1777
+ FromStackCompat ( c, L, 1 );
1778
+ p->SetEffectColor1 ( c );
1779
+ COMMON_RETURN_SELF;
1780
+ }
1781
+ static int effectcolor2 ( T* p, lua_State *L )
1782
+ {
1783
+ Rage::Color c;
1784
+ FromStackCompat ( c, L, 1 );
1785
+ p->SetEffectColor2 ( c );
1786
+ COMMON_RETURN_SELF;
1787
+ }
1700
1788
static int effectperiod ( T* p, lua_State *L )
1701
1789
{
1702
1790
float fPeriod = FArg (1 );
0 commit comments