sdl3 migrate now compiling, need to go through all the files and clean them up

This commit is contained in:
herbglitch 2025-03-22 23:25:21 -06:00
parent df4390ddba
commit 1b2e2cb7f1
26 changed files with 1139 additions and 0 deletions

View file

@ -0,0 +1,7 @@
#include "arc/audio/audio.h"
#include "audio.h"
#include <SDL2/SDL_mixer.h>
void ARC_Audio_Play(ARC_Audio *audio){
Mix_PlayChannel(-1, audio->chunk, 0);
}

View file

@ -0,0 +1,10 @@
#ifndef ARC_SDL_AUDIO_H_
#define ARC_SDL_AUDIO_H_
#include <SDL2/SDL_mixer.h>
typedef struct ARC_Audio {
Mix_Chunk *chunk;
} ARC_Audio;
#endif // !ARC_SDL_AUDIO_H_

View file

@ -0,0 +1,43 @@
#include "arc/audio/config.h"
#include "audio.h"
#include <stdlib.h>
#include "arc/std/config.h"
#include "arc/std/errno.h"
#include "arc/audio/audio.h"
// #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);
//}