Skip to content

Commit 8a7c236

Browse files
authored
Merge pull request #260 from Bigfoot71/master
Added `const` to member functions where possible
2 parents 8bdbded + 5b0a178 commit 8a7c236

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

include/AudioStream.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class AudioStream : public ::AudioStream {
194194
/**
195195
* Retrieve whether or not the audio stream is ready.
196196
*/
197-
bool IsReady() {
197+
bool IsReady() const {
198198
return ::IsAudioStreamReady(*this);
199199
}
200200

include/Font.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ class Font : public ::Font {
206206
/**
207207
* Returns if the font is ready to be used.
208208
*/
209-
bool IsReady() {
209+
bool IsReady() const {
210210
return ::IsFontReady(*this);
211211
}
212212

include/Material.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class Material : public ::Material {
112112
/**
113113
* Check if material is ready
114114
*/
115-
inline bool IsReady() {
115+
inline bool IsReady() const {
116116
return ::IsMaterialReady(*this);
117117
}
118118

include/Rectangle.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ class Rectangle : public ::Rectangle {
109109
/**
110110
* Check collision between circle and rectangle
111111
*/
112-
inline bool CheckCollision(::Vector2 center, float radius) {
112+
inline bool CheckCollision(::Vector2 center, float radius) const {
113113
return ::CheckCollisionCircleRec(center, radius, *this);
114114
}
115115

116-
inline Vector2 GetSize() {
116+
inline Vector2 GetSize() const {
117117
return {width, height};
118118
}
119119

@@ -132,7 +132,7 @@ class Rectangle : public ::Rectangle {
132132
return *this;
133133
}
134134

135-
inline Vector2 GetPosition() {
135+
inline Vector2 GetPosition() const {
136136
return {x, y};
137137
}
138138

include/Text.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@ class Text {
121121
/**
122122
* Measure string width for default font
123123
*/
124-
inline int Measure() {
124+
inline int Measure() const {
125125
return ::MeasureText(text.c_str(), static_cast<int>(fontSize));
126126
}
127127

128128
/**
129129
* Measure string size for Font
130130
*/
131-
inline Vector2 MeasureEx() {
131+
inline Vector2 MeasureEx() const {
132132
return ::MeasureTextEx(font, text.c_str(), fontSize, spacing);
133133
}
134134

0 commit comments

Comments
 (0)