@@ -3230,25 +3230,24 @@ bool ExportAutomationEventList(AutomationEventList list, const char *fileName)
32303230
32313231#if defined(SUPPORT_AUTOMATION_EVENTS )
32323232 // Export events as binary file
3233-
3234- // Binary buffer size = header (file id + count) + events data
3235- int binarySize = 4 + sizeof (int ) + sizeof (AutomationEvent )* list .count ;
3236- unsigned char * binBuffer = (unsigned char * )RL_MALLOC (binarySize );
3237- if (!binBuffer ) return false;
3238-
3239- int offset = 0 ;
3240- memcpy (binBuffer + offset , "rAE " , 4 ); offset += 4 ;
3241- memcpy (binBuffer + offset , & list .count , sizeof (int )); offset += sizeof (int );
3242-
3243- if (list .count > 0 )
3233+ // NOTE: Code not used, only for reference if required in the future
3234+ /*
3235+ if (list.count > 0)
32443236 {
3245- memcpy (binBuffer + offset , list .events ,sizeof (AutomationEvent )* list .count );
3237+ int binarySize = 4 + sizeof(int) + sizeof(AutomationEvent)*list.count;
3238+ unsigned char *binBuffer = (unsigned char *)RL_CALLOC(binarySize, 1);
3239+ int offset = 0;
3240+ memcpy(binBuffer + offset, "rAE ", 4);
3241+ offset += 4;
3242+ memcpy(binBuffer + offset, &list.count, sizeof(int));
3243+ offset += sizeof(int);
3244+ memcpy(binBuffer + offset, list.events, sizeof(AutomationEvent)*list.count);
32463245 offset += sizeof(AutomationEvent)*list.count;
3246+
3247+ success = SaveFileData(TextFormat("%s.rae",fileName), binBuffer, binarySize);
3248+ RL_FREE(binBuffer);
32473249 }
3248-
3249- success = SaveFileData (TextFormat ("%s.rae" ,fileName ), binBuffer , binarySize );
3250-
3251- RL_FREE (binBuffer );
3250+ */
32523251
32533252 // Export events as text
32543253 // NOTE: Save to memory buffer and SaveFileText()
0 commit comments