mp3 support for playing background music

This commit is contained in:
Ondřej Novák 2025-06-15 12:56:18 +02:00
parent 73a4187f79
commit dd23d8c989
24 changed files with 2245 additions and 252 deletions

View file

@ -13,7 +13,7 @@
#include <errno.h>
// Funkce pro mapování souboru do paměti
void* map_file_to_memory(const char *name, size_t *sz) {
const void* map_file_to_memory(const char *name, size_t *sz) {
if (!name || !sz) {
return NULL;
}
@ -49,13 +49,13 @@ void* map_file_to_memory(const char *name, size_t *sz) {
}
// Funkce pro zrušení mapování
void unmap_file(void *ptr, size_t sz) {
void unmap_file(const void *ptr, size_t sz) {
if (!ptr || sz == 0) {
return;
}
// Zrušení mapování
if (munmap(ptr, sz) == -1) {
perror("Chyba při rušení mapování");
if (munmap((void *)ptr, sz) == -1) {
perror("Failed to unmap file");
}
}