Skip to content

Commit 0b727bd

Browse files
committed
Merge branch 'master' of github.com:RobLoach/raylib-cpp into next
2 parents 1a45d71 + 3b8fe30 commit 0b727bd

File tree

8 files changed

+88
-64
lines changed

8 files changed

+88
-64
lines changed

include/AutomationEventList.hpp

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,18 @@ class AutomationEventList : public ::AutomationEventList {
1515
set(automationEventList);
1616
}
1717

18-
AutomationEventList(unsigned int capacity = 16384,
19-
unsigned int count = 0,
20-
AutomationEvent *events = nullptr) : ::AutomationEventList{capacity, count, events} {
21-
// Nothing.
18+
/**
19+
* Load an empty automation events list.
20+
*/
21+
AutomationEventList() {
22+
set(::LoadAutomationEventList(0));
2223
}
2324

25+
/**
26+
* Load automation events list from file.
27+
*
28+
* @param fileName The file path to load the automation events list from.
29+
*/
2430
AutomationEventList(const char* fileName) {
2531
Load(fileName);
2632
}
@@ -82,12 +88,19 @@ class AutomationEventList : public ::AutomationEventList {
8288
* Update audio stream buffers with data
8389
*/
8490
void Unload() {
85-
#if RAYLIB_VERSION_MAJOR >= 5
86-
#if RAYLIB_VERSION_MINOR == 0
87-
::UnloadAutomationEventList(this);
88-
#elif RAYLIB_VERSION_MINOR >= 1
89-
::UnloadAutomationEventList(*this);
90-
#endif
91+
if (!IsReady()) {
92+
return;
93+
}
94+
95+
// The function signature of UnloadAutomationEventList() changes from raylib 5.0.
96+
#if RAYLIB_VERSION_MAJOR == 5
97+
#if RAYLIB_VERSION_MINOR == 0
98+
::UnloadAutomationEventList(this);
99+
#elif RAYLIB_VERSION_MINOR >= 1
100+
::UnloadAutomationEventList(*this);
101+
#endif
102+
#else
103+
::UnloadAutomationEventList(*this);
91104
#endif
92105
}
93106

include/FileData.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace raylib {
1111

1212
class FileData {
13-
public:
13+
public:
1414
FileData() = default;
1515
FileData(const FileData&) = delete;
1616
FileData(FileData&& other) noexcept : data(other.data), bytesRead(other.bytesRead) {
@@ -44,7 +44,7 @@ class FileData {
4444
}
4545
}
4646

47-
private:
47+
private:
4848
unsigned char* data{nullptr};
4949
int bytesRead{0};
5050
};

include/FileText.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace raylib {
1111

1212
class FileText {
13-
public:
13+
public:
1414
FileText() = default;
1515
FileText(const FileText&) = delete;
1616
FileText(FileText&& other) noexcept : data(other.data), length(other.length) {
@@ -53,7 +53,7 @@ class FileText {
5353
}
5454
}
5555

56-
private:
56+
private:
5757
char* data{nullptr};
5858
unsigned int length{0};
5959
};

0 commit comments

Comments
 (0)