Skip to content

Commit

Permalink
ADDED: SetAutomationEventBaseFrame(int frame)
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed Oct 26, 2023
1 parent 98fcbe3 commit f721429
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/core/core_automation_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ int main(void)
}
else
{
SetAutomationEventBaseFrame(180);
StartAutomationEventRecording();
eventRecording = true;
}
Expand Down
7 changes: 4 additions & 3 deletions src/raylib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/rcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit f721429

Please sign in to comment.