From f721429f2584b2d2769c7031eb8823f4d768d979 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 27 Oct 2023 01:19:10 +0200 Subject: [PATCH] ADDED: `SetAutomationEventBaseFrame(int frame)` --- examples/core/core_automation_events.c | 1 + src/raylib.h | 7 ++++--- src/rcore.c | 6 ++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/examples/core/core_automation_events.c b/examples/core/core_automation_events.c index adea0e88b..27711b39d 100644 --- a/examples/core/core_automation_events.c +++ b/examples/core/core_automation_events.c @@ -214,6 +214,7 @@ int main(void) } else { + SetAutomationEventBaseFrame(180); StartAutomationEventRecording(); eventRecording = true; } diff --git a/src/raylib.h b/src/raylib.h index 7b3eddaee..d8bf1e07c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -508,9 +508,9 @@ typedef struct FilePathList { // Automation event (opaque struct) typedef struct AutomationEvent { - unsigned int frame; // Event frame - unsigned int type; // Event type (AutomationEventType) - int params[4]; // Event parameters (if required) + unsigned int frame; // Event frame + unsigned int type; // Event type (AutomationEventType) + int params[4]; // Event parameters (if required) } AutomationEvent; // Automation event list @@ -1133,6 +1133,7 @@ RLAPI AutomationEventList LoadAutomationEventList(const char *fileName); RLAPI void UnloadAutomationEventList(AutomationEventList *list); // Unload automation events list from file RLAPI bool ExportAutomationEventList(AutomationEventList list, const char *fileName); // Export automation events list as text file RLAPI void SetAutomationEventList(AutomationEventList *list); // Set automation event list to record to +RLAPI void SetAutomationEventBaseFrame(int frame); // Set automation event internal base frame to start recording RLAPI void StartAutomationEventRecording(void); // Start recording automation events (AutomationEventList must be set) RLAPI void StopAutomationEventRecording(void); // Stop recording automation events RLAPI void PlayAutomationEvent(AutomationEvent event); // Play a recorded automation event diff --git a/src/rcore.c b/src/rcore.c index 67c79efa9..c3b69ae88 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2289,6 +2289,12 @@ void SetAutomationEventList(AutomationEventList *list) #endif } +// Set automation event internal base frame to start recording +void SetAutomationEventBaseFrame(int frame) +{ + CORE.Time.frameCounter = frame; +} + // Start recording automation events (AutomationEventList must be set) void StartAutomationEventRecording(void) {