comment out some config stuff to get sdl2 building again, will work through and remove config as chemical is the updated config

This commit is contained in:
herbglitch 2025-02-05 00:03:34 -07:00
parent 122eb1d351
commit 119d1b2c64
4 changed files with 336 additions and 336 deletions

View file

@ -8,36 +8,36 @@
// #define ARC_DEFAULT_CONFIG
#include "arc/std/defaults/config.h"
void ARC_AudioConfig_Init(ARC_Config *config){
ARC_Config_AddKeyCString(config, (char *)"ARC_Audio", 9, ARC_Audio_Read, ARC_Audio_Delete);
}
uint8_t ARC_Audio_Read(ARC_Config *config, ARC_String *string, void **value){
ARC_Config_Get(config, string, value);
if(*value){
return 1;
}
if(string->data[0] != '"' || string->data[string->length - 1] != '"'){
ARC_DEBUG_LOG_ERROR_WITH_VARIABLES("in ARC_Point_Read(config, string, value); no matching quotes: %s", string->data);
arc_errno = ARC_ERRNO_DATA;
return 0;
}
ARC_Audio *audio = (ARC_Audio *)malloc(sizeof(ARC_Audio));
ARC_String *path;
ARC_String_CopySubstring(&path, string, 1, string->length - 2);
audio->chunk = Mix_LoadWAV(path->data);
//TODO: get error message if not loaded
*value = (void *)audio;
return 0;
}
void ARC_Audio_Delete(ARC_Config* config, ARC_String *string, void *value){
Mix_FreeChunk(((ARC_Audio *)value)->chunk);
free((ARC_Audio *)value);
}
//
//void ARC_AudioConfig_Init(ARC_Config *config){
// ARC_Config_AddKeyCString(config, (char *)"ARC_Audio", 9, ARC_Audio_Read, ARC_Audio_Delete);
//}
//
//uint8_t ARC_Audio_Read(ARC_Config *config, ARC_String *string, void **value){
// ARC_Config_Get(config, string, value);
// if(*value){
// return 1;
// }
//
// if(string->data[0] != '"' || string->data[string->length - 1] != '"'){
// ARC_DEBUG_LOG_ERROR_WITH_VARIABLES("in ARC_Point_Read(config, string, value); no matching quotes: %s", string->data);
// arc_errno = ARC_ERRNO_DATA;
// return 0;
// }
//
// ARC_Audio *audio = (ARC_Audio *)malloc(sizeof(ARC_Audio));
//
// ARC_String *path;
// ARC_String_CopySubstring(&path, string, 1, string->length - 2);
// audio->chunk = Mix_LoadWAV(path->data);
//
// //TODO: get error message if not loaded
//
// *value = (void *)audio;
// return 0;
//}
//
//void ARC_Audio_Delete(ARC_Config* config, ARC_String *string, void *value){
// Mix_FreeChunk(((ARC_Audio *)value)->chunk);
// free((ARC_Audio *)value);
//}