Skip to content

Commit

Permalink
Unneeded inline keyword from class methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mips64-el committed Jan 14, 2024
1 parent 27b6b12 commit 1f37420
Show file tree
Hide file tree
Showing 32 changed files with 519 additions and 519 deletions.
8 changes: 4 additions & 4 deletions include/AudioDevice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AudioDevice {
*
* @throws raylib::RaylibException Throws if the AudioDevice failed to initialize.
*/
inline void Init() {
void Init() {
::InitAudioDevice();
if (!IsReady()) {
throw RaylibException("Failed to initialize AudioDevice");
Expand All @@ -46,14 +46,14 @@ class AudioDevice {
/**
* Close the audio device and context.
*/
inline void Close() {
void Close() {
::CloseAudioDevice();
}

/**
* Check if audio device has been initialized successfully.
*/
inline bool IsReady() const {
bool IsReady() const {
return ::IsAudioDeviceReady();
}

Expand All @@ -62,7 +62,7 @@ class AudioDevice {
*
* @param volume The desired volume to set.
*/
inline AudioDevice& SetVolume(float volume) {
AudioDevice& SetVolume(float volume) {
::SetMasterVolume(volume);
return *this;
}
Expand Down
30 changes: 15 additions & 15 deletions include/AudioStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,113 +81,113 @@ class AudioStream : public ::AudioStream {
/**
* Update audio stream buffers with data
*/
inline AudioStream& Update(const void *data, int samplesCount) {
AudioStream& Update(const void *data, int samplesCount) {
::UpdateAudioStream(*this, data, samplesCount);
return *this;
}

/**
* Unload audio stream and free memory
*/
inline void Unload() {
void Unload() {
::UnloadAudioStream(*this);
}

/**
* Check if any audio stream buffers requires refill
*/
inline bool IsProcessed() const {
bool IsProcessed() const {
return ::IsAudioStreamProcessed(*this);
}

/**
* Play audio stream
*/
inline AudioStream& Play() {
AudioStream& Play() {
::PlayAudioStream(*this);
return *this;
}

/**
* Pause audio stream
*/
inline AudioStream& Pause() {
AudioStream& Pause() {
::PauseAudioStream(*this);
return *this;
}

/**
* Resume audio stream
*/
inline AudioStream& Resume() {
AudioStream& Resume() {
::ResumeAudioStream(*this);
return *this;
}

/**
* Check if audio stream is playing
*/
inline bool IsPlaying() const {
bool IsPlaying() const {
return ::IsAudioStreamPlaying(*this);
}

/**
* Stop audio stream
*/
inline AudioStream& Stop() {
AudioStream& Stop() {
::StopAudioStream(*this);
return *this;
}

/**
* Set volume for audio stream (1.0 is max level)
*/
inline AudioStream& SetVolume(float volume = 1.0f) {
AudioStream& SetVolume(float volume = 1.0f) {
::SetAudioStreamVolume(*this, volume);
return *this;
}

/**
* Set pitch for audio stream (1.0 is base level)
*/
inline AudioStream& SetPitch(float pitch) {
AudioStream& SetPitch(float pitch) {
::SetAudioStreamPitch(*this, pitch);
return *this;
}

/**
* Set pan for audio stream (0.5 is centered)
*/
inline AudioStream& SetPan(float pan = 0.5f) {
AudioStream& SetPan(float pan = 0.5f) {
::SetAudioStreamPitch(*this, pan);
return *this;
}

/**
* Default size for new audio streams
*/
inline static void SetBufferSizeDefault(int size) {
static void SetBufferSizeDefault(int size) {
::SetAudioStreamBufferSizeDefault(size);
}

/**
* Audio thread callback to request new data
*/
inline void SetCallback(::AudioCallback callback) {
void SetCallback(::AudioCallback callback) {
::SetAudioStreamCallback(*this, callback);
}

/**
* Attach audio stream processor to stream
*/
inline void AttachProcessor(::AudioCallback processor) {
void AttachProcessor(::AudioCallback processor) {
::SetAudioStreamCallback(*this, processor);
}

/**
* Detach audio stream processor from stream
*/
inline void DetachProcessor(::AudioCallback processor) {
void DetachProcessor(::AudioCallback processor) {
::SetAudioStreamCallback(*this, processor);
}

Expand Down
16 changes: 8 additions & 8 deletions include/AutomationEventList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,39 +81,39 @@ class AutomationEventList : public ::AutomationEventList {
/**
* Update audio stream buffers with data
*/
inline AutomationEventList& Unload() {
AutomationEventList& Unload() {
::UnloadAutomationEventList(this);
return *this;
}

inline bool IsReady() {
bool IsReady() {
return events != nullptr;
}

inline bool Export(const char* fileName) {
bool Export(const char* fileName) {
return ::ExportAutomationEventList(*this, fileName);
}

inline void Set() {
void Set() {
::SetAutomationEventList(this);
}

inline void SetBaseFrame(int frame) {
void SetBaseFrame(int frame) {
Set();
::SetAutomationEventBaseFrame(frame);
}

inline void StartRecording() {
void StartRecording() {
Set();
::StartAutomationEventRecording();
}

inline void StopRecording() {
void StopRecording() {
Set();
::StopAutomationEventRecording();
}

inline void Play(int index) {
void Play(int index) {
if (index < 0 || index >= this->count) {
return;
}
Expand Down
10 changes: 5 additions & 5 deletions include/BoundingBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,35 @@ class BoundingBox : public ::BoundingBox {
/**
* Draw a bounding box with wires
*/
inline void Draw(::Color color = {255, 255, 255, 255}) const {
void Draw(::Color color = {255, 255, 255, 255}) const {
::DrawBoundingBox(*this, color);
}

/**
* Detect collision between two boxes
*/
inline bool CheckCollision(const ::BoundingBox& box2) const {
bool CheckCollision(const ::BoundingBox& box2) const {
return CheckCollisionBoxes(*this, box2);
}

/**
* Detect collision between box and sphere
*/
inline bool CheckCollision(::Vector3 center, float radius) const {
bool CheckCollision(::Vector3 center, float radius) const {
return CheckCollisionBoxSphere(*this, center, radius);
}

/**
* Detect collision between ray and bounding box
*/
inline bool CheckCollision(const ::Ray& ray) const {
bool CheckCollision(const ::Ray& ray) const {
return GetRayCollisionBox(ray, *this).hit;
}

/**
* Get collision information between ray and bounding box
*/
inline RayCollision GetCollision(const ::Ray& ray) const {
RayCollision GetCollision(const ::Ray& ray) const {
return GetRayCollisionBox(ray, *this);
}

Expand Down
10 changes: 5 additions & 5 deletions include/Camera2D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ class Camera2D : public ::Camera2D {
Camera2D(::Vector2 offset, ::Vector2 target,
float rotation = 0.0f, float zoom = 1.0f) : ::Camera2D{offset, target, rotation, zoom} {}

inline Camera2D& BeginMode() {
Camera2D& BeginMode() {
::BeginMode2D(*this);
return *this;
}

inline Camera2D& EndMode() {
Camera2D& EndMode() {
::EndMode2D();
return *this;
}
Expand All @@ -42,21 +42,21 @@ class Camera2D : public ::Camera2D {
/**
* Returns camera 2d transform matrix
*/
inline Matrix GetMatrix() const {
Matrix GetMatrix() const {
return ::GetCameraMatrix2D(*this);
}

/**
* Returns the world space position for a 2d camera screen space position
*/
inline Vector2 GetScreenToWorld(::Vector2 position) const {
Vector2 GetScreenToWorld(::Vector2 position) const {
return ::GetScreenToWorld2D(position, *this);
}

/**
* Returns the screen space position for a 3d world space position
*/
inline Vector2 GetWorldToScreen(::Vector2 position) const {
Vector2 GetWorldToScreen(::Vector2 position) const {
return ::GetWorldToScreen2D(position, *this);
}

Expand Down
14 changes: 7 additions & 7 deletions include/Camera3D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,44 +62,44 @@ class Camera3D : public ::Camera3D {
/**
* Get camera transform matrix (view matrix)
*/
inline Matrix GetMatrix() const {
Matrix GetMatrix() const {
return ::GetCameraMatrix(*this);
}

/**
* Update camera position for selected mode
*/
inline Camera3D& Update(int mode) {
Camera3D& Update(int mode) {
::UpdateCamera(this, mode);
return *this;
}

/**
* Update camera movement/rotation
*/
inline Camera3D& Update(::Vector3 movement, ::Vector3 rotation, float zoom = 1.0f) {
Camera3D& Update(::Vector3 movement, ::Vector3 rotation, float zoom = 1.0f) {
::UpdateCameraPro(this, movement, rotation, zoom);
return *this;
}

/**
* Returns a ray trace from mouse position
*/
inline Ray GetMouseRay(::Vector2 mousePosition) const {
Ray GetMouseRay(::Vector2 mousePosition) const {
return ::GetMouseRay(mousePosition, *this);
}

/**
* Returns the screen space position for a 3d world space position
*/
inline Vector2 GetWorldToScreen(::Vector3 position) const {
Vector2 GetWorldToScreen(::Vector3 position) const {
return ::GetWorldToScreen(position, *this);
}

/**
* Draw a billboard texture.
*/
inline void DrawBillboard(
void DrawBillboard(
const ::Texture2D& texture,
::Vector3 center,
float size,
Expand All @@ -110,7 +110,7 @@ class Camera3D : public ::Camera3D {
/**
* Draw a billboard texture defined by source.
*/
inline void DrawBillboard(
void DrawBillboard(
const ::Texture2D& texture,
::Rectangle sourceRec,
::Vector3 center,
Expand Down
Loading

0 comments on commit 1f37420

Please sign in to comment.