Use override

This commit is contained in:
Chris Thrasher authored and Lukas Dürrenberger committed 2024-02-19 23:30:30 +01:00
1 parent 907b0ca6ee
commit 683677b5aa
4 files changed
+11 -11

No files matched your search

+3 -3
View File
@@ -58,7 +58,7 @@ public :
private : private :
virtual bool onStart() bool onStart() override
{ {
if (myStartCallback) if (myStartCallback)
return myStartCallback(myUserData); return myStartCallback(myUserData);
@@ -66,7 +66,7 @@ private :
return true; return true;
} }
virtual bool onProcessSamples(const sf::Int16* samples, std::size_t sampleCount) bool onProcessSamples(const sf::Int16* samples, std::size_t sampleCount) override
{ {
if (myProcessCallback) if (myProcessCallback)
return myProcessCallback(samples, sampleCount, myUserData); return myProcessCallback(samples, sampleCount, myUserData);
@@ -74,7 +74,7 @@ private :
return true; return true;
} }
virtual void onStop() void onStop() override
{ {
if (myStopCallback) if (myStopCallback)
myStopCallback(myUserData); myStopCallback(myUserData);
+2 -2
View File
@@ -53,7 +53,7 @@ public :
private : private :
virtual bool onGetData(Chunk& data) bool onGetData(Chunk& data) override
{ {
sfSoundStreamChunk chunk = {nullptr, 0}; sfSoundStreamChunk chunk = {nullptr, 0};
bool ok = myGetDataCallback(&chunk, myUserData); bool ok = myGetDataCallback(&chunk, myUserData);
@@ -64,7 +64,7 @@ private :
return ok; return ok;
} }
virtual void onSeek(sf::Time timeOffset) void onSeek(sf::Time timeOffset) override
{ {
if (mySeekCallback) if (mySeekCallback)
{ {
+4 -4
View File
@@ -68,7 +68,7 @@ public:
/// \return The number of bytes actually read /// \return The number of bytes actually read
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual sf::Int64 read(void* data, sf::Int64 size) sf::Int64 read(void* data, sf::Int64 size) override
{ {
return myStream.read ? myStream.read(data, size, myStream.userData) : -1; return myStream.read ? myStream.read(data, size, myStream.userData) : -1;
} }
@@ -81,7 +81,7 @@ public:
/// \return The position actually seeked to, or -1 on error /// \return The position actually seeked to, or -1 on error
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual sf::Int64 seek(sf::Int64 position) sf::Int64 seek(sf::Int64 position) override
{ {
return myStream.seek ? myStream.seek(position, myStream.userData) : -1; return myStream.seek ? myStream.seek(position, myStream.userData) : -1;
} }
@@ -92,7 +92,7 @@ public:
/// \return The current position, or -1 on error. /// \return The current position, or -1 on error.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual sf::Int64 tell() sf::Int64 tell() override
{ {
return myStream.tell ? myStream.tell(myStream.userData) : -1; return myStream.tell ? myStream.tell(myStream.userData) : -1;
} }
@@ -103,7 +103,7 @@ public:
/// \return The total number of bytes available in the stream, or -1 on error /// \return The total number of bytes available in the stream, or -1 on error
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual sf::Int64 getSize() sf::Int64 getSize() override
{ {
return myStream.getSize ? myStream.getSize(myStream.userData) : -1; return myStream.getSize ? myStream.getSize(myStream.userData) : -1;
} }
+2 -2
View File
@@ -51,12 +51,12 @@ public :
{ {
} }
virtual std::size_t getPointCount() const std::size_t getPointCount() const override
{ {
return myGetPointCountCallback(myUserData); return myGetPointCountCallback(myUserData);
} }
virtual sf::Vector2f getPoint(std::size_t index) const sf::Vector2f getPoint(std::size_t index) const override
{ {
sfVector2f point = myGetPointCallback(index, myUserData); sfVector2f point = myGetPointCallback(index, myUserData);
return sf::Vector2f(point.x, point.y); return sf::Vector2f(point.x, point.y);