Skip to content

Commit

Permalink
Merge pull request #260 from Bigfoot71/master
Browse files Browse the repository at this point in the history
Added `const` to member functions where possible
  • Loading branch information
RobLoach authored Oct 10, 2023
2 parents 8bdbded + 5b0a178 commit 8a7c236
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/AudioStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class AudioStream : public ::AudioStream {
/**
* Retrieve whether or not the audio stream is ready.
*/
bool IsReady() {
bool IsReady() const {
return ::IsAudioStreamReady(*this);
}

Expand Down
2 changes: 1 addition & 1 deletion include/Font.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class Font : public ::Font {
/**
* Returns if the font is ready to be used.
*/
bool IsReady() {
bool IsReady() const {
return ::IsFontReady(*this);
}

Expand Down
2 changes: 1 addition & 1 deletion include/Material.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Material : public ::Material {
/**
* Check if material is ready
*/
inline bool IsReady() {
inline bool IsReady() const {
return ::IsMaterialReady(*this);
}

Expand Down
6 changes: 3 additions & 3 deletions include/Rectangle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ class Rectangle : public ::Rectangle {
/**
* Check collision between circle and rectangle
*/
inline bool CheckCollision(::Vector2 center, float radius) {
inline bool CheckCollision(::Vector2 center, float radius) const {
return ::CheckCollisionCircleRec(center, radius, *this);
}

inline Vector2 GetSize() {
inline Vector2 GetSize() const {
return {width, height};
}

Expand All @@ -132,7 +132,7 @@ class Rectangle : public ::Rectangle {
return *this;
}

inline Vector2 GetPosition() {
inline Vector2 GetPosition() const {
return {x, y};
}

Expand Down
4 changes: 2 additions & 2 deletions include/Text.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ class Text {
/**
* Measure string width for default font
*/
inline int Measure() {
inline int Measure() const {
return ::MeasureText(text.c_str(), static_cast<int>(fontSize));
}

/**
* Measure string size for Font
*/
inline Vector2 MeasureEx() {
inline Vector2 MeasureEx() const {
return ::MeasureTextEx(font, text.c_str(), fontSize, spacing);
}

Expand Down

0 comments on commit 8a7c236

Please sign in to comment.