Browse Source

ADDED: `SetAutomationEventBaseFrame(int frame)`

pull/3472/head
Ray 1 year ago
parent
commit
f721429f25
3 changed files with 11 additions and 3 deletions
  1. +1
    -0
      examples/core/core_automation_events.c
  2. +4
    -3
      src/raylib.h
  3. +6
    -0
      src/rcore.c

+ 1
- 0
examples/core/core_automation_events.c View File

@ -214,6 +214,7 @@ int main(void)
} }
else else
{ {
SetAutomationEventBaseFrame(180);
StartAutomationEventRecording(); StartAutomationEventRecording();
eventRecording = true; eventRecording = true;
} }

+ 4
- 3
src/raylib.h View File

@ -508,9 +508,9 @@ typedef struct FilePathList {
// Automation event (opaque struct) // Automation event (opaque struct)
typedef struct AutomationEvent { 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; } AutomationEvent;
// Automation event list // 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 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 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 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 StartAutomationEventRecording(void); // Start recording automation events (AutomationEventList must be set)
RLAPI void StopAutomationEventRecording(void); // Stop recording automation events RLAPI void StopAutomationEventRecording(void); // Stop recording automation events
RLAPI void PlayAutomationEvent(AutomationEvent event); // Play a recorded automation event RLAPI void PlayAutomationEvent(AutomationEvent event); // Play a recorded automation event

+ 6
- 0
src/rcore.c View File

@ -2289,6 +2289,12 @@ void SetAutomationEventList(AutomationEventList *list)
#endif #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) // Start recording automation events (AutomationEventList must be set)
void StartAutomationEventRecording(void) void StartAutomationEventRecording(void)
{ {

Loading…
Cancel
Save