Use SM_ALIGN. Cleanup spacing.
This commit is contained in:
+11
-10
@@ -93,12 +93,12 @@ public:
|
|||||||
friend RageVector4 operator * ( float f, const RageVector4& other ) { return other*f; }
|
friend RageVector4 operator * ( float f, const RageVector4& other ) { return other*f; }
|
||||||
|
|
||||||
float x, y, z, w;
|
float x, y, z, w;
|
||||||
} ALIGN(16);
|
} SM_ALIGN(16);
|
||||||
|
|
||||||
struct RageColor
|
struct RageColor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RageColor() {}
|
RageColor() : r(0), g(0), b(0), a(0) {}
|
||||||
RageColor( const float * f ) { r=f[0]; g=f[1]; b=f[2]; a=f[3]; }
|
RageColor( const float * f ) { r=f[0]; g=f[1]; b=f[2]; a=f[3]; }
|
||||||
RageColor( float r1, float g1, float b1, float a1 ) { r=r1; g=g1; b=b1; a=a1; }
|
RageColor( float r1, float g1, float b1, float a1 ) { r=r1; g=g1; b=b1; a=a1; }
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ public:
|
|||||||
RageColor& operator *= ( float f ) { r*=f; g*=f; b*=f; a*=f; return *this; }
|
RageColor& operator *= ( float f ) { r*=f; g*=f; b*=f; a*=f; return *this; }
|
||||||
/* Divide is rarely useful: you can always use multiplication, and you don't have to
|
/* Divide is rarely useful: you can always use multiplication, and you don't have to
|
||||||
* worry about div/0. */
|
* worry about div/0. */
|
||||||
// RageColor& operator /= ( float f ) { r/=f; g/=f; b/=f; a/=f; return *this; }
|
// RageColor& operator /= ( float f ) { r/=f; g/=f; b/=f; a/=f; return *this; }
|
||||||
|
|
||||||
// binary operators
|
// binary operators
|
||||||
RageColor operator + ( const RageColor& other ) const { return RageColor( r+other.r, g+other.g, b+other.b, a+other.a ); }
|
RageColor operator + ( const RageColor& other ) const { return RageColor( r+other.r, g+other.g, b+other.b, a+other.a ); }
|
||||||
@@ -155,7 +155,7 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
float r, g, b, a;
|
float r, g, b, a;
|
||||||
} ALIGN(16);
|
} SM_ALIGN(16);
|
||||||
|
|
||||||
/* Convert floating-point 0..1 value to integer 0..255 value. *
|
/* Convert floating-point 0..1 value to integer 0..255 value. *
|
||||||
*
|
*
|
||||||
@@ -196,13 +196,14 @@ public:
|
|||||||
|
|
||||||
RageVColor() { }
|
RageVColor() { }
|
||||||
RageVColor(const RageColor &rc) { *this = rc; }
|
RageVColor(const RageColor &rc) { *this = rc; }
|
||||||
RageVColor &operator= (const RageColor &rc) {
|
RageVColor &operator= (const RageColor &rc)
|
||||||
|
{
|
||||||
r = FTOC(rc.r); g = FTOC(rc.g); b = FTOC(rc.b); a = FTOC(rc.a);
|
r = FTOC(rc.r); g = FTOC(rc.g); b = FTOC(rc.b); a = FTOC(rc.a);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace SM
|
namespace StepMania
|
||||||
{
|
{
|
||||||
template <class T>
|
template <class T>
|
||||||
class Rect
|
class Rect
|
||||||
@@ -218,7 +219,7 @@ public:
|
|||||||
|
|
||||||
bool operator==( const Rect &other ) const
|
bool operator==( const Rect &other ) const
|
||||||
{
|
{
|
||||||
#define COMPARE( x ) if( x != other.x ) return false;
|
#define COMPARE( x ) if( x != other.x ) return false
|
||||||
COMPARE( left );
|
COMPARE( left );
|
||||||
COMPARE( top );
|
COMPARE( top );
|
||||||
COMPARE( right );
|
COMPARE( right );
|
||||||
@@ -231,8 +232,8 @@ public:
|
|||||||
T left, top, right, bottom;
|
T left, top, right, bottom;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
typedef SM::Rect<int> RectI;
|
typedef StepMania::Rect<int> RectI;
|
||||||
typedef SM::Rect<float> RectF;
|
typedef StepMania::Rect<float> RectF;
|
||||||
|
|
||||||
/* Structure for our custom vertex type. Note that these data structes
|
/* Structure for our custom vertex type. Note that these data structes
|
||||||
* have the same layout that D3D expects. */
|
* have the same layout that D3D expects. */
|
||||||
@@ -290,7 +291,7 @@ public:
|
|||||||
RageMatrix GetTranspose() const;
|
RageMatrix GetTranspose() const;
|
||||||
|
|
||||||
float m[4][4];
|
float m[4][4];
|
||||||
} ALIGN(16);
|
} SM_ALIGN(16);
|
||||||
|
|
||||||
RageColor scale( float x, float l1, float h1, const RageColor &a, const RageColor &b );
|
RageColor scale( float x, float l1, float h1, const RageColor &a, const RageColor &b );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user