comparison src/sys.c @ 36:798baf7f3ec0

core: implement sys_data* functions for Windows
author David Demelier <markand@malikania.fr>
date Mon, 13 Jan 2020 20:48:41 +0100
parents 91bc2329ab0c
children 9d1421c09dfb
comparison
equal deleted inserted replaced
35:bdb51709fd55 36:798baf7f3ec0
21 #include <SDL.h> 21 #include <SDL.h>
22 #include <SDL_image.h> 22 #include <SDL_image.h>
23 #include <SDL_mixer.h> 23 #include <SDL_mixer.h>
24 #include <SDL_ttf.h> 24 #include <SDL_ttf.h>
25 25
26 #if defined(_WIN32) 26 #if !defined(_WIN32) /* Assuming POSIX */
27 # error "TODO"
28 #else /* Assuming POSIX */
29 # include <sys/types.h> 27 # include <sys/types.h>
30 # include <dirent.h> 28 # include <dirent.h>
31 #endif 29 #endif
32 30
33 #include "sys.h" 31 #include "sys.h"
34 32
35 #if defined(_WIN32) 33 #if defined(_WIN32)
36 # error "TODO" 34
35 static void
36 determine(char path[], size_t pathlen)
37 {
38 char *base = SDL_GetBasePath();
39
40 /* On Windows, the data hierarchy is the same as the project. */
41 snprintf(path, pathlen, "%sassets", base);
42 SDL_free(base);
43 }
44
37 #else /* Assuming POSIX */ 45 #else /* Assuming POSIX */
38 46
39 static bool 47 static bool
40 is_absolute(const char *path) 48 is_absolute(const char *path)
41 { 49 {