Skip to content

Commit 07bccb6

Browse files
committed
Clean up parameters and doc comments
1 parent 511601e commit 07bccb6

File tree

9 files changed

+37
-8
lines changed

9 files changed

+37
-8
lines changed

include/AudioStream.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,17 @@ class AudioStream : public ::AudioStream {
158158
::SetAudioStreamBufferSizeDefault(size);
159159
}
160160

161+
/**
162+
* Retrieve whether or not the audio stream is ready.
163+
*/
161164
bool IsReady() {
162165
return channels > 0;
163166
}
164167

165168
/**
166169
* Init audio stream (to stream raw audio pcm data)
170+
*
171+
* @return True or false depending on if the audio stream initialized properly.
167172
*/
168173
bool Load(unsigned int SampleRate, unsigned int SampleSize, unsigned int Channels = 2) {
169174
set(::LoadAudioStream(SampleRate, SampleSize, Channels));

include/Image.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ class Image : public ::Image {
413413
/**
414414
* Resize canvas and fill with color
415415
*/
416-
inline Image& ResizeCanvas(int newWidth, int newHeight, int offsetX, int offsetY,
416+
inline Image& ResizeCanvas(int newWidth, int newHeight, int offsetX = 0, int offsetY = 0,
417417
::Color color = {255, 255, 255, 255}) {
418418
::ImageResizeCanvas(this, newWidth, newHeight, offsetX, offsetY, color);
419419
return *this;

include/Model.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class Model : public ::Model {
193193
return ::GetModelBoundingBox(*this);
194194
}
195195

196-
bool IsReady() {
196+
bool IsReady() const {
197197
return meshCount > 0 || materialCount > 0 || boneCount > 0;
198198
}
199199

include/RayCollision.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ class RayCollision : public ::RayCollision {
1515
}
1616

1717
RayCollision(bool hit, float distance,
18-
::Vector3 point, ::Vector3 normal) : ::RayCollision{hit, distance, point, normal} {}
18+
::Vector3 point, ::Vector3 normal) : ::RayCollision{hit, distance, point, normal} {
19+
// Nothing.
20+
}
1921

2022
/**
2123
* Get collision info between ray and mesh

include/RenderTexture.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,18 @@ class RenderTexture : public ::RenderTexture {
9090
return *this;
9191
}
9292

93+
/**
94+
* Loads a render texture at the given width and height.
95+
*/
9396
bool Load(int width, int height) {
9497
set(::LoadRenderTexture(width, height));
98+
return IsReady();
99+
}
100+
101+
/**
102+
* Retrieves whether or not the render texture is ready.
103+
*/
104+
bool IsReady() const {
95105
return id != 0;
96106
}
97107

include/Shader.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ class Shader : public ::Shader {
162162
return *this;
163163
}
164164

165+
/**
166+
* Retrieves whether or not the shader is ready.
167+
*/
168+
bool IsReady() const {
169+
return id != 0 && locs != nullptr;
170+
}
171+
165172
private:
166173
inline void set(const ::Shader& shader) {
167174
id = shader.id;

include/Sound.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,15 @@ class Sound : public ::Sound {
169169
* @return True or false depending on loading worked.
170170
*/
171171
bool Load(const std::string& fileName) {
172-
set(LoadSound(fileName.c_str()));
172+
set(::LoadSound(fileName.c_str()));
173173
return IsReady();
174174
}
175175

176+
/**
177+
* Loads the given Wave object into the Sound.
178+
*/
176179
bool Load(const ::Wave& wave) {
177-
set(LoadSoundFromWave(wave));
180+
set(::LoadSoundFromWave(wave));
178181
return IsReady();
179182
}
180183

@@ -184,7 +187,7 @@ class Sound : public ::Sound {
184187
*
185188
* @return True or false depending on whether the Sound buffer is loaded.
186189
*/
187-
bool IsReady() {
190+
bool IsReady() const {
188191
return stream.buffer != nullptr;
189192
}
190193

include/Texture.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class Texture : public ::Texture {
302302
*
303303
* @return True or false depending on whether the Texture has data.
304304
*/
305-
bool IsReady() {
305+
bool IsReady() const {
306306
return id != 0;
307307
}
308308

include/Wave.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ class Wave : public ::Wave {
2222
unsigned int sampleRate = 0,
2323
unsigned int sampleSize = 0,
2424
unsigned int channels = 0,
25-
void *data = nullptr) : ::Wave{frameCount, sampleRate, sampleSize, channels, data} { }
25+
void *data = nullptr) : ::Wave{frameCount, sampleRate, sampleSize, channels, data} {
26+
// Nothing.
27+
}
2628

2729
/**
2830
* Load wave data from file

0 commit comments

Comments
 (0)