Changed internal naming convention (local variables now start with a lower case character)

Removed the AudioResource class

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1166 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2009-07-11 22:17:24 +00:00
parent 7cc00085d8
commit 45b150648d
245 changed files with 7865 additions and 8065 deletions

View file

@ -50,53 +50,13 @@ public :
////////////////////////////////////////////////////////////
/// Construct the color from its 4 RGBA components
///
/// \param R : Red component (0 .. 255)
/// \param G : Green component (0 .. 255)
/// \param B : Blue component (0 .. 255)
/// \param A : Alpha component (0 .. 255) (255 by default)
/// \param red : Red component (0 .. 255)
/// \param green : Green component (0 .. 255)
/// \param blue : Blue component (0 .. 255)
/// \param alpha : Alpha (opacity) component (0 .. 255) (255 by default)
///
////////////////////////////////////////////////////////////
Color(Uint8 R, Uint8 G, Uint8 B, Uint8 A = 255);
////////////////////////////////////////////////////////////
/// Operator += overload to add a color
///
/// \param Other : Color to add
///
/// \return Component-wise saturated addition of the two colors
///
////////////////////////////////////////////////////////////
Color& operator +=(const Color& Other);
////////////////////////////////////////////////////////////
/// Operator *= overload to modulate a color
///
/// \param Other : Color to modulate
///
/// \return Component-wise multiplication of the two colors
///
////////////////////////////////////////////////////////////
Color& operator *=(const Color& Other);
////////////////////////////////////////////////////////////
/// Compare two colors (for equality)
///
/// \param Other : Color to compare
///
/// \return True if colors are equal
///
////////////////////////////////////////////////////////////
bool operator ==(const Color& Other) const;
////////////////////////////////////////////////////////////
/// Compare two colors (for difference)
///
/// \param Other : Color to compare
///
/// \return True if colors are different
///
////////////////////////////////////////////////////////////
bool operator !=(const Color& Other) const;
Color(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha = 255);
////////////////////////////////////////////////////////////
// Static member data
@ -119,27 +79,71 @@ public :
Uint8 a; ///< Alpha (transparency) component
};
////////////////////////////////////////////////////////////
/// Compare two colors (for equality)
///
/// \param left : Left operand
/// \param right : Right operand
///
/// \return True if colors are equal
///
////////////////////////////////////////////////////////////
bool operator ==(const Color& left, const Color& right);
////////////////////////////////////////////////////////////
/// Compare two colors (for difference)
///
/// \param left : Left operand
/// \param right : Right operand
///
/// \return True if colors are different
///
////////////////////////////////////////////////////////////
bool operator !=(const Color& left, const Color& right);
////////////////////////////////////////////////////////////
/// Operator + overload to add two colors
///
/// \param Color1 : First color
/// \param Color2 : Second color
/// \param left : Left operand
/// \param right : Right operand
///
/// \return Component-wise saturated addition of the two colors
///
////////////////////////////////////////////////////////////
SFML_API Color operator +(const Color& Color1, const Color& Color2);
SFML_API Color operator +(const Color& left, const Color& right);
////////////////////////////////////////////////////////////
/// Operator * overload to modulate two colors
///
/// \param Color1 : First color
/// \param Color2 : Second color
/// \param left : Left operand
/// \param right : Right operand
///
/// \return Component-wise multiplication of the two colors
///
////////////////////////////////////////////////////////////
SFML_API Color operator *(const Color& Color1, const Color& Color2);
SFML_API Color operator *(const Color& left, const Color& right);
////////////////////////////////////////////////////////////
/// Operator += overload to add a color
///
/// \param left : Left operand
/// \param right : Right operand
///
/// \return Component-wise saturated addition of the two colors
///
////////////////////////////////////////////////////////////
Color& operator +=(Color& left, const Color& right);
////////////////////////////////////////////////////////////
/// Operator *= overload to modulate a color
///
/// \param left : Left operand
/// \param right : Right operand
///
/// \return Component-wise multiplication of the two colors
///
////////////////////////////////////////////////////////////
Color& operator *=(Color& left, const Color& right);
} // namespace sf

View file

@ -62,13 +62,13 @@ public :
////////////////////////////////////////////////////////////
/// Default constructor
///
/// \param Position : Position of the object (0, 0 by default)
/// \param Scale : Scale factor (1, 1 by default)
/// \param Rotation : Orientation, in degrees (0 by default)
/// \param Col : Color of the object (white by default)
/// \param position : Position of the object ((0, 0) by default)
/// \param scale : Scale factor ((1, 1) by default)
/// \param rotation : Orientation, in degrees (0 by default)
/// \param color : Color of the object (white by default)
///
////////////////////////////////////////////////////////////
Drawable(const Vector2f& Position = Vector2f(0, 0), const Vector2f& Scale = Vector2f(1, 1), float Rotation = 0.f, const Color& Col = Color(255, 255, 255, 255));
Drawable(const Vector2f& position = Vector2f(0, 0), const Vector2f& scale = Vector2f(1, 1), float rotation = 0.f, const Color& color = Color(255, 255, 255));
////////////////////////////////////////////////////////////
/// Virtual destructor
@ -79,44 +79,44 @@ public :
////////////////////////////////////////////////////////////
/// Set the position of the object (take 2 values)
///
/// \param X : New X coordinate
/// \param Y : New Y coordinate
/// \param x : New X coordinate
/// \param y : New Y coordinate
///
////////////////////////////////////////////////////////////
void SetPosition(float X, float Y);
void SetPosition(float x, float y);
////////////////////////////////////////////////////////////
/// Set the position of the object (take a 2D vector)
///
/// \param Position : New position
/// \param position : New position
///
////////////////////////////////////////////////////////////
void SetPosition(const Vector2f& Position);
void SetPosition(const Vector2f& position);
////////////////////////////////////////////////////////////
/// Set the X position of the object
///
/// \param X : New X coordinate
/// \param x : New X coordinate
///
////////////////////////////////////////////////////////////
void SetX(float X);
void SetX(float x);
////////////////////////////////////////////////////////////
/// Set the Y position of the object
///
/// \param Y : New Y coordinate
/// \param y : New Y coordinate
///
////////////////////////////////////////////////////////////
void SetY(float Y);
void SetY(float y);
////////////////////////////////////////////////////////////
/// Set the scale of the object (take 2 values)
///
/// \param ScaleX : New horizontal scale (must be strictly positive)
/// \param ScaleY : New vertical scale (must be strictly positive)
/// \param factorX : New horizontal scale (must be strictly positive)
/// \param factorY : New vertical scale (must be strictly positive)
///
////////////////////////////////////////////////////////////
void SetScale(float ScaleX, float ScaleY);
void SetScale(float factorX, float factorY);
////////////////////////////////////////////////////////////
/// Set the scale of the object (take a 2D vector)
@ -124,70 +124,70 @@ public :
/// \param Scale : New scale (both values must be strictly positive)
///
////////////////////////////////////////////////////////////
void SetScale(const Vector2f& Scale);
void SetScale(const Vector2f& scale);
////////////////////////////////////////////////////////////
/// Set the X scale factor of the object
///
/// \param X : New X scale factor
/// \param factor : New X scale factor
///
////////////////////////////////////////////////////////////
void SetScaleX(float FactorX);
void SetScaleX(float factor);
////////////////////////////////////////////////////////////
/// Set the Y scale factor of the object
///
/// \param Y : New Y scale factor
/// \param factor : New Y scale factor
///
////////////////////////////////////////////////////////////
void SetScaleY(float FactorY);
void SetScaleY(float factor);
////////////////////////////////////////////////////////////
/// Set the local origin of the object, in coordinates relative to the
/// top-left of the object (take 2 values).
/// The default origin is (0, 0)
///
/// \param OriginX : X coordinate of the origin
/// \param OriginY : Y coordinate of the origin
/// \param x : X coordinate of the origin
/// \param y : Y coordinate of the origin
///
////////////////////////////////////////////////////////////
void SetOrigin(float OriginX, float OriginY);
void SetOrigin(float x, float y);
////////////////////////////////////////////////////////////
/// Set the local origin of the object, in coordinates relative to the
/// top-left of the object (take a 2D vector).
/// The default origin is (0, 0)
///
/// \param Origin : New origin
/// \param origin : New origin
///
////////////////////////////////////////////////////////////
void SetOrigin(const Vector2f& Origin);
void SetOrigin(const Vector2f& origin);
////////////////////////////////////////////////////////////
/// Set the orientation of the object
///
/// \param Rotation : Angle of rotation, in degrees
/// \param angle : Angle of rotation, in degrees
///
////////////////////////////////////////////////////////////
void SetRotation(float Rotation);
void SetRotation(float angle);
////////////////////////////////////////////////////////////
/// Set the color of the object.
/// The default color is white
///
/// \param Col : New color
/// \param color : New color
///
////////////////////////////////////////////////////////////
void SetColor(const Color& Col);
void SetColor(const Color& color);
////////////////////////////////////////////////////////////
/// Set the blending mode for the object.
/// The default blend mode is Blend::Alpha
///
/// \param Mode : New blending mode
/// \param mode : New blending mode
///
////////////////////////////////////////////////////////////
void SetBlendMode(Blend::Mode Mode);
void SetBlendMode(Blend::Mode mode);
////////////////////////////////////////////////////////////
/// Get the position of the object
@ -241,36 +241,36 @@ public :
////////////////////////////////////////////////////////////
/// Move the object of a given offset (take 2 values)
///
/// \param OffsetX : X offset
/// \param OffsetY : Y offset
/// \param offsetX : X offset
/// \param offsetY : Y offset
///
////////////////////////////////////////////////////////////
void Move(float OffsetX, float OffsetY);
void Move(float offsetX, float offsetY);
////////////////////////////////////////////////////////////
/// Move the object of a given offset (take a 2D vector)
///
/// \param Offset : Amount of units to move the object of
/// \param offset : Amount of units to move the object of
///
////////////////////////////////////////////////////////////
void Move(const Vector2f& Offset);
void Move(const Vector2f& offset);
////////////////////////////////////////////////////////////
/// Scale the object (take 2 values)
///
/// \param FactorX : Scaling factor on X (must be strictly positive)
/// \param FactorY : Scaling factor on Y (must be strictly positive)
/// \param factorX : Scaling factor on X (must be strictly positive)
/// \param factorY : Scaling factor on Y (must be strictly positive)
///
////////////////////////////////////////////////////////////
void Scale(float FactorX, float FactorY);
void Scale(float factorX, float factorY);
////////////////////////////////////////////////////////////
/// Scale the object (take a 2D vector)
///
/// \param Factor : Scaling factors (both values must be strictly positive)
/// \param factor : Scaling factors (both values must be strictly positive)
///
////////////////////////////////////////////////////////////
void Scale(const Vector2f& Factor);
void Scale(const Vector2f& factor);
////////////////////////////////////////////////////////////
/// Rotate the object
@ -284,23 +284,23 @@ public :
/// Transform a point from global coordinates into local coordinates
/// (ie it applies the inverse of object's origin, translation, rotation and scale to the point)
///
/// \param Point : Point to transform
/// \param point : Point to transform
///
/// \return Transformed point
///
////////////////////////////////////////////////////////////
sf::Vector2f TransformToLocal(const sf::Vector2f& Point) const;
sf::Vector2f TransformToLocal(const sf::Vector2f& point) const;
////////////////////////////////////////////////////////////
/// Transform a point from local coordinates into global coordinates
/// (ie it applies the object's origin, translation, rotation and scale to the point)
///
/// \param Point : Point to transform
/// \param point : Point to transform
///
/// \return Transformed point
///
////////////////////////////////////////////////////////////
sf::Vector2f TransformToGlobal(const sf::Vector2f& Point) const;
sf::Vector2f TransformToGlobal(const sf::Vector2f& point) const;
protected :
@ -327,18 +327,18 @@ private :
////////////////////////////////////////////////////////////
/// Draw the object into the specified window
///
/// \param Target : Target into which render the object
/// \param target : Target into which render the object
///
////////////////////////////////////////////////////////////
void Draw(RenderTarget& Target) const;
void Draw(RenderTarget& target) const;
////////////////////////////////////////////////////////////
/// Render the specific geometry of the object
///
/// \param Target : Target into which render the object
/// \param target : Target into which render the object
///
////////////////////////////////////////////////////////////
virtual void Render(RenderTarget& Target) const = 0;
virtual void Render(RenderTarget& target) const = 0;
////////////////////////////////////////////////////////////
// Member data

View file

@ -64,27 +64,27 @@ public :
////////////////////////////////////////////////////////////
/// Load the font from a file
///
/// \param Filename : Font file to load
/// \param CharSize : Size of characters in bitmap - the bigger, the higher quality (30 by default)
/// \param Charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters)
/// \param filename : Font file to load
/// \param charSize : Size of characters in bitmap - the bigger, the higher quality (30 by default)
/// \param charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters)
///
/// \return True if loading was successful
///
////////////////////////////////////////////////////////////
bool LoadFromFile(const std::string& Filename, unsigned int CharSize = 30, const Unicode::Text& Charset = ourDefaultCharset);
bool LoadFromFile(const std::string& filename, unsigned int charSize = 30, const Unicode::Text& charset = ourDefaultCharset);
////////////////////////////////////////////////////////////
/// Load the font from a file in memory
///
/// \param Data : Pointer to the data to load
/// \param SizeInBytes : Size of the data, in bytes
/// \param CharSize : Size of characters in bitmap - the bigger, the higher quality (30 by default)
/// \param Charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters)
/// \param data : Pointer to the data to load
/// \param sizeInBytes : Size of the data, in bytes
/// \param charSize : Size of characters in bitmap - the bigger, the higher quality (30 by default)
/// \param charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters)
///
/// \return True if loading was successful
///
////////////////////////////////////////////////////////////
bool LoadFromMemory(const char* Data, std::size_t SizeInBytes, unsigned int CharSize = 30, const Unicode::Text& Charset = ourDefaultCharset);
bool LoadFromMemory(const char* data, std::size_t sizeInBytes, unsigned int charSize = 30, const Unicode::Text& charset = ourDefaultCharset);
////////////////////////////////////////////////////////////
/// Get the base size of characters in the font;
@ -99,12 +99,12 @@ public :
/// Get the description of a glyph (character)
/// given by its unicode value
///
/// \param CodePoint : Unicode value of the character to get
/// \param codePoint : Unicode value of the character to get
///
/// \return Glyph's visual settings, or an invalid glyph if character not found
///
////////////////////////////////////////////////////////////
const Glyph& GetGlyph(Uint32 CodePoint) const;
const Glyph& GetGlyph(Uint32 codePoint) const;
////////////////////////////////////////////////////////////
/// Get the image containing the rendered characters (glyphs)

View file

@ -57,30 +57,30 @@ public :
////////////////////////////////////////////////////////////
/// Copy constructor
///
/// \param Copy : instance to copy
/// \param copy : instance to copy
///
////////////////////////////////////////////////////////////
Image(const Image& Copy);
Image(const Image& copy);
////////////////////////////////////////////////////////////
/// Construct an empty image
///
/// \param Width : Image width
/// \param Height : Image height
/// \param Col : Image color (black by default)
/// \param width : Image width
/// \param height : Image height
/// \param color : Image color (black by default)
///
////////////////////////////////////////////////////////////
Image(unsigned int Width, unsigned int Height, const Color& Col = Color(0, 0, 0, 255));
Image(unsigned int width, unsigned int height, const Color& color = Color(0, 0, 0));
////////////////////////////////////////////////////////////
/// Construct the image from pixels in memory
///
/// \param Width : Image width
/// \param Height : Image height
/// \param Data : Pointer to the pixels in memory (assumed format is RGBA)
/// \param width : Image width
/// \param height : Image height
/// \param pixels : Pointer to the pixels in memory (assumed format is RGBA)
///
////////////////////////////////////////////////////////////
Image(unsigned int Width, unsigned int Height, const Uint8* Data);
Image(unsigned int width, unsigned int height, const Uint8* pixels);
////////////////////////////////////////////////////////////
/// Destructor
@ -96,108 +96,108 @@ public :
/// \return True if loading was successful
///
////////////////////////////////////////////////////////////
bool LoadFromFile(const std::string& Filename);
bool LoadFromFile(const std::string& filename);
////////////////////////////////////////////////////////////
/// Load the image from a file in memory
///
/// \param Data : Pointer to the file data in memory
/// \param SizeInBytes : Size of the data to load, in bytes
/// \param data : Pointer to the file data in memory
/// \param sizeInBytes : Size of the data to load, in bytes
///
/// \return True if loading was successful
///
////////////////////////////////////////////////////////////
bool LoadFromMemory(const char* Data, std::size_t SizeInBytes);
bool LoadFromMemory(const char* data, std::size_t sizeInBytes);
////////////////////////////////////////////////////////////
/// Load the image directly from an array of pixels
///
/// \param Width : Image width
/// \param Height : Image height
/// \param Data : Pointer to the pixels in memory (assumed format is RGBA)
/// \param width : Image width
/// \param height : Image height
/// \param pixels : Pointer to the pixels in memory (assumed format is RGBA)
///
/// \return True if loading was successful
///
////////////////////////////////////////////////////////////
bool LoadFromPixels(unsigned int Width, unsigned int Height, const Uint8* Data);
bool LoadFromPixels(unsigned int width, unsigned int height, const Uint8* pixels);
////////////////////////////////////////////////////////////
/// Save the content of the image to a file
///
/// \param Filename : Path of the file to save (overwritten if already exist)
/// \param filename : Path of the file to save (overwritten if already exist)
///
/// \return True if saving was successful
///
////////////////////////////////////////////////////////////
bool SaveToFile(const std::string& Filename) const;
bool SaveToFile(const std::string& filename) const;
////////////////////////////////////////////////////////////
/// Create an empty image
///
/// \param Width : Image width
/// \param Height : Image height
/// \param Col : Image color (black by default)
/// \param width : Image width
/// \param height : Image height
/// \param color : Image color (black by default)
///
/// \return True if creation was successful
///
////////////////////////////////////////////////////////////
bool Create(unsigned int Width, unsigned int Height, Color Col = Color(0, 0, 0, 255));
bool Create(unsigned int width, unsigned int height, const Color& color = Color(0, 0, 0));
////////////////////////////////////////////////////////////
/// Create transparency mask from a specified colorkey
///
/// \param ColorKey : Color to become transparent
/// \param Alpha : Alpha value to use for transparent pixels (0 by default)
/// \param transparentColor : Color to become transparent
/// \param alpha : Alpha value to assign to transparent pixels (0 by default)
///
////////////////////////////////////////////////////////////
void CreateMaskFromColor(Color ColorKey, Uint8 Alpha = 0);
void CreateMaskFromColor(const Color& transparentColor, Uint8 alpha = 0);
////////////////////////////////////////////////////////////
/// Copy pixels from another image onto this one.
/// This function does a slow pixel copy and should only
/// be used at initialization time
///
/// \param Source : Source image to copy
/// \param DestX : X coordinate of the destination position
/// \param DestY : Y coordinate of the destination position
/// \param SourceRect : Sub-rectangle of the source image to copy (empty by default - entire image)
/// \param ApplyAlpha : Should the copy take in account the source transparency? (false by default)
/// \param source : Source image to copy
/// \param destX : X coordinate of the destination position
/// \param destY : Y coordinate of the destination position
/// \param sourceRect : Sub-rectangle of the source image to copy (empty by default - entire image)
/// \param applyAlpha : Should the copy take in account the source transparency? (false by default)
///
////////////////////////////////////////////////////////////
void Copy(const Image& Source, unsigned int DestX, unsigned int DestY, const IntRect& SourceRect = IntRect(0, 0, 0, 0), bool ApplyAlpha = false);
void Copy(const Image& source, unsigned int destX, unsigned int destY, const IntRect& sourceRect = IntRect(0, 0, 0, 0), bool applyAlpha = false);
////////////////////////////////////////////////////////////
/// Create the image from the current contents of the
/// given window
///
/// \param Window : Window to capture
/// \param SourceRect : Sub-rectangle of the screen to copy (empty by default - entire image)
/// \param window : Window to capture
/// \param sourceRect : Sub-rectangle of the screen to copy (empty by default - entire image)
///
/// \return True if copy was successful
///
////////////////////////////////////////////////////////////
bool CopyScreen(RenderWindow& Window, const IntRect& SourceRect = IntRect(0, 0, 0, 0));
bool CopyScreen(RenderWindow& window, const IntRect& sourceRect = IntRect(0, 0, 0, 0));
////////////////////////////////////////////////////////////
/// Change the color of a pixel
///
/// \param X : X coordinate of pixel in the image
/// \param Y : Y coordinate of pixel in the image
/// \param Col : New color for pixel (X, Y)
/// \param x : X coordinate of pixel in the image
/// \param y : Y coordinate of pixel in the image
/// \param color : New color for pixel (x, y)
///
////////////////////////////////////////////////////////////
void SetPixel(unsigned int X, unsigned int Y, const Color& Col);
void SetPixel(unsigned int x, unsigned int y, const Color& color);
////////////////////////////////////////////////////////////
/// Get a pixel from the image
///
/// \param X : X coordinate of pixel in the image
/// \param Y : Y coordinate of pixel in the image
/// \param x : X coordinate of pixel in the image
/// \param y : Y coordinate of pixel in the image
///
/// \return Color of pixel (X, Y)
/// \return Color of pixel (x, y)
///
////////////////////////////////////////////////////////////
const Color& GetPixel(unsigned int X, unsigned int Y) const;
const Color& GetPixel(unsigned int x, unsigned int y) const;
////////////////////////////////////////////////////////////
/// Get a read-only pointer to the array of pixels (RGBA 8 bits integers components)
@ -219,10 +219,10 @@ public :
/// Enable or disable image smooth filter.
/// This parameter is enabled by default
///
/// \param Smooth : True to enable smoothing filter, false to disable it
/// \param smooth : True to enable smoothing filter, false to disable it
///
////////////////////////////////////////////////////////////
void SetSmooth(bool Smooth);
void SetSmooth(bool smooth);
////////////////////////////////////////////////////////////
/// Return the width of the image
@ -252,33 +252,33 @@ public :
/// Convert a subrect expressed in pixels, into float
/// texture coordinates
///
/// \param Rect : Sub-rectangle of image to convert
/// \param Adjust : Pass true to apply the half-texel adjustment
/// \param rectangle : Sub-rectangle of image to convert
/// \param adjust : Pass true to apply the half-texel adjustment (true by default)
///
/// \return Texture coordinates corresponding to the sub-rectangle
///
////////////////////////////////////////////////////////////
FloatRect GetTexCoords(const IntRect& Rect, bool Adjust = true) const;
FloatRect GetTexCoords(const IntRect& rectangle, bool adjust = true) const;
////////////////////////////////////////////////////////////
/// Get a valid texture size according to hardware support
///
/// \param Size : Size to convert
/// \param Size : size to convert
///
/// \return Valid nearest size (greater than or equal to specified size)
///
////////////////////////////////////////////////////////////
static unsigned int GetValidTextureSize(unsigned int Size);
static unsigned int GetValidTextureSize(unsigned int size);
////////////////////////////////////////////////////////////
/// Assignment operator
///
/// \param Other : instance to assign
/// \param other : instance to assign
///
/// \return Reference to the image
///
////////////////////////////////////////////////////////////
Image& operator =(const Image& Other);
Image& operator =(const Image& other);
private :
@ -309,10 +309,10 @@ private :
/// its content.
/// For internal use only (see RenderImage class).
///
/// \param Source : RenderImage that will update the image
/// \param source : RenderImage that will update the image
///
////////////////////////////////////////////////////////////
void ExternalUpdate(RenderImage& Source);
void ExternalUpdate(RenderImage& source);
////////////////////////////////////////////////////////////
/// Reset the image attributes

View file

@ -61,33 +61,33 @@ public :
////////////////////////////////////////////////////////////
/// Build a matrix from a set of transformations
///
/// \param Center : Origin for the transformations
/// \param Translation : Translation offset
/// \param Rotation : Rotation angle in degrees
/// \param Scale : Scaling factors
/// \param origin : Origin for the transformations
/// \param translation : Translation offset
/// \param rotation : Rotation angle in degrees
/// \param scale : Scaling factors
///
////////////////////////////////////////////////////////////
void SetFromTransformations(const Vector2f& Center, const Vector2f& Translation, float Rotation, const Vector2f& Scale);
void SetFromTransformations(const Vector2f& origin, const Vector2f& translation, float rotation, const Vector2f& scale);
////////////////////////////////////////////////////////////
/// Build a matrix from a projection
///
/// \param Center : Center of the view
/// \param Size : Size of the view
/// \param Rotation : Angle of rotation of the view rectangle, in degrees
/// \param center : Center of the view
/// \param size : Size of the view
/// \param rotation : Angle of rotation of the view rectangle, in degrees
///
////////////////////////////////////////////////////////////
void SetFromProjection(const Vector2f& Center, const Vector2f& Size, float Rotation);
void SetFromProjection(const Vector2f& center, const Vector2f& size, float rotation);
////////////////////////////////////////////////////////////
/// Transform a point by the matrix
///
/// \param Point : Point to transform
/// \param point : Point to transform
///
/// \return Transformed point
///
////////////////////////////////////////////////////////////
Vector2f Transform(const Vector2f& Point) const;
Vector2f Transform(const Vector2f& point) const;
////////////////////////////////////////////////////////////
/// Return the inverse of the matrix
@ -109,34 +109,34 @@ public :
////////////////////////////////////////////////////////////
/// Operator () overloads to access the matrix elements
///
/// \param Row : Element row (0 based)
/// \param Col : Element column (0 based)
/// \param row : Element row (0 based)
/// \param column : Element column (0 based)
///
/// \return Matrix element (Row, Col)
///
////////////////////////////////////////////////////////////
float operator ()(unsigned int Row, unsigned int Col) const;
float& operator ()(unsigned int Row, unsigned int Col);
float operator ()(unsigned int row, unsigned int column) const;
float& operator ()(unsigned int row, unsigned int column);
////////////////////////////////////////////////////////////
/// Operator * overload to multiply two matrices
///
/// \param Mat : Matrix to multiply
/// \param right : Matrix to multiply
///
/// \return this * Mat
/// \return this * right
///
////////////////////////////////////////////////////////////
Matrix3 operator *(const Matrix3& Mat) const;
Matrix3 operator *(const Matrix3& right) const;
////////////////////////////////////////////////////////////
/// Operator *= overload to multiply-assign two matrices
///
/// \param Mat : Matrix to multiply
/// \param right : Matrix to multiply
///
/// \return this * Mat
/// \return this * right
///
////////////////////////////////////////////////////////////
Matrix3& operator *=(const Matrix3& Mat);
Matrix3& operator *=(const Matrix3& right);
////////////////////////////////////////////////////////////
// Static member data

View file

@ -52,22 +52,22 @@ inline Matrix3::Matrix3(float a00, float a01, float a02,
////////////////////////////////////////////////////////////
/// Build a matrix from a set of transformations
////////////////////////////////////////////////////////////
inline void Matrix3::SetFromTransformations(const Vector2f& Center, const Vector2f& Translation, float Rotation, const Vector2f& Scale)
inline void Matrix3::SetFromTransformations(const Vector2f& origin, const Vector2f& translation, float rotation, const Vector2f& scale)
{
// Combine the transformations
float Angle = Rotation * 3.141592654f / 180.f;
float Cos = static_cast<float>(cos(Angle));
float Sin = static_cast<float>(sin(Angle));
float SxCos = Scale.x * Cos;
float SyCos = Scale.y * Cos;
float SxSin = Scale.x * Sin;
float SySin = Scale.y * Sin;
float Tx = -Center.x * SxCos - Center.y * SySin + Translation.x;
float Ty = Center.x * SxSin - Center.y * SyCos + Translation.y;
float angle = rotation * 3.141592654f / 180.f;
float cosine = static_cast<float>(cos(angle));
float sine = static_cast<float>(sin(angle));
float sxCos = scale.x * cosine;
float syCos = scale.y * cosine;
float sxSin = scale.x * sine;
float sySin = scale.y * sine;
float tx = -origin.x * sxCos - origin.y * sySin + translation.x;
float ty = origin.x * sxSin - origin.y * syCos + translation.y;
// Rebuild the matrix
myData[0] = SxCos; myData[4] = SySin; myData[8] = 0.f; myData[12] = Tx;
myData[1] = -SxSin; myData[5] = SyCos; myData[9] = 0.f; myData[13] = Ty;
myData[0] = sxCos; myData[4] = sySin; myData[8] = 0.f; myData[12] = tx;
myData[1] = -sxSin; myData[5] = syCos; myData[9] = 0.f; myData[13] = ty;
myData[2] = 0.f; myData[6] = 0.f; myData[10] = 1.f; myData[14] = 0.f;
myData[3] = 0.f; myData[7] = 0.f; myData[11] = 0.f; myData[15] = 1.f;
}
@ -76,36 +76,36 @@ inline void Matrix3::SetFromTransformations(const Vector2f& Center, const Vector
////////////////////////////////////////////////////////////
/// Build a matrix from a projection
////////////////////////////////////////////////////////////
inline void Matrix3::SetFromProjection(const Vector2f& Center, const Vector2f& Size, float Rotation)
inline void Matrix3::SetFromProjection(const Vector2f& center, const Vector2f& size, float rotation)
{
// Rotation components
float Angle = Rotation * 3.141592654f / 180.f;
float Cos = static_cast<float>(cos(Angle));
float Sin = static_cast<float>(sin(Angle));
float Tx = -Center.x * Cos - Center.y * Sin + Center.x;
float Ty = Center.x * Sin - Center.y * Cos + Center.y;
float angle = rotation * 3.141592654f / 180.f;
float cosine = static_cast<float>(cos(angle));
float sine = static_cast<float>(sin(angle));
float tx = -center.x * cosine - center.y * sine + center.x;
float ty = center.x * sine - center.y * cosine + center.y;
// Projection components
float A = 2.f / Size.x;
float B = -2.f / Size.y;
float C = -A * Center.x;
float D = -B * Center.y;
float a = 2.f / size.x;
float b = -2.f / size.y;
float c = -a * center.x;
float d = -b * center.y;
// Rebuild the projection matrix
myData[0] = A * Cos; myData[4] = A * Sin; myData[8] = 0.f; myData[12] = A * Tx + C;
myData[1] = -B * Sin; myData[5] = B * Cos; myData[9] = 0.f; myData[13] = B * Ty + D;
myData[2] = 0.f; myData[6] = 0.f; myData[10] = 1.f; myData[14] = 0.f;
myData[3] = 0.f; myData[7] = 0.f; myData[11] = 0.f; myData[15] = 1.f;
myData[0] = a * cosine; myData[4] = a * sine; myData[8] = 0.f; myData[12] = a * tx + c;
myData[1] = -b * sine; myData[5] = b * cosine; myData[9] = 0.f; myData[13] = b * ty + d;
myData[2] = 0.f; myData[6] = 0.f; myData[10] = 1.f; myData[14] = 0.f;
myData[3] = 0.f; myData[7] = 0.f; myData[11] = 0.f; myData[15] = 1.f;
}
////////////////////////////////////////////////////////////
/// Transform a point by the matrix
////////////////////////////////////////////////////////////
inline Vector2f Matrix3::Transform(const Vector2f& Point) const
inline Vector2f Matrix3::Transform(const Vector2f& point) const
{
return Vector2f(myData[0] * Point.x + myData[4] * Point.y + myData[12],
myData[1] * Point.x + myData[5] * Point.y + myData[13]);
return Vector2f(myData[0] * point.x + myData[4] * point.y + myData[12],
myData[1] * point.x + myData[5] * point.y + myData[13]);
}
@ -115,22 +115,22 @@ inline Vector2f Matrix3::Transform(const Vector2f& Point) const
inline Matrix3 Matrix3::GetInverse() const
{
// Compute the determinant
float Det = myData[0] * (myData[15] * myData[5] - myData[7] * myData[13]) -
float det = myData[0] * (myData[15] * myData[5] - myData[7] * myData[13]) -
myData[1] * (myData[15] * myData[4] - myData[7] * myData[12]) +
myData[3] * (myData[13] * myData[4] - myData[5] * myData[12]);
// Compute the inverse if determinant is not zero
if ((Det < -1E-7f) || (Det > 1E-7f))
if ((det < -1E-7f) || (det > 1E-7f))
{
return Matrix3( (myData[15] * myData[5] - myData[7] * myData[13]) / Det,
-(myData[15] * myData[4] - myData[7] * myData[12]) / Det,
(myData[13] * myData[4] - myData[5] * myData[12]) / Det,
-(myData[15] * myData[1] - myData[3] * myData[13]) / Det,
(myData[15] * myData[0] - myData[3] * myData[12]) / Det,
-(myData[13] * myData[0] - myData[1] * myData[12]) / Det,
(myData[7] * myData[1] - myData[3] * myData[5]) / Det,
-(myData[7] * myData[0] - myData[3] * myData[4]) / Det,
(myData[5] * myData[0] - myData[1] * myData[4]) / Det);
return Matrix3( (myData[15] * myData[5] - myData[7] * myData[13]) / det,
-(myData[15] * myData[4] - myData[7] * myData[12]) / det,
(myData[13] * myData[4] - myData[5] * myData[12]) / det,
-(myData[15] * myData[1] - myData[3] * myData[13]) / det,
(myData[15] * myData[0] - myData[3] * myData[12]) / det,
-(myData[13] * myData[0] - myData[1] * myData[12]) / det,
(myData[7] * myData[1] - myData[3] * myData[5]) / det,
-(myData[7] * myData[0] - myData[3] * myData[4]) / det,
(myData[5] * myData[0] - myData[1] * myData[4]) / det);
}
else
{
@ -152,9 +152,9 @@ inline const float* Matrix3::Get4x4Elements() const
////////////////////////////////////////////////////////////
/// Operator () overloads to access the matrix elements
////////////////////////////////////////////////////////////
inline float Matrix3::operator ()(unsigned int Row, unsigned int Col) const
inline float Matrix3::operator ()(unsigned int row, unsigned int column) const
{
switch (Row + Col * 3)
switch (row + column * 3)
{
case 0 : return myData[0];
case 1 : return myData[1];
@ -169,9 +169,9 @@ inline float Matrix3::operator ()(unsigned int Row, unsigned int Col) const
default : return myData[0];
}
}
inline float& Matrix3::operator ()(unsigned int Row, unsigned int Col)
inline float& Matrix3::operator ()(unsigned int row, unsigned int column)
{
switch (Row + Col * 3)
switch (row + column * 3)
{
case 0 : return myData[0];
case 1 : return myData[1];
@ -191,24 +191,24 @@ inline float& Matrix3::operator ()(unsigned int Row, unsigned int Col)
////////////////////////////////////////////////////////////
/// Operator * overload to multiply two matrices
////////////////////////////////////////////////////////////
inline Matrix3 Matrix3::operator *(const Matrix3& Mat) const
inline Matrix3 Matrix3::operator *(const Matrix3& right) const
{
return Matrix3(myData[0] * Mat.myData[0] + myData[4] * Mat.myData[1] + myData[12] * Mat.myData[3],
myData[0] * Mat.myData[4] + myData[4] * Mat.myData[5] + myData[12] * Mat.myData[7],
myData[0] * Mat.myData[12] + myData[4] * Mat.myData[13] + myData[12] * Mat.myData[15],
myData[1] * Mat.myData[0] + myData[5] * Mat.myData[1] + myData[13] * Mat.myData[3],
myData[1] * Mat.myData[4] + myData[5] * Mat.myData[5] + myData[13] * Mat.myData[7],
myData[1] * Mat.myData[12] + myData[5] * Mat.myData[13] + myData[13] * Mat.myData[15],
myData[3] * Mat.myData[0] + myData[7] * Mat.myData[1] + myData[15] * Mat.myData[3],
myData[3] * Mat.myData[4] + myData[7] * Mat.myData[5] + myData[15] * Mat.myData[7],
myData[3] * Mat.myData[12] + myData[7] * Mat.myData[13] + myData[15] * Mat.myData[15]);
return Matrix3(myData[0] * right.myData[0] + myData[4] * right.myData[1] + myData[12] * right.myData[3],
myData[0] * right.myData[4] + myData[4] * right.myData[5] + myData[12] * right.myData[7],
myData[0] * right.myData[12] + myData[4] * right.myData[13] + myData[12] * right.myData[15],
myData[1] * right.myData[0] + myData[5] * right.myData[1] + myData[13] * right.myData[3],
myData[1] * right.myData[4] + myData[5] * right.myData[5] + myData[13] * right.myData[7],
myData[1] * right.myData[12] + myData[5] * right.myData[13] + myData[13] * right.myData[15],
myData[3] * right.myData[0] + myData[7] * right.myData[1] + myData[15] * right.myData[3],
myData[3] * right.myData[4] + myData[7] * right.myData[5] + myData[15] * right.myData[7],
myData[3] * right.myData[12] + myData[7] * right.myData[13] + myData[15] * right.myData[15]);
}
////////////////////////////////////////////////////////////
/// Operator *= overload to multiply-assign two matrices
////////////////////////////////////////////////////////////
inline Matrix3& Matrix3::operator *=(const Matrix3& Mat)
inline Matrix3& Matrix3::operator *=(const Matrix3& right)
{
return *this = *this * Mat;
return *this = *this * right;
}

View file

@ -53,10 +53,10 @@ public :
////////////////////////////////////////////////////////////
/// Copy constructor
///
/// \param Copy : Instance to copy
/// \param copy : Instance to copy
///
////////////////////////////////////////////////////////////
PostFX(const PostFX& Copy);
PostFX(const PostFX& copy);
////////////////////////////////////////////////////////////
/// Destructor
@ -67,77 +67,77 @@ public :
////////////////////////////////////////////////////////////
/// Load the effect from a file
///
/// \param Filename : Path of the effect file to load
/// \param filename : Path of the effect file to load
///
/// \return True on success
///
////////////////////////////////////////////////////////////
bool LoadFromFile(const std::string& Filename);
bool LoadFromFile(const std::string& filename);
////////////////////////////////////////////////////////////
/// Load the effect from a text in memory
///
/// \param Effect : String containing the effect code
/// \param effect : String containing the code of the effect
///
/// \return True on success
///
////////////////////////////////////////////////////////////
bool LoadFromMemory(const std::string& Effect);
bool LoadFromMemory(const std::string& effect);
////////////////////////////////////////////////////////////
/// Change a parameter of the effect (1 float)
///
/// \param Name : Parameter name in the effect
/// \param X : Value to assign
/// \param name : Name of the parameter in the effect
/// \param x : Value to assign
///
////////////////////////////////////////////////////////////
void SetParameter(const std::string& Name, float X);
void SetParameter(const std::string& name, float x);
////////////////////////////////////////////////////////////
/// Change a parameter of the effect (2 floats)
///
/// \param Name : Parameter name in the effect
/// \param X, Y : Values to assign
/// \param name : Name of the parameter in the effect
/// \param x, y : Values to assign
///
////////////////////////////////////////////////////////////
void SetParameter(const std::string& Name, float X, float Y);
void SetParameter(const std::string& Name, float x, float y);
////////////////////////////////////////////////////////////
/// Change a parameter of the effect (3 floats)
///
/// \param Name : Parameter name in the effect
/// \param X, Y, Z : Values to assign
/// \param name : Name of the parameter in the effect
/// \param x, y, z : Values to assign
///
////////////////////////////////////////////////////////////
void SetParameter(const std::string& Name, float X, float Y, float Z);
void SetParameter(const std::string& Name, float x, float y, float z);
////////////////////////////////////////////////////////////
/// Change a parameter of the effect (4 floats)
///
/// \param Name : Parameter name in the effect
/// \param X, Y, Z, W : Values to assign
/// \param name : Name of the parameter in the effect
/// \param x, y, z, w : Values to assign
///
////////////////////////////////////////////////////////////
void SetParameter(const std::string& Name, float X, float Y, float Z, float W);
void SetParameter(const std::string& Name, float x, float y, float Z, float w);
////////////////////////////////////////////////////////////
/// Set a texture parameter
///
/// \param Name : Texture name in the effect
/// \param Texture : Image to set (pass NULL to use content of current framebuffer)
/// \param name : Name of the texture in the effect
/// \param texture : Image to set (pass NULL to use content of current framebuffer)
///
////////////////////////////////////////////////////////////
void SetTexture(const std::string& Name, const Image* Texture);
void SetTexture(const std::string& name, const Image* texture);
////////////////////////////////////////////////////////////
/// Assignment operator
///
/// \param Other : Instance to assign
/// \param other : Instance to assign
///
/// \return Reference to the post-effect
///
////////////////////////////////////////////////////////////
PostFX& operator =(const PostFX& Other);
PostFX& operator =(const PostFX& other);
////////////////////////////////////////////////////////////
/// Tell whether or not the system supports post-effects
@ -153,7 +153,7 @@ protected :
/// /see Drawable::Render
///
////////////////////////////////////////////////////////////
virtual void Render(RenderTarget& Target) const;
virtual void Render(RenderTarget& target) const;
private :
@ -161,12 +161,12 @@ private :
/// Preprocess a SFML effect file
/// to convert it to a valid GLSL fragment shader
///
/// \param File : Stream containing the code to process
/// \param file : Stream containing the code to process
///
/// \return Valid fragment shader source code
///
////////////////////////////////////////////////////////////
static std::string PreprocessEffect(std::istream& File);
static std::string PreprocessEffect(std::istream& file);
////////////////////////////////////////////////////////////
/// Create the program and attach the shaders

View file

@ -52,13 +52,13 @@ public :
////////////////////////////////////////////////////////////
/// Construct the rectangle from its coordinates
///
/// \param LeftCoord : Left coordinate of the rectangle
/// \param TopCoord : Top coordinate of the rectangle
/// \param RightCoord : Right coordinate of the rectangle
/// \param BottomCoord : Bottom coordinate of the rectangle
/// \param left : Left coordinate of the rectangle
/// \param top : Top coordinate of the rectangle
/// \param right : Right coordinate of the rectangle
/// \param bottom : Bottom coordinate of the rectangle
///
////////////////////////////////////////////////////////////
Rect(T LeftCoord, T TopCoord, T RightCoord, T BottomCoord);
Rect(T left, T top, T right, T bottom);
////////////////////////////////////////////////////////////
/// Get the size of the rectangle
@ -79,62 +79,62 @@ public :
////////////////////////////////////////////////////////////
/// Move the whole rectangle by the given offset
///
/// \param OffsetX : Horizontal offset
/// \param OffsetY : Vertical offset
/// \param offsetX : Horizontal offset
/// \param offsetY : Vertical offset
///
////////////////////////////////////////////////////////////
void Offset(T OffsetX, T OffsetY);
void Offset(T offsetX, T offsetY);
////////////////////////////////////////////////////////////
/// Move the whole rectangle by the given offset
///
/// \param Off : Offset to apply to the current position
/// \param offset : Offset to apply to the current position
///
////////////////////////////////////////////////////////////
void Offset(const Vector2<T>& Off);
void Offset(const Vector2<T>& offset);
////////////////////////////////////////////////////////////
/// Check if a point is inside the rectangle's area
///
/// \param X : X coordinate of the point to test
/// \param Y : Y coordinate of the point to test
/// \param x : X coordinate of the point to test
/// \param y : Y coordinate of the point to test
///
/// \return True if the point is inside
///
////////////////////////////////////////////////////////////
bool Contains(T X, T Y) const;
bool Contains(T x, T y) const;
////////////////////////////////////////////////////////////
/// Check if a point is inside the rectangle's area
///
/// \param Point : Point to test
/// \param point : Point to test
///
/// \return True if the point is inside
///
////////////////////////////////////////////////////////////
bool Contains(const Vector2<T>& Point) const;
bool Contains(const Vector2<T>& point) const;
////////////////////////////////////////////////////////////
/// Check intersection between two rectangles
///
/// \param Rectangle : Rectangle to test
/// \param rectangle : Rectangle to test
///
/// \return True if rectangles overlap
///
////////////////////////////////////////////////////////////
bool Intersects(const Rect<T>& Rectangle) const;
bool Intersects(const Rect<T>& rectangle) const;
////////////////////////////////////////////////////////////
/// Check intersection between two rectangles and return the
/// resulting rectangle
///
/// \param Rectangle : Rectangle to test
/// \param OverlappingRect : Rectangle to be filled with the overlapping rect
/// \param rectangle : Rectangle to test
/// \param intersection : Rectangle to be filled with the intersection of both rectangles
///
/// \return True if rectangles overlap
///
////////////////////////////////////////////////////////////
bool Intersects(const Rect<T>& Rectangle, Rect<T>& OverlappingRect) const;
bool Intersects(const Rect<T>& rectangle, Rect<T>& intersection) const;
////////////////////////////////////////////////////////////
// Member data

View file

@ -41,11 +41,11 @@ Bottom(0)
/// Construct the color from its coordinates
////////////////////////////////////////////////////////////
template <typename T>
Rect<T>::Rect(T LeftCoord, T TopCoord, T RightCoord, T BottomCoord) :
Left (LeftCoord),
Top (TopCoord),
Right (RightCoord),
Bottom(BottomCoord)
Rect<T>::Rect(T left, T top, T right, T bottom) :
Left (left),
Top (top),
Right (right),
Bottom(bottom)
{
}
@ -75,12 +75,12 @@ Vector2<T> Rect<T>::GetCenter() const
/// Move the whole rectangle by the given offset
////////////////////////////////////////////////////////////
template <typename T>
void Rect<T>::Offset(T OffsetX, T OffsetY)
void Rect<T>::Offset(T offsetX, T offsetY)
{
Left += OffsetX;
Right += OffsetX;
Top += OffsetY;
Bottom += OffsetY;
Left += offsetX;
Right += offsetX;
Top += offsetY;
Bottom += offsetY;
}
@ -88,9 +88,9 @@ void Rect<T>::Offset(T OffsetX, T OffsetY)
/// Move the whole rectangle by the given offset
////////////////////////////////////////////////////////////
template <typename T>
void Rect<T>::Offset(const Vector2<T>& Off)
void Rect<T>::Offset(const Vector2<T>& offset)
{
Offset(Off.x, Off.y);
Offset(offset.x, offset.y);
}
@ -98,9 +98,9 @@ void Rect<T>::Offset(const Vector2<T>& Off)
/// Check if a point is inside the rectangle's area
////////////////////////////////////////////////////////////
template <typename T>
bool Rect<T>::Contains(T X, T Y) const
bool Rect<T>::Contains(T x, T y) const
{
return (X >= Left) && (X <= Right) && (Y >= Top) && (Y <= Bottom);
return (x >= Left) && (x <= Right) && (y >= Top) && (y <= Bottom);
}
@ -108,9 +108,9 @@ bool Rect<T>::Contains(T X, T Y) const
/// Check if a point is inside the rectangle's area
////////////////////////////////////////////////////////////
template <typename T>
bool Rect<T>::Contains(const Vector2<T>& Point) const
bool Rect<T>::Contains(const Vector2<T>& point) const
{
return Contains(Point.x, Point.y);
return Contains(point.x, point.y);
}
@ -118,16 +118,16 @@ bool Rect<T>::Contains(const Vector2<T>& Point) const
/// Check intersection between two rectangles
////////////////////////////////////////////////////////////
template <typename T>
bool Rect<T>::Intersects(const Rect<T>& Rectangle) const
bool Rect<T>::Intersects(const Rect<T>& rectangle) const
{
// Compute overlapping rect
Rect<T> Overlapping(std::max(Left, Rectangle.Left),
std::max(Top, Rectangle.Top),
std::min(Right, Rectangle.Right),
std::min(Bottom, Rectangle.Bottom));
Rect<T> overlapping(std::max(Left, rectangle.Left),
std::max(Top, rectangle.Top),
std::min(Right, rectangle.Right),
std::min(Bottom, rectangle.Bottom));
// If overlapping rect is valid, then there is intersection
return (Overlapping.Left < Overlapping.Right) && (Overlapping.Top < Overlapping.Bottom);
return (overlapping.Left < overlapping.Right) && (overlapping.Top < overlapping.Bottom);
}
@ -136,23 +136,23 @@ bool Rect<T>::Intersects(const Rect<T>& Rectangle) const
/// resulting rectangle
////////////////////////////////////////////////////////////
template <typename T>
bool Rect<T>::Intersects(const Rect<T>& Rectangle, Rect<T>& OverlappingRect) const
bool Rect<T>::Intersects(const Rect<T>& rectangle, Rect<T>& intersection) const
{
// Compute overlapping rect
Rect<T> Overlapping(std::max(Left, Rectangle.Left),
std::max(Top, Rectangle.Top),
std::min(Right, Rectangle.Right),
std::min(Bottom, Rectangle.Bottom));
Rect<T> overlapping(std::max(Left, rectangle.Left),
std::max(Top, rectangle.Top),
std::min(Right, rectangle.Right),
std::min(Bottom, rectangle.Bottom));
// If overlapping rect is valid, then there is intersection
if ((Overlapping.Left < Overlapping.Right) && (Overlapping.Top < Overlapping.Bottom))
if ((overlapping.Left < overlapping.Right) && (overlapping.Top < overlapping.Bottom))
{
OverlappingRect = Overlapping;
intersection = overlapping;
return true;
}
else
{
OverlappingRect = Rect<T>(0, 0, 0, 0);
intersection = Rect<T>(0, 0, 0, 0);
return false;
}
}

View file

@ -63,25 +63,25 @@ public :
////////////////////////////////////////////////////////////
/// Create the render image from its dimensions
///
/// \param Width : Width of the render image
/// \param Height : Height of the render image
/// \param DepthBuffer : Do you want a depth buffer attached? (false by default)
/// \param width : Width of the render image
/// \param height : Height of the render image
/// \param depthBuffer : Do you want a depth buffer attached? (false by default)
///
/// \return True if creation has been successful
///
////////////////////////////////////////////////////////////
bool Create(unsigned int Width, unsigned int Height, bool DepthBuffer = false);
bool Create(unsigned int width, unsigned int height, bool depthBuffer = false);
////////////////////////////////////////////////////////////
/// Activate of deactivate the render-image as the current target
/// for rendering
///
/// \param Active : True to activate, false to deactivate (true by default)
/// \param active : True to activate, false to deactivate (true by default)
///
/// \return True if operation was successful, false otherwise
///
////////////////////////////////////////////////////////////
bool SetActive(bool Active = true);
bool SetActive(bool active = true);
////////////////////////////////////////////////////////////
/// Get the width of the rendering region of the image
@ -123,19 +123,19 @@ private :
/// /see RenderTarget::Activate
///
////////////////////////////////////////////////////////////
virtual bool Activate(bool Active);
virtual bool Activate(bool active);
////////////////////////////////////////////////////////////
/// Update the pixels of the target image.
/// This function is called automatically by the image when it
/// needs to update its pixels, and is only meant for internal use.
///
/// \param Target : Target image to update
/// \param target : Target image to update
///
/// \return True if the new pixels are flipped vertically
///
////////////////////////////////////////////////////////////
bool UpdateImage(Image& Target);
bool UpdateImage(Image& target);
////////////////////////////////////////////////////////////
// Member data

View file

@ -53,18 +53,18 @@ public :
////////////////////////////////////////////////////////////
/// Clear the entire target with a single color
///
/// \param FillColor : Color to use to clear the render target
/// \param color : Color to use to clear the render target
///
////////////////////////////////////////////////////////////
void Clear(const Color& FillColor = Color(0, 0, 0));
void Clear(const Color& color = Color(0, 0, 0));
////////////////////////////////////////////////////////////
/// Draw something into the target
///
/// \param Object : Object to draw
/// \param object : Object to draw
///
////////////////////////////////////////////////////////////
virtual void Draw(const Drawable& Object);
virtual void Draw(const Drawable& object);
////////////////////////////////////////////////////////////
/// Get the width of the rendering region of the target
@ -85,10 +85,10 @@ public :
////////////////////////////////////////////////////////////
/// Change the current active view.
///
/// \param NewView : New view to use (pass GetDefaultView() to set the default view)
/// \param view : New view to use (pass GetDefaultView() to set the default view)
///
////////////////////////////////////////////////////////////
void SetView(const View& NewView);
void SetView(const View& view);
////////////////////////////////////////////////////////////
/// Get the current view
@ -114,10 +114,10 @@ public :
/// SFML to do internal optimizations and improve performances.
/// This parameter is false by default
///
/// \param Preserve : True to preserve OpenGL states, false to let SFML optimize
/// \param preserve : True to preserve OpenGL states, false to let SFML optimize
///
////////////////////////////////////////////////////////////
void PreserveOpenGLStates(bool Preserve);
void PreserveOpenGLStates(bool preserve);
protected :
@ -138,12 +138,12 @@ private :
////////////////////////////////////////////////////////////
/// Activate the target for rendering
///
/// \param Active : True to activate rendering, false to deactivate
/// \param active : True to activate rendering, false to deactivate
///
/// \return True if activation succeeded
///
////////////////////////////////////////////////////////////
virtual bool Activate(bool Active) = 0;
virtual bool Activate(bool active) = 0;
////////////////////////////////////////////////////////////
/// Set the OpenGL render states needed for the SFML rendering

View file

@ -55,22 +55,22 @@ public :
////////////////////////////////////////////////////////////
/// Construct the window
///
/// \param Mode : Video mode to use
/// \param Title : Title of the window
/// \param WindowStyle : Window style (Resize | Close by default)
/// \param Settings : Additional settings for the underlying OpenGL context (see default constructor for default values)
/// \param mode : Video mode to use
/// \param title : Title of the window
/// \param style : Window style (Resize | Close by default)
/// \param settings : Additional settings for the underlying OpenGL context (see default constructor for default values)
///
////////////////////////////////////////////////////////////
RenderWindow(VideoMode Mode, const std::string& Title, unsigned long WindowStyle = Style::Resize | Style::Close, const ContextSettings& Settings = ContextSettings());
RenderWindow(VideoMode mode, const std::string& title, unsigned long style = Style::Resize | Style::Close, const ContextSettings& settings = ContextSettings());
////////////////////////////////////////////////////////////
/// Construct the window from an existing control
///
/// \param Handle : Platform-specific handle of the control
/// \param Settings : Additional settings for the underlying OpenGL context (see default constructor for default values)
/// \param handle : Platform-specific handle of the control
/// \param settings : Additional settings for the underlying OpenGL context (see default constructor for default values)
///
////////////////////////////////////////////////////////////
RenderWindow(WindowHandle Handle, const ContextSettings& Settings = ContextSettings());
RenderWindow(WindowHandle handle, const ContextSettings& settings = ContextSettings());
////////////////////////////////////////////////////////////
/// Destructor
@ -106,26 +106,26 @@ public :
/// Convert a point in window coordinates into view coordinates
/// This version uses the current view of the window
///
/// \param WindowX : X coordinate of the point to convert, relative to the window
/// \param WindowY : Y coordinate of the point to convert, relative to the window
/// \param x : X coordinate of the point to convert, relative to the window
/// \param y : Y coordinate of the point to convert, relative to the window
///
/// \return Converted point
///
////////////////////////////////////////////////////////////
sf::Vector2f ConvertCoords(unsigned int WindowX, unsigned int WindowY) const;
sf::Vector2f ConvertCoords(unsigned int x, unsigned int y) const;
////////////////////////////////////////////////////////////
/// Convert a point in window coordinates into view coordinates
/// This version uses the given view
///
/// \param WindowX : X coordinate of the point to convert, relative to the window
/// \param WindowY : Y coordinate of the point to convert, relative to the window
/// \param TargetView : Target view to convert the point to
/// \param x : X coordinate of the point to convert, relative to the window
/// \param y : Y coordinate of the point to convert, relative to the window
/// \param view : Target view to convert the point to
///
/// \return Converted point
///
////////////////////////////////////////////////////////////
sf::Vector2f ConvertCoords(unsigned int WindowX, unsigned int WindowY, const View& TargetView) const;
sf::Vector2f ConvertCoords(unsigned int x, unsigned int y, const View& view) const;
private :
@ -139,7 +139,7 @@ private :
/// /see RenderTarget::Activate
///
////////////////////////////////////////////////////////////
virtual bool Activate(bool Active);
virtual bool Activate(bool active);
};
} // namespace sf

View file

@ -40,7 +40,7 @@ namespace sf
/// helper functions to draw simple shapes like
/// lines, rectangles, circles, etc.
////////////////////////////////////////////////////////////
class SFML_API Shape : public sf::Drawable
class SFML_API Shape : public Drawable
{
public :
@ -53,22 +53,22 @@ public :
////////////////////////////////////////////////////////////
/// Add a point to the shape
///
/// \param X, Y : Position of the point
/// \param Col : Color of the point (white by default)
/// \param OutlineCol : Outline color of the point (black by default)
/// \param x, y : Position of the point
/// \param color : Color of the point (white by default)
/// \param outlineColor : Outline color of the point (black by default)
///
////////////////////////////////////////////////////////////
void AddPoint(float X, float Y, const Color& Col = Color(255, 255, 255), const Color& OutlineCol = Color(0, 0, 0));
void AddPoint(float x, float y, const Color& color = Color(255, 255, 255), const Color& outlineColor = Color(0, 0, 0));
////////////////////////////////////////////////////////////
/// Add a point to the shape
///
/// \param Position : Position of the point
/// \param Col : Color of the point (white by default)
/// \param OutlineCol : Outline color of the point (black by default)
/// \param position : Position of the point
/// \param color : Color of the point (white by default)
/// \param outlineColor : Outline color of the point (black by default)
///
////////////////////////////////////////////////////////////
void AddPoint(const Vector2f& Position, const Color& Col = Color(255, 255, 255), const Color& OutlineCol = Color(0, 0, 0));
void AddPoint(const Vector2f& position, const Color& color = Color(255, 255, 255), const Color& outlineColor = Color(0, 0, 0));
////////////////////////////////////////////////////////////
/// Get the number of points composing the shape
@ -82,94 +82,94 @@ public :
/// Enable or disable filling the shape.
/// Fill is enabled by default
///
/// \param Enable : True to enable, false to disable
/// \param enable : True to enable, false to disable
///
////////////////////////////////////////////////////////////
void EnableFill(bool Enable);
void EnableFill(bool enable);
////////////////////////////////////////////////////////////
/// Enable or disable drawing the shape outline.
/// Outline is enabled by default
///
/// \param Enable : True to enable, false to disable
/// \param enable : True to enable, false to disable
///
////////////////////////////////////////////////////////////
void EnableOutline(bool Enable);
void EnableOutline(bool enable);
////////////////////////////////////////////////////////////
/// Set the position of a point
///
/// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
/// \param Position : New position of the Index-th point
/// \param index : Index of the point, in range [0, GetNbPoints() - 1]
/// \param position : New position of the index-th point
///
////////////////////////////////////////////////////////////
void SetPointPosition(unsigned int Index, const Vector2f& Position);
void SetPointPosition(unsigned int index, const Vector2f& position);
////////////////////////////////////////////////////////////
/// Set the position of a point
///
/// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
/// \param X : New X coordinate of the Index-th point
/// \param Y : New Y coordinate of the Index-th point
/// \param index : Index of the point, in range [0, GetNbPoints() - 1]
/// \param x : New X coordinate of the index-th point
/// \param y : New Y coordinate of the index-th point
///
////////////////////////////////////////////////////////////
void SetPointPosition(unsigned int Index, float X, float Y);
void SetPointPosition(unsigned int index, float x, float y);
////////////////////////////////////////////////////////////
/// Set the color of a point
///
/// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
/// \param Col : New color of the Index-th point
/// \param index : Index of the point, in range [0, GetNbPoints() - 1]
/// \param color : New color of the index-th point
///
////////////////////////////////////////////////////////////
void SetPointColor(unsigned int Index, const Color& Col);
void SetPointColor(unsigned int index, const Color& color);
////////////////////////////////////////////////////////////
/// Set the outline color of a point
///
/// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
/// \param OutlineCol : New outline color of the Index-th point
/// \param index : Index of the point, in range [0, GetNbPoints() - 1]
/// \param outlineColor : New outline color of the index-th point
///
////////////////////////////////////////////////////////////
void SetPointOutlineColor(unsigned int Index, const Color& OutlineCol);
void SetPointOutlineColor(unsigned int index, const Color& outlineColor);
////////////////////////////////////////////////////////////
/// Change the width of the shape outline
///
/// \param Width : New width
/// \param width : New width
///
////////////////////////////////////////////////////////////
void SetOutlineWidth(float Width);
void SetOutlineWidth(float width);
////////////////////////////////////////////////////////////
/// Get the position of a point
///
/// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
/// \param index : Index of the point, in range [0, GetNbPoints() - 1]
///
/// \return Position of the Index-th point
/// \return Position of the index-th point
///
////////////////////////////////////////////////////////////
const Vector2f& GetPointPosition(unsigned int Index) const;
const Vector2f& GetPointPosition(unsigned int index) const;
////////////////////////////////////////////////////////////
/// Get the color of a point
///
/// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
/// \param Index : index of the point, in range [0, GetNbPoints() - 1]
///
/// \return Color of the Index-th point
/// \return Color of the index-th point
///
////////////////////////////////////////////////////////////
const Color& GetPointColor(unsigned int Index) const;
const Color& GetPointColor(unsigned int index) const;
////////////////////////////////////////////////////////////
/// Get the outline color of a point
///
/// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
/// \param index : Index of the point, in range [0, GetNbPoints() - 1]
///
/// \return Outline color of the Index-th point
/// \return Outline color of the index-th point
///
////////////////////////////////////////////////////////////
const Color& GetPointOutlineColor(unsigned int Index) const;
const Color& GetPointOutlineColor(unsigned int index) const;
////////////////////////////////////////////////////////////
/// Get the width of the shape outline
@ -182,76 +182,76 @@ public :
////////////////////////////////////////////////////////////
/// Create a shape made of a single line (use floats)
///
/// \param P1X, P1Y : Position of the first point
/// \param P2X, P2Y : Position second point
/// \param Thickness : Line thickness
/// \param Col : Color used to draw the line
/// \param Outline : Outline width (0 by default)
/// \param OutlineCol : Color used to draw the outline (black by default)
/// \param p1x, p1y : Position of the first point
/// \param p2x, p2y : Position second point
/// \param thickness : Line thickness
/// \param color : Color used to draw the line
/// \param outline : Outline width (0 by default)
/// \param outlineColor : Color used to draw the outline (black by default)
///
////////////////////////////////////////////////////////////
static Shape Line(float P1X, float P1Y, float P2X, float P2Y, float Thickness, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
static Shape Line(float p1x, float p1y, float p2x, float p2y, float thickness, const Color& color, float outline = 0.f, const Color& outlineColor = sf::Color(0, 0, 0));
////////////////////////////////////////////////////////////
/// Create a shape made of a single line (use vectors)
///
/// \param P1X, P1Y : Position of the first point
/// \param P2X, P2Y : Position second point
/// \param Thickness : Line thickness
/// \param Col : Color used to draw the line
/// \param Outline : Outline width (0 by default)
/// \param OutlineCol : Color used to draw the outline (black by default)
/// \param p1 : Position of the first point
/// \param p2 : Position second point
/// \param thickness : Line thickness
/// \param color : Color used to draw the line
/// \param outline : Outline width (0 by default)
/// \param outlineColor : Color used to draw the outline (black by default)
///
////////////////////////////////////////////////////////////
static Shape Line(const Vector2f& P1, const Vector2f& P2, float Thickness, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
static Shape Line(const Vector2f& p1, const Vector2f& p2, float thickness, const Color& color, float outline = 0.f, const Color& outlineColor = sf::Color(0, 0, 0));
////////////////////////////////////////////////////////////
/// Create a shape made of a single rectangle (use floats)
///
/// \param P1X, P1Y : Position of the first point
/// \param P2X, P2Y : Position second point
/// \param Col : Color used to fill the rectangle
/// \param Outline : Outline width (0 by default)
/// \param OutlineCol : Color used to draw the outline (black by default)
/// \param p1x, p1y : Position of the first point
/// \param p2x, p2y : Position second point
/// \param color : Color used to fill the rectangle
/// \param outline : Outline width (0 by default)
/// \param outlineColor : Color used to draw the outline (black by default)
///
////////////////////////////////////////////////////////////
static Shape Rectangle(float P1X, float P1Y, float P2X, float P2Y, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
static Shape Rectangle(float p1x, float p1y, float p2x, float p2y, const Color& color, float outline = 0.f, const Color& outlineColor = sf::Color(0, 0, 0));
////////////////////////////////////////////////////////////
/// Create a shape made of a single rectangle (use vectors)
///
/// \param P1 : Position of the first point
/// \param P2 : Position second point
/// \param Col : Color used to fill the rectangle
/// \param Outline : Outline width (0 by default)
/// \param OutlineCol : Color used to draw the outline (black by default)
/// \param p1 : Position of the first point
/// \param p2 : Position second point
/// \param color : Color used to fill the rectangle
/// \param outline : Outline width (0 by default)
/// \param outlineColor : Color used to draw the outline (black by default)
///
////////////////////////////////////////////////////////////
static Shape Rectangle(const Vector2f& P1, const Vector2f& P2, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
static Shape Rectangle(const Vector2f& p1, const Vector2f& p2, const Color& color, float outline = 0.f, const Color& outlineColor = sf::Color(0, 0, 0));
////////////////////////////////////////////////////////////
/// Create a shape made of a single circle (use floats)
///
/// \param X, Y : Position of the center
/// \param Radius : Radius
/// \param Col : Color used to fill the circle
/// \param Outline : Outline width (0 by default)
/// \param OutlineCol : Color used to draw the outline (black by default)
/// \param x, y : Position of the center
/// \param radius : Radius
/// \param color : Color used to fill the circle
/// \param outline : Outline width (0 by default)
/// \param outlineColor : Color used to draw the outline (black by default)
///
////////////////////////////////////////////////////////////
static Shape Circle(float X, float Y, float Radius, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
static Shape Circle(float x, float y, float radius, const Color& color, float outline = 0.f, const Color& outlineColor = sf::Color(0, 0, 0));
////////////////////////////////////////////////////////////
/// Create a shape made of a single circle (use vectors)
///
/// \param Center : Position of the center
/// \param Radius : Radius
/// \param Col : Color used to fill the circle
/// \param Outline : Outline width (0 by default)
/// \param OutlineCol : Color used to draw the outline (black by default)
/// \param center : Position of the center
/// \param radius : Radius
/// \param color : Color used to fill the circle
/// \param outline : Outline width (0 by default)
/// \param outlineColor : Color used to draw the outline (black by default)
///
////////////////////////////////////////////////////////////
static Shape Circle(const Vector2f& Center, float Radius, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
static Shape Circle(const Vector2f& center, float radius, const Color& color, float outline = 0.f, const Color& outlineColor = sf::Color(0, 0, 0));
protected :
@ -259,7 +259,7 @@ protected :
/// /see Drawable::Render
///
////////////////////////////////////////////////////////////
virtual void Render(RenderTarget& Target) const;
virtual void Render(RenderTarget& target) const;
private :
@ -272,21 +272,21 @@ private :
////////////////////////////////////////////////////////////
/// Compute the normal of a given 2D segment
///
/// \param P1 : First point of the segment
/// \param P2 : Second point of the segment
/// \param Normal : Calculated normal
/// \param p1 : First point of the segment
/// \param p2 : Second point of the segment
/// \param normal : Calculated normal
///
/// \return False if the normal couldn't be calculated (segment is null)
///
////////////////////////////////////////////////////////////
static bool ComputeNormal(const Vector2f& P1, const Vector2f& P2, Vector2f& Normal);
static bool ComputeNormal(const Vector2f& p1, const Vector2f& p2, Vector2f& normal);
////////////////////////////////////////////////////////////
/// Defines a simple 2D point
////////////////////////////////////////////////////////////
struct Point
{
Point(const Vector2f& Pos = Vector2f(0, 0), const Color& C = Color(255, 255, 255), const Color& OutlineC = Color(255, 255, 255));
Point(const Vector2f& position = Vector2f(0, 0), const Color& color = Color(255, 255, 255), const Color& outlineColor = Color(255, 255, 255));
Vector2f Position; ///< Position
Vector2f Normal; ///< Extruded normal

View file

@ -54,66 +54,66 @@ public :
////////////////////////////////////////////////////////////
/// Construct the sprite from a source image
///
/// \param Img : Image of the sprite
/// \param Position : Position of the sprite (0, 0 by default)
/// \param Scale : Scale factor (1, 1 by default)
/// \param Rotation : Orientation, in degrees (0 by default)
/// \param Col : Color of the sprite (white by default)
/// \param image : Image of the sprite
/// \param position : Position of the sprite (0, 0 by default)
/// \param scale : Scale factor (1, 1 by default)
/// \param rotation : Orientation, in degrees (0 by default)
/// \param color : Color of the sprite (white by default)
///
////////////////////////////////////////////////////////////
Sprite(const Image& Img, const Vector2f& Position = Vector2f(0, 0), const Vector2f& Scale = Vector2f(1, 1), float Rotation = 0.f, const Color& Col = Color(255, 255, 255, 255));
Sprite(const Image& image, const Vector2f& position = Vector2f(0, 0), const Vector2f& scale = Vector2f(1, 1), float rotation = 0.f, const Color& color = Color(255, 255, 255, 255));
////////////////////////////////////////////////////////////
/// Change the image of the sprite
///
/// \param Img : New image
/// \param image : New image
///
////////////////////////////////////////////////////////////
void SetImage(const Image& Img);
void SetImage(const Image& image);
////////////////////////////////////////////////////////////
/// Set the sub-rectangle of the sprite inside the source image.
/// By default, the subrect covers the entire source image
///
/// \param SubRect : New sub-rectangle
/// \param rectangle : New sub-rectangle
///
////////////////////////////////////////////////////////////
void SetSubRect(const IntRect& SubRect);
void SetSubRect(const IntRect& rectangle);
////////////////////////////////////////////////////////////
/// Resize the sprite (by changing its scale factors) (take 2 values).
/// The default size is defined by the subrect
///
/// \param Width : New width (must be strictly positive)
/// \param Height : New height (must be strictly positive)
/// \param width : New width (must be strictly positive)
/// \param height : New height (must be strictly positive)
///
////////////////////////////////////////////////////////////
void Resize(float Width, float Height);
void Resize(float width, float height);
////////////////////////////////////////////////////////////
/// Resize the sprite (by changing its scale factors) (take a 2D vector).
/// The default size is defined by the subrect
///
/// \param Size : New size (both coordinates must be strictly positive)
/// \param size : New size (both coordinates must be strictly positive)
///
////////////////////////////////////////////////////////////
void Resize(const Vector2f& Size);
void Resize(const Vector2f& size);
////////////////////////////////////////////////////////////
/// Flip the sprite horizontally
///
/// \param Flipped : True to flip the sprite
/// \param flipped : True to flip the sprite
///
////////////////////////////////////////////////////////////
void FlipX(bool Flipped);
void FlipX(bool flipped);
////////////////////////////////////////////////////////////
/// Flip the sprite vertically
///
/// \param Flipped : True to flip the sprite
/// \param flipped : True to flip the sprite
///
////////////////////////////////////////////////////////////
void FlipY(bool Flipped);
void FlipY(bool flipped);
////////////////////////////////////////////////////////////
/// Get the source image of the sprite
@ -143,13 +143,13 @@ public :
/// Get the color of a given pixel in the sprite
/// (point is in local coordinates)
///
/// \param X : X coordinate of the pixel to get
/// \param Y : Y coordinate of the pixel to get
/// \param x : X coordinate of the pixel to get
/// \param y : Y coordinate of the pixel to get
///
/// \return Color of pixel (X, Y)
/// \return Color of pixel (x, y)
///
////////////////////////////////////////////////////////////
Color GetPixel(unsigned int X, unsigned int Y) const;
Color GetPixel(unsigned int x, unsigned int y) const;
protected :
@ -157,7 +157,7 @@ protected :
/// /see Drawable::Render
///
////////////////////////////////////////////////////////////
virtual void Render(RenderTarget& Target) const;
virtual void Render(RenderTarget& target) const;
private :

View file

@ -65,46 +65,46 @@ public :
////////////////////////////////////////////////////////////
/// Construct the string from any kind of text
///
/// \param Text : Text assigned to the string
/// \param Font : Font used to draw the string (SFML built-in font by default)
/// \param Size : Characters size (30 by default)
/// \param text : Text assigned to the string
/// \param font : Font used to draw the string (SFML built-in font by default)
/// \param size : Characters size (30 by default)
///
////////////////////////////////////////////////////////////
explicit String(const Unicode::Text& Text, const Font& CharFont = Font::GetDefaultFont(), float Size = 30.f);
explicit String(const Unicode::Text& text, const Font& font = Font::GetDefaultFont(), float size = 30.f);
////////////////////////////////////////////////////////////
/// Set the text (from any kind of string)
///
/// \param Text : New text
/// \param text : New text
///
////////////////////////////////////////////////////////////
void SetText(const Unicode::Text& Text);
void SetText(const Unicode::Text& text);
////////////////////////////////////////////////////////////
/// Set the font of the string
///
/// \param Font : Font to use
/// \param font : Font to use
///
////////////////////////////////////////////////////////////
void SetFont(const Font& CharFont);
void SetFont(const Font& font);
////////////////////////////////////////////////////////////
/// Set the size of the string
/// The default size is 30
///
/// \param Size : New size, in pixels
/// \param size : New size, in pixels
///
////////////////////////////////////////////////////////////
void SetSize(float Size);
void SetSize(float size);
////////////////////////////////////////////////////////////
/// Set the style of the text
/// The default style is Regular
///
/// \param TextStyle : New text style, (combination of Style enum values)
/// \param style : New text style (combination of Style enum values)
///
////////////////////////////////////////////////////////////
void SetStyle(unsigned long TextStyle);
void SetStyle(unsigned long style);
////////////////////////////////////////////////////////////
/// Get the text (the returned text can be converted implicitely to any kind of string)
@ -143,12 +143,12 @@ public :
/// in coordinates relative to the string
/// (note : translation, center, rotation and scale are not applied)
///
/// \param Index : Index of the character
/// \param index : Index of the character
///
/// \return Position of the Index-th character (end of string if Index is out of range)
/// \return Position of the index-th character (end of string if Index is out of range)
///
////////////////////////////////////////////////////////////
sf::Vector2f GetCharacterPos(std::size_t Index) const;
sf::Vector2f GetCharacterPos(std::size_t index) const;
////////////////////////////////////////////////////////////
/// Get the string rectangle on screen
@ -164,7 +164,7 @@ protected :
/// /see Drawable::Render
///
////////////////////////////////////////////////////////////
virtual void Render(RenderTarget& Target) const;
virtual void Render(RenderTarget& target) const;
private :

View file

@ -60,61 +60,61 @@ public :
////////////////////////////////////////////////////////////
/// Construct the view from a rectangle
///
/// \param Rectangle : Rectangle defining the view
/// \param rectangle : Rectangle defining the view
///
////////////////////////////////////////////////////////////
explicit View(const FloatRect& Rectangle);
explicit View(const FloatRect& rectangle);
////////////////////////////////////////////////////////////
/// Construct the view from its center and size
///
/// \param Center : Center of the view
/// \param HalfSize : Size of the view
/// \param center : Center of the view
/// \param size : Size of the view
///
////////////////////////////////////////////////////////////
View(const Vector2f& Center, const Vector2f& Size);
View(const Vector2f& center, const Vector2f& size);
////////////////////////////////////////////////////////////
/// Change the center of the view
///
/// \param X : X coordinate of the new center
/// \param Y : Y coordinate of the new center
/// \param x : X coordinate of the new center
/// \param y : Y coordinate of the new center
///
////////////////////////////////////////////////////////////
void SetCenter(float X, float Y);
void SetCenter(float x, float y);
////////////////////////////////////////////////////////////
/// Change the center of the view
///
/// \param Center : New center
/// \param center : New center
///
////////////////////////////////////////////////////////////
void SetCenter(const Vector2f& Center);
void SetCenter(const Vector2f& center);
////////////////////////////////////////////////////////////
/// Change the size of the view
///
/// \param Width : New width
/// \param Height : New height
/// \param width : New width
/// \param height : New height
///
////////////////////////////////////////////////////////////
void SetSize(float Width, float Height);
void SetSize(float width, float height);
////////////////////////////////////////////////////////////
/// Change the size of the view
///
/// \param HalfSize : New half-size
/// \param size : New half-size
///
////////////////////////////////////////////////////////////
void SetSize(const Vector2f& Size);
void SetSize(const Vector2f& size);
////////////////////////////////////////////////////////////
/// Set the angle of rotation of the view
///
/// \param Angle : New angle, in degrees
/// \param angle : New angle, in degrees
///
////////////////////////////////////////////////////////////
void SetRotation(float Angle);
void SetRotation(float angle);
////////////////////////////////////////////////////////////
/// Set the target viewport
@ -126,19 +126,19 @@ public :
/// For example, a view which takes the left side of the target would
/// be defined with View.SetViewport(sf::FloatRect(0, 0, 0.5, 1)).
///
/// \param Viewport : New viewport
/// \param viewport : New viewport
///
////////////////////////////////////////////////////////////
void SetViewport(const FloatRect& Viewport);
void SetViewport(const FloatRect& viewport);
////////////////////////////////////////////////////////////
/// Reset the view to the given rectangle.
/// Note: this function resets the rotation angle to 0.
///
/// \param Rectangle : Rectangle defining the view
/// \param rectangle : Rectangle defining the view
///
////////////////////////////////////////////////////////////
void Reset(const FloatRect& Rectangle);
void Reset(const FloatRect& rectangle);
////////////////////////////////////////////////////////////
/// Get the center of the view
@ -175,35 +175,35 @@ public :
////////////////////////////////////////////////////////////
/// Move the view
///
/// \param OffsetX : Offset to move the view, on X axis
/// \param OffsetY : Offset to move the view, on Y axis
/// \param offsetX : Offset to move the view, on X axis
/// \param offsetY : Offset to move the view, on Y axis
///
////////////////////////////////////////////////////////////
void Move(float OffsetX, float OffsetY);
void Move(float offsetX, float offsetY);
////////////////////////////////////////////////////////////
/// Move the view
///
/// \param Offset : Offset to move the view
/// \param offset : Offset to move the view
///
////////////////////////////////////////////////////////////
void Move(const Vector2f& Offset);
void Move(const Vector2f& offset);
////////////////////////////////////////////////////////////
/// Rotate the view
///
/// \param Angle : Angle to rotate, in degrees
/// \param angle : Angle to rotate, in degrees
///
////////////////////////////////////////////////////////////
void Rotate(float Angle);
void Rotate(float angle);
////////////////////////////////////////////////////////////
/// Resize the view rectangle to simulate a zoom / unzoom effect
///
/// \param Factor : Zoom factor to apply, relative to the current size
/// \param factor : Zoom factor to apply, relative to the current size
///
////////////////////////////////////////////////////////////
void Zoom(float Factor);
void Zoom(float factor);
////////////////////////////////////////////////////////////
/// Get the projection matrix of the view