summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristoph Egger <Christoph.Egger@gmx.de>2010-04-07 22:00:13 +0200
committerChristoph Egger <Christoph.Egger@gmx.de>2010-04-07 22:00:13 +0200
commit46bf1cf82d855660c212ee3421dff3050ec8ffea (patch)
treef0fadfc004a86242ad096dee015ed7c20cc7f554 /include
parent25177f23f35afa0e6ebdd63d581003c298d3a7df (diff)
Imported Upstream version 1.6+repack1
Diffstat (limited to 'include')
-rwxr-xr-xinclude/SFML/Audio/Music.hpp2
-rwxr-xr-xinclude/SFML/Audio/Sound.hpp11
-rwxr-xr-xinclude/SFML/Audio/SoundBuffer.hpp25
-rwxr-xr-xinclude/SFML/Audio/SoundStream.hpp19
-rwxr-xr-xinclude/SFML/Config.hpp2
-rwxr-xr-xinclude/SFML/Graphics/Image.hpp8
-rwxr-xr-xinclude/SFML/Graphics/Matrix3.inl2
-rwxr-xr-xinclude/SFML/Graphics/RenderWindow.hpp2
-rwxr-xr-xinclude/SFML/Graphics/Sprite.hpp2
-rwxr-xr-xinclude/SFML/Network/SocketTCP.hpp6
-rwxr-xr-xinclude/SFML/Network/SocketUDP.hpp6
-rwxr-xr-xinclude/SFML/Window/Event.hpp16
-rwxr-xr-xinclude/SFML/Window/Input.hpp18
-rwxr-xr-xinclude/SFML/Window/Window.hpp4
14 files changed, 86 insertions, 37 deletions
diff --git a/include/SFML/Audio/Music.hpp b/include/SFML/Audio/Music.hpp
index de74995..0b8f70d 100755
--- a/include/SFML/Audio/Music.hpp
+++ b/include/SFML/Audio/Music.hpp
@@ -55,7 +55,7 @@ public :
/// (ie. size taken by the music in memory) (44100 by default)
///
////////////////////////////////////////////////////////////
- Music(std::size_t BufferSize = 44100);
+ explicit Music(std::size_t BufferSize = 44100);
////////////////////////////////////////////////////////////
/// Destructor
diff --git a/include/SFML/Audio/Sound.hpp b/include/SFML/Audio/Sound.hpp
index 691d633..7cb8002 100755
--- a/include/SFML/Audio/Sound.hpp
+++ b/include/SFML/Audio/Sound.hpp
@@ -72,7 +72,7 @@ public :
/// \param Position : Position (0, 0, 0 by default)
///
////////////////////////////////////////////////////////////
- Sound(const SoundBuffer& Buffer, bool Loop = false, float Pitch = 1.f, float Volume = 100.f, const Vector3f& Position = Vector3f(0, 0, 0));
+ explicit Sound(const SoundBuffer& Buffer, bool Loop = false, float Pitch = 1.f, float Volume = 100.f, const Vector3f& Position = Vector3f(0, 0, 0));
////////////////////////////////////////////////////////////
/// Copy constructor
@@ -288,6 +288,15 @@ public :
////////////////////////////////////////////////////////////
Sound& operator =(const Sound& Other);
+ ////////////////////////////////////////////////////////////
+ /// Reset the internal buffer
+ ///
+ /// This function is for internal use only, you don't have
+ /// to use it.
+ ///
+ ////////////////////////////////////////////////////////////
+ void ResetBuffer();
+
private :
friend class SoundStream;
diff --git a/include/SFML/Audio/SoundBuffer.hpp b/include/SFML/Audio/SoundBuffer.hpp
index af459f4..023e5aa 100755
--- a/include/SFML/Audio/SoundBuffer.hpp
+++ b/include/SFML/Audio/SoundBuffer.hpp
@@ -32,10 +32,13 @@
#include <SFML/Audio/AudioResource.hpp>
#include <string>
#include <vector>
+#include <set>
namespace sf
{
+class Sound;
+
////////////////////////////////////////////////////////////
/// SoundBuffer is the low-level for loading and manipulating
/// sound buffers
@@ -175,11 +178,33 @@ private :
bool Update(unsigned int ChannelsCount, unsigned int SampleRate);
////////////////////////////////////////////////////////////
+ /// Add a sound to the list of sounds that use this buffer
+ ///
+ /// \param Instance : Sound object to attach
+ ///
+ ////////////////////////////////////////////////////////////
+ void AttachSound(Sound* Instance) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Remove a sound from the list of sounds that use this buffer
+ ///
+ /// \param Instance : Sound object to detach
+ ///
+ ////////////////////////////////////////////////////////////
+ void DetachSound(Sound* Instance) const;
+
+ ////////////////////////////////////////////////////////////
+ // Types
+ ////////////////////////////////////////////////////////////
+ typedef std::set<Sound*> SoundList; ///< Set of unique sound instances
+
+ ////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
unsigned int myBuffer; ///< OpenAL buffer identifier
std::vector<Int16> mySamples; ///< Samples buffer
float myDuration; ///< Sound duration, in seconds
+ mutable SoundList mySounds; ///< List of sounds that are using this buffer
};
} // namespace sf
diff --git a/include/SFML/Audio/SoundStream.hpp b/include/SFML/Audio/SoundStream.hpp
index 6df0c57..67b2bab 100755
--- a/include/SFML/Audio/SoundStream.hpp
+++ b/include/SFML/Audio/SoundStream.hpp
@@ -186,12 +186,12 @@ private :
/// Fill a new buffer with audio data, and push it to the
/// playing queue
///
- /// \param Buffer : Buffer to fill
+ /// \param Buffer : Number of the buffer to fill (in [0, BuffersCount])
///
/// \return True if the derived class has requested to stop
///
////////////////////////////////////////////////////////////
- bool FillAndPushBuffer(unsigned int Buffer);
+ bool FillAndPushBuffer(unsigned int BufferNum);
////////////////////////////////////////////////////////////
/// Fill the buffers queue with all available buffers
@@ -212,13 +212,14 @@ private :
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- bool myIsStreaming; ///< Streaming state (true = playing, false = stopped)
- unsigned int myBuffers[BuffersCount]; ///< Sound buffers used to store temporary audio data
- unsigned int myChannelsCount; ///< Number of channels (1 = mono, 2 = stereo, ...)
- unsigned int mySampleRate; ///< Frequency (samples / second)
- unsigned long myFormat; ///< Format of the internal sound buffers
- bool myLoop; ///< Loop flag (true to loop, false to play once)
- unsigned int mySamplesProcessed; ///< Number of buffers processed since beginning of the stream
+ bool myIsStreaming; ///< Streaming state (true = playing, false = stopped)
+ unsigned int myBuffers[BuffersCount]; ///< Sound buffers used to store temporary audio data
+ unsigned int myChannelsCount; ///< Number of channels (1 = mono, 2 = stereo, ...)
+ unsigned int mySampleRate; ///< Frequency (samples / second)
+ unsigned long myFormat; ///< Format of the internal sound buffers
+ bool myLoop; ///< Loop flag (true to loop, false to play once)
+ unsigned int mySamplesProcessed; ///< Number of buffers processed since beginning of the stream
+ bool myEndBuffers[BuffersCount]; ///< Each buffer is marked as "end buffer" or not, for proper duration calculation
};
} // namespace sf
diff --git a/include/SFML/Config.hpp b/include/SFML/Config.hpp
index 91d052f..84ec60f 100755
--- a/include/SFML/Config.hpp
+++ b/include/SFML/Config.hpp
@@ -49,7 +49,7 @@
// MacOS
#define SFML_SYSTEM_MACOS
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
// FreeBSD
#define SFML_SYSTEM_FREEBSD
diff --git a/include/SFML/Graphics/Image.hpp b/include/SFML/Graphics/Image.hpp
index 2a32271..c2f5c89 100755
--- a/include/SFML/Graphics/Image.hpp
+++ b/include/SFML/Graphics/Image.hpp
@@ -37,7 +37,6 @@
namespace sf
{
-class RenderImage;
class RenderWindow;
////////////////////////////////////////////////////////////
@@ -252,13 +251,12 @@ 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 Rect : Sub-rectangle of image to convert
///
/// \return Texture coordinates corresponding to the sub-rectangle
///
////////////////////////////////////////////////////////////
- FloatRect GetTexCoords(const IntRect& Rect, bool Adjust = true) const;
+ FloatRect GetTexCoords(const IntRect& Rect) const;
////////////////////////////////////////////////////////////
/// Get a valid texture size according to hardware support
@@ -282,8 +280,6 @@ public :
private :
- friend class RenderImage;
-
////////////////////////////////////////////////////////////
/// Create the OpenGL texture
///
diff --git a/include/SFML/Graphics/Matrix3.inl b/include/SFML/Graphics/Matrix3.inl
index 73c78b7..4499415 100755
--- a/include/SFML/Graphics/Matrix3.inl
+++ b/include/SFML/Graphics/Matrix3.inl
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////
//
-// SFGE - Simple and Fast Game Engine
+// SFGE - Simple and Fast Multimedia Library
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
diff --git a/include/SFML/Graphics/RenderWindow.hpp b/include/SFML/Graphics/RenderWindow.hpp
index 7c09044..088e368 100755
--- a/include/SFML/Graphics/RenderWindow.hpp
+++ b/include/SFML/Graphics/RenderWindow.hpp
@@ -57,7 +57,7 @@ public :
///
/// \param Mode : Video mode to use
/// \param Title : Title of the window
- /// \param WindowStyle : Window style (Resize | Close by default)
+ /// \param WindowStyle : Window style, see sf::Style (Resize | Close by default)
/// \param Params : Creation parameters (see default constructor for default values)
///
////////////////////////////////////////////////////////////
diff --git a/include/SFML/Graphics/Sprite.hpp b/include/SFML/Graphics/Sprite.hpp
index d5d835e..9d47bb4 100755
--- a/include/SFML/Graphics/Sprite.hpp
+++ b/include/SFML/Graphics/Sprite.hpp
@@ -61,7 +61,7 @@ public :
/// \param Col : 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));
+ explicit 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));
////////////////////////////////////////////////////////////
/// Change the image of the sprite
diff --git a/include/SFML/Network/SocketTCP.hpp b/include/SFML/Network/SocketTCP.hpp
index 964686a..8929dc9 100755
--- a/include/SFML/Network/SocketTCP.hpp
+++ b/include/SFML/Network/SocketTCP.hpp
@@ -214,8 +214,10 @@ private :
// Member data
////////////////////////////////////////////////////////////
SocketHelper::SocketType mySocket; ///< Socket descriptor
- std::vector<char> myPendingPacket; ///< Data of the current pending packet, if any (in non-blocking mode)
- Int32 myPendingPacketSize; ///< Size of the current pending packet, if any (in non-blocking mode)
+ Uint32 myPendingHeader; ///< Data of the current pending packet header, if any
+ Uint32 myPendingHeaderSize; ///< Size of the current pending packet header, if any
+ std::vector<char> myPendingPacket; ///< Data of the current pending packet, if any
+ Int32 myPendingPacketSize; ///< Size of the current pending packet, if any
bool myIsBlocking; ///< Is the socket blocking or non-blocking ?
};
diff --git a/include/SFML/Network/SocketUDP.hpp b/include/SFML/Network/SocketUDP.hpp
index 37df3f7..7cb6b19 100755
--- a/include/SFML/Network/SocketUDP.hpp
+++ b/include/SFML/Network/SocketUDP.hpp
@@ -215,8 +215,10 @@ private :
////////////////////////////////////////////////////////////
SocketHelper::SocketType mySocket; ///< Socket identifier
unsigned short myPort; ///< Port to which the socket is bound
- std::vector<char> myPendingPacket; ///< Data of the current pending packet, if any (in non-blocking mode)
- Int32 myPendingPacketSize; ///< Size of the current pending packet, if any (in non-blocking mode)
+ Uint32 myPendingHeader; ///< Data of the current pending packet header, if any
+ Uint32 myPendingHeaderSize; ///< Size of the current pending packet header, if any
+ std::vector<char> myPendingPacket; ///< Data of the current pending packet, if any
+ Int32 myPendingPacketSize; ///< Size of the current pending packet, if any
bool myIsBlocking; ///< Is the socket blocking or non-blocking ?
};
diff --git a/include/SFML/Window/Event.hpp b/include/SFML/Window/Event.hpp
index 142fff5..35ac575 100755
--- a/include/SFML/Window/Event.hpp
+++ b/include/SFML/Window/Event.hpp
@@ -142,7 +142,7 @@ namespace Key
F15,
Pause,
- Count // For internal use
+ Count // Keep last -- total number of keyboard keys
};
}
@@ -160,7 +160,7 @@ namespace Mouse
XButton1,
XButton2,
- Count // For internal use
+ ButtonCount // Keep last -- total number of mouse buttons
};
}
@@ -180,7 +180,13 @@ namespace Joy
AxisV,
AxisPOV,
- Count // For internal use
+ AxisCount // Keep last -- total number of joystick axis
+ };
+
+ enum
+ {
+ Count = 4, ///< Total number of supported joysticks
+ ButtonCount = 32 ///< Total number of supported joystick buttons
};
}
@@ -286,7 +292,9 @@ public :
MouseLeft,
JoyButtonPressed,
JoyButtonReleased,
- JoyMoved
+ JoyMoved,
+
+ Count // Keep last -- total number of event types
};
////////////////////////////////////////////////////////////
diff --git a/include/SFML/Window/Input.hpp b/include/SFML/Window/Input.hpp
index fbac66a..e9e9c5e 100755
--- a/include/SFML/Window/Input.hpp
+++ b/include/SFML/Window/Input.hpp
@@ -118,14 +118,20 @@ private :
virtual void OnEvent(const Event& EventReceived);
////////////////////////////////////////////////////////////
+ /// Reset all the states
+ ///
+ ////////////////////////////////////////////////////////////
+ void ResetStates();
+
+ ////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- bool myKeys[Key::Count]; ///< Array containing the state of all keyboard keys
- bool myMouseButtons[Mouse::Count]; ///< Array containing the state of all mouse buttons
- bool myJoystickButtons[2][16]; ///< Array containing the state of all joysticks buttons
- int myMouseX; ///< Mouse position on X
- int myMouseY; ///< Mouse position on Y
- float myJoystickAxis[2][Joy::Count]; ///< Joysticks position on each axis
+ bool myKeys[Key::Count]; ///< Array containing the state of all keyboard keys
+ bool myMouseButtons[Mouse::ButtonCount]; ///< Array containing the state of all mouse buttons
+ int myMouseX; ///< Mouse position on X
+ int myMouseY; ///< Mouse position on Y
+ bool myJoystickButtons[Joy::Count][Joy::ButtonCount]; ///< Array containing the state of all joysticks buttons
+ float myJoystickAxis[Joy::Count][Joy::AxisCount]; ///< Joysticks position on each axis
};
} // namespace sf
diff --git a/include/SFML/Window/Window.hpp b/include/SFML/Window/Window.hpp
index cc56cf7..5199021 100755
--- a/include/SFML/Window/Window.hpp
+++ b/include/SFML/Window/Window.hpp
@@ -67,7 +67,7 @@ public :
///
/// \param Mode : Video mode to use
/// \param Title : Title of the window
- /// \param WindowStyle : Window style (Resize | Close by default)
+ /// \param WindowStyle : Window style, see sf::Style (Resize | Close by default)
/// \param Params : Creation parameters (see default constructor for default values)
///
////////////////////////////////////////////////////////////
@@ -93,7 +93,7 @@ public :
///
/// \param Mode : Video mode to use
/// \param Title : Title of the window
- /// \param WindowStyle : Window style (Resize | Close by default)
+ /// \param WindowStyle : Window style, see sf::Style (Resize | Close by default)
/// \param Params : Creation parameters (see default constructor for default values)
///
////////////////////////////////////////////////////////////