Times in SFML are now Uint32 milliseconds instead of float seconds

Added the sf::Uint64 and sf::Int64 types
This commit is contained in:
Laurent Gomila 2011-05-19 08:18:40 +02:00
parent c1ce16f4d6
commit e4c6c30e0b
83 changed files with 250 additions and 262 deletions

View file

@ -113,10 +113,10 @@ namespace SFML
////////////////////////////////////////////////////////////
/// <summary>
/// Total duration of the music, in seconds
/// Total duration of the music, in milliseconds
/// </summary>
////////////////////////////////////////////////////////////
public float Duration
public uint Duration
{
get {return sfMusic_GetDuration(This);}
}
@ -206,10 +206,10 @@ namespace SFML
////////////////////////////////////////////////////////////
/// <summary>
/// Current playing position, in seconds
/// Current playing position, in milliseconds
/// </summary>
////////////////////////////////////////////////////////////
public float PlayingOffset
public uint PlayingOffset
{
get {return sfMusic_GetPlayingOffset(This);}
set {sfMusic_SetPlayingOffset(This, value);}
@ -272,7 +272,7 @@ namespace SFML
static extern SoundStatus sfMusic_GetStatus(IntPtr Music);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfMusic_GetDuration(IntPtr Music);
static extern uint sfMusic_GetDuration(IntPtr Music);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern uint sfMusic_GetChannelsCount(IntPtr Music);
@ -302,7 +302,7 @@ namespace SFML
static extern void sfMusic_SetAttenuation(IntPtr Music, float Attenuation);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern void sfMusic_SetPlayingOffset(IntPtr Music, float TimeOffset);
static extern void sfMusic_SetPlayingOffset(IntPtr Music, uint TimeOffset);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern bool sfMusic_GetLoop(IntPtr Music);
@ -326,7 +326,7 @@ namespace SFML
static extern float sfMusic_GetAttenuation(IntPtr Music);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfMusic_GetPlayingOffset(IntPtr Music);
static extern uint sfMusic_GetPlayingOffset(IntPtr Music);
#endregion
}
}

View file

@ -151,10 +151,10 @@ namespace SFML
////////////////////////////////////////////////////////////
/// <summary>
/// Current playing position of the sound, in seconds
/// Current playing position of the sound, in milliseconds
/// </summary>
////////////////////////////////////////////////////////////
public float PlayingOffset
public uint PlayingOffset
{
get {return sfSound_GetPlayingOffset(This);}
set {sfSound_SetPlayingOffset(This, value);}
@ -297,7 +297,7 @@ namespace SFML
static extern void sfSound_SetAttenuation(IntPtr Sound, float Attenuation);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern void sfSound_SetPlayingOffset(IntPtr Sound, float TimeOffset);
static extern void sfSound_SetPlayingOffset(IntPtr Sound, uint TimeOffset);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfSound_GetPitch(IntPtr Sound);
@ -318,7 +318,7 @@ namespace SFML
static extern float sfSound_GetAttenuation(IntPtr Sound);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfSound_GetPlayingOffset(IntPtr Sound);
static extern uint sfSound_GetPlayingOffset(IntPtr Sound);
#endregion
}
}

View file

@ -122,10 +122,10 @@ namespace SFML
////////////////////////////////////////////////////////////
/// <summary>
/// Total duration of the buffer, in seconds
/// Total duration of the buffer, in milliseconds
/// </summary>
////////////////////////////////////////////////////////////
public float Duration
public uint Duration
{
get {return sfSoundBuffer_GetDuration(This);}
}
@ -202,7 +202,7 @@ namespace SFML
static extern uint sfSoundBuffer_GetChannelsCount(IntPtr SoundBuffer);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfSoundBuffer_GetDuration(IntPtr SoundBuffer);
static extern uint sfSoundBuffer_GetDuration(IntPtr SoundBuffer);
#endregion
}
}

View file

@ -171,10 +171,10 @@ namespace SFML
////////////////////////////////////////////////////////////
/// <summary>
/// Current playing position, in seconds
/// Current playing position, in milliseconds
/// </summary>
////////////////////////////////////////////////////////////
public float PlayingOffset
public uint PlayingOffset
{
get {return sfSoundStream_GetPlayingOffset(This);}
set {sfSoundStream_SetPlayingOffset(This, value);}
@ -229,9 +229,9 @@ namespace SFML
/// <summary>
/// Virtual function called to seek into the stream
/// </summary>
/// <param name="timeOffset">New position, expressed in seconds</param>
/// <param name="timeOffset">New position, in milliseconds</param>
////////////////////////////////////////////////////////////
protected abstract void OnSeek(float timeOffset);
protected abstract void OnSeek(uint timeOffset);
////////////////////////////////////////////////////////////
/// <summary>
@ -289,11 +289,11 @@ namespace SFML
/// <summary>
/// Called to seek in the stream
/// </summary>
/// <param name="timeOffset">New position, expressed in seconds</param>
/// <param name="timeOffset">New position, in milliseconds</param>
/// <param name="userData">User data -- unused</param>
/// <returns>If false is returned, the playback is aborted</returns>
////////////////////////////////////////////////////////////
private void Seek(float timeOffset, IntPtr userData)
private void Seek(uint timeOffset, IntPtr userData)
{
OnSeek(timeOffset);
}
@ -302,7 +302,7 @@ namespace SFML
private delegate bool GetDataCallbackType(ref Chunk dataChunk, IntPtr UserData);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void SeekCallbackType(float timeOffset, IntPtr UserData);
private delegate void SeekCallbackType(uint timeOffset, IntPtr UserData);
private GetDataCallbackType myGetDataCallback;
private SeekCallbackType mySeekCallback;
@ -355,7 +355,7 @@ namespace SFML
static extern void sfSoundStream_SetAttenuation(IntPtr SoundStream, float Attenuation);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern void sfSoundStream_SetPlayingOffset(IntPtr SoundStream, float TimeOffset);
static extern void sfSoundStream_SetPlayingOffset(IntPtr SoundStream, uint TimeOffset);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern bool sfSoundStream_GetLoop(IntPtr SoundStream);
@ -379,7 +379,7 @@ namespace SFML
static extern float sfSoundStream_GetAttenuation(IntPtr SoundStream);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfSoundStream_GetPlayingOffset(IntPtr SoundStream);
static extern uint sfSoundStream_GetPlayingOffset(IntPtr SoundStream);
#endregion
}
}

View file

@ -288,7 +288,7 @@ namespace SFML
/// </summary>
/// <returns>Time elapsed, in seconds</returns>
////////////////////////////////////////////////////////////
public override float GetFrameTime()
public override uint GetFrameTime()
{
return sfRenderWindow_GetFrameTime(This);
}
@ -605,7 +605,7 @@ namespace SFML
static extern void sfRenderWindow_SetFramerateLimit(IntPtr This, uint Limit);
[DllImport("csfml-graphics-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfRenderWindow_GetFrameTime(IntPtr This);
static extern uint sfRenderWindow_GetFrameTime(IntPtr This);
[DllImport("csfml-graphics-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern void sfRenderWindow_SetJoystickThreshold(IntPtr This, float Threshold);

View file

@ -333,9 +333,9 @@ namespace SFML
/// <summary>
/// Get time elapsed since last frame
/// </summary>
/// <returns>Time elapsed, in seconds</returns>
/// <returns>Time elapsed, in milliseconds</returns>
////////////////////////////////////////////////////////////
public virtual float GetFrameTime()
public virtual uint GetFrameTime()
{
return sfWindow_GetFrameTime(This);
}
@ -662,7 +662,7 @@ namespace SFML
static extern void sfWindow_SetFramerateLimit(IntPtr This, uint Limit);
[DllImport("csfml-window-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfWindow_GetFrameTime(IntPtr This);
static extern uint sfWindow_GetFrameTime(IntPtr This);
[DllImport("csfml-window-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern void sfWindow_SetJoystickThreshold(IntPtr This, float Threshold);