Times in SFML are now Uint32 milliseconds instead of float seconds
Added the sf::Uint64 and sf::Int64 types
This commit is contained in:
parent
c1ce16f4d6
commit
e4c6c30e0b
83 changed files with 250 additions and 262 deletions
|
@ -86,10 +86,10 @@ CSFML_API sfBool sfMusic_GetLoop(const sfMusic* music);
|
|||
///
|
||||
/// \param music : Music to get the duration from
|
||||
///
|
||||
/// \return Music duration, in seconds
|
||||
/// \return Music duration, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfMusic_GetDuration(const sfMusic* music);
|
||||
CSFML_API sfUint32 sfMusic_GetDuration(const sfMusic* music);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Start playing a music
|
||||
|
@ -150,10 +150,10 @@ CSFML_API sfSoundStatus sfMusic_GetStatus(const sfMusic* music);
|
|||
///
|
||||
/// \param music : Music to get the position from
|
||||
///
|
||||
/// \return Current playing position, expressed in seconds
|
||||
/// \return Current playing position, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfMusic_GetPlayingOffset(const sfMusic* music);
|
||||
CSFML_API sfUint32 sfMusic_GetPlayingOffset(const sfMusic* music);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Set the pitch of a music
|
||||
|
@ -221,10 +221,10 @@ CSFML_API void sfMusic_SetAttenuation(sfMusic* music, float attenuation);
|
|||
/// Set the current playing position of a music
|
||||
///
|
||||
/// \param music : Music to modify
|
||||
/// \param timeOffset : New playing position, expressed in seconds
|
||||
/// \param timeOffset : New playing position, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API void sfMusic_SetPlayingOffset(sfMusic* music, float timeOffset);
|
||||
CSFML_API void sfMusic_SetPlayingOffset(sfMusic* music, sfUint32 timeOffset);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the pitch of a music
|
||||
|
|
|
@ -197,10 +197,10 @@ CSFML_API void sfSound_SetAttenuation(sfSound* sound, float attenuation);
|
|||
/// Set the current playing position of a sound
|
||||
///
|
||||
/// \param sound : Sound to modify
|
||||
/// \param timeOffset : New playing position, expressed in seconds
|
||||
/// \param timeOffset : New playing position, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API void sfSound_SetPlayingOffset(sfSound* sound, float timeOffset);
|
||||
CSFML_API void sfSound_SetPlayingOffset(sfSound* sound, sfUint32 timeOffset);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the pitch of a sound
|
||||
|
@ -269,10 +269,10 @@ CSFML_API float sfSound_GetAttenuation(const sfSound* sound);
|
|||
///
|
||||
/// \param sound : Sound to get the position from
|
||||
///
|
||||
/// \return Current playing position, expressed in seconds
|
||||
/// \return Current playing position, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSound_GetPlayingOffset(const sfSound* sound);
|
||||
CSFML_API sfUint32 sfSound_GetPlayingOffset(const sfSound* sound);
|
||||
|
||||
|
||||
#endif // SFML_SOUND_H
|
||||
|
|
|
@ -142,10 +142,10 @@ CSFML_API unsigned int sfSoundBuffer_GetChannelsCount(const sfSoundBuffer* sound
|
|||
///
|
||||
/// \param soundBuffer : Sound buffer to get duration from
|
||||
///
|
||||
/// \return Sound duration, in seconds
|
||||
/// \return Sound duration, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSoundBuffer_GetDuration(const sfSoundBuffer* soundBuffer);
|
||||
CSFML_API sfUint32 sfSoundBuffer_GetDuration(const sfSoundBuffer* soundBuffer);
|
||||
|
||||
|
||||
#endif // SFML_SOUNDBUFFER_H
|
||||
|
|
|
@ -44,7 +44,7 @@ typedef struct
|
|||
} sfSoundStreamChunk;
|
||||
|
||||
typedef sfBool (*sfSoundStreamGetDataCallback)(sfSoundStreamChunk*, void*); ///< Type of the callback used to get a sound stream data
|
||||
typedef void (*sfSoundStreamSeekCallback)(float, void*); ///< Type of the callback used to seek in a sound stream
|
||||
typedef void (*sfSoundStreamSeekCallback)(sfUint32, void*); ///< Type of the callback used to seek in a sound stream
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
@ -194,10 +194,10 @@ CSFML_API void sfSoundStream_SetAttenuation(sfSoundStream* soundStream, float at
|
|||
/// Set the current playing position of a stream
|
||||
///
|
||||
/// \param soundStream : Sound stream to modify
|
||||
/// \param timeOffset : New playing position, expressed in seconds
|
||||
/// \param timeOffset : New playing position, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API void sfSoundStream_SetPlayingOffset(sfSoundStream* soundStream, float timeOffset);
|
||||
CSFML_API void sfSoundStream_SetPlayingOffset(sfSoundStream* soundStream, sfUint32 timeOffset);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Set a stream loop state
|
||||
|
@ -285,10 +285,10 @@ CSFML_API sfBool sfSoundStream_GetLoop(const sfSoundStream* soundStream);
|
|||
///
|
||||
/// \param soundStream : Sound stream to get the position from
|
||||
///
|
||||
/// \return Current playing position, expressed in seconds
|
||||
/// \return Current playing position, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSoundStream_GetPlayingOffset(const sfSoundStream* soundStream);
|
||||
CSFML_API sfUint32 sfSoundStream_GetPlayingOffset(const sfSoundStream* soundStream);
|
||||
|
||||
|
||||
#endif // SFML_SOUNDSTREAM_H
|
||||
|
|
|
@ -281,10 +281,10 @@ CSFML_API void sfRenderWindow_SetFramerateLimit(sfRenderWindow* renderWindow, un
|
|||
///
|
||||
/// \param renderWindow : Renderwindow object
|
||||
///
|
||||
/// \return Time elapsed, in seconds
|
||||
/// \return Time elapsed, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfRenderWindow_GetFrameTime(const sfRenderWindow* renderWindow);
|
||||
CSFML_API sfUint32 sfRenderWindow_GetFrameTime(const sfRenderWindow* renderWindow);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Change the joystick threshold, ie. the value below which
|
||||
|
|
|
@ -282,12 +282,12 @@ CSFML_API void sfFtp_Destroy(sfFtp* ftp);
|
|||
/// \param ftp : Ftp instance
|
||||
/// \param server : FTP server to connect to
|
||||
/// \param port : Port used for connection (21 by default, standard FTP port)
|
||||
/// \param timeout : Maximum time to wait (0 to use no timeout)
|
||||
/// \param timeout : Maximum time to wait, in milliseconds (0 to use no timeout)
|
||||
///
|
||||
/// \return Server response to the request
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfFtpResponse* sfFtp_Connect(sfFtp* ftp, sfIpAddress server, unsigned short port, float timeout);
|
||||
CSFML_API sfFtpResponse* sfFtp_Connect(sfFtp* ftp, sfIpAddress server, unsigned short port, sfUint32 timeout);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Log in using anonymous account
|
||||
|
|
|
@ -246,12 +246,12 @@ CSFML_API void sfHttp_SetHost(sfHttp* http, const char* host, unsigned short por
|
|||
///
|
||||
/// \param http : Http object
|
||||
/// \param request : Request to send
|
||||
/// \param timeout : Maximum time to wait (0 to use no timeout)
|
||||
/// \param timeout : Maximum time to wait, in milliseconds (0 to use no timeout)
|
||||
///
|
||||
/// \return Server's response, or NULL if request is invalid
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfHttpResponse* sfHttp_SendRequest(sfHttp* http, const sfHttpRequest* request, float timeout);
|
||||
CSFML_API sfHttpResponse* sfHttp_SendRequest(sfHttp* http, const sfHttpRequest* request, sfUint32 timeout);
|
||||
|
||||
|
||||
#endif // SFML_HTTP_H
|
||||
|
|
|
@ -104,12 +104,12 @@ CSFML_API sfIpAddress sfIpAddress_GetLocalAddress(void);
|
|||
/// distant website ; as a consequence, this function may be
|
||||
/// very slow -- use it as few as possible !
|
||||
///
|
||||
/// \param timeout : Maximum time to wait, in seconds (use 0 for no timeout)
|
||||
/// \param timeout : Maximum time to wait, in milliseconds (use 0 for no timeout)
|
||||
///
|
||||
/// \return Public IP address
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfIpAddress sfIpAddress_GetPublicAddress(float timeout);
|
||||
CSFML_API sfIpAddress sfIpAddress_GetPublicAddress(sfUint32 timeout);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the computer's loopback address
|
||||
|
|
|
@ -94,12 +94,12 @@ CSFML_API void sfSocketSelector_Clear(sfSocketSelector* selector);
|
|||
/// is ready, or when the given timeout is over
|
||||
///
|
||||
/// \param selector : Selector to check
|
||||
/// \param timeout : Maximum time to wait, in seconds (0 to disable timeout)
|
||||
/// \param timeout : Maximum time to wait, in milliseconds (0 to disable timeout)
|
||||
///
|
||||
/// \return sfTrue if there are sockets ready, sfFalse otherwise
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBool sfSocketSelector_Wait(sfSocketSelector* selector, float timeout);
|
||||
CSFML_API sfBool sfSocketSelector_Wait(sfSocketSelector* selector, sfUint32 timeout);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Test a socket to know if it is ready to receive data
|
||||
|
|
|
@ -106,12 +106,12 @@ CSFML_API unsigned short sfTcpSocket_GetRemotePort(const sfTcpSocket* socket);
|
|||
/// \param socket : Socket to connect
|
||||
/// \param host : IP Address of the host to connect to
|
||||
/// \param port : Port to use for transfers (warning : ports < 1024 are reserved)
|
||||
/// \param timeout : Maximum time to wait (0 to use no timeout)
|
||||
/// \param timeout : Maximum time to wait, in milliseconds (0 to use no timeout)
|
||||
///
|
||||
/// \return sfTrue if operation has been successful
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfSocketStatus sfTcpSocket_Connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, float timeout);
|
||||
CSFML_API sfSocketStatus sfTcpSocket_Connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfUint32 timeout);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Disconnect a connect from its remote peer
|
||||
|
|
|
@ -63,8 +63,10 @@ CSFML_API void sfClock_Destroy(sfClock* clock);
|
|||
///
|
||||
/// \param clock : Clock to get time from
|
||||
///
|
||||
/// \return Elapsed time, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfClock_GetTime(const sfClock* clock);
|
||||
CSFML_API sfUint32 sfClock_GetTime(const sfClock* clock);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Restart a clock
|
||||
|
|
|
@ -32,12 +32,12 @@
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Make the current thread sleep for a given time
|
||||
/// Make the current thread sleep for a given duration
|
||||
///
|
||||
/// \param duration : Time to sleep, in seconds
|
||||
/// \param duration : Time to sleep, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API void sfSleep(float duration);
|
||||
CSFML_API void sfSleep(sfUint32 duration);
|
||||
|
||||
|
||||
#endif // SFML_SLEEP_H
|
||||
|
|
|
@ -290,10 +290,10 @@ CSFML_API void sfWindow_SetFramerateLimit(sfWindow* window, unsigned int limit);
|
|||
///
|
||||
/// \param window : Window object
|
||||
///
|
||||
/// \return Time elapsed, in seconds
|
||||
/// \return Time elapsed, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfWindow_GetFrameTime(const sfWindow* window);
|
||||
CSFML_API sfUint32 sfWindow_GetFrameTime(const sfWindow* window);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Change the joystick threshold, ie. the value below which
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue