@@ -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
0 commit comments