mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-07-20 13:15:16 -04:00
mp3 support for playing background music
This commit is contained in:
parent
73a4187f79
commit
dd23d8c989
24 changed files with 2245 additions and 252 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue