Skip to content
Permalink
Browse files

Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module.

  • Loading branch information
icculus committed Aug 20, 2013
1 parent 6344736 commit 2dd7091e505b44f7fde1a38ef4418d22bc79d001
@@ -76,6 +76,7 @@ test/testnative
test/testoverlay2
test/testplatform
test/testpower
test/testfilesystem
test/testrelative
test/testrendercopyex
test/testrendertarget
@@ -33,6 +33,7 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
$(wildcard $(LOCAL_PATH)/src/power/*.c) \
$(wildcard $(LOCAL_PATH)/src/power/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/filesystem/dummy/*.c) \
$(wildcard $(LOCAL_PATH)/src/render/*.c) \
$(wildcard $(LOCAL_PATH)/src/render/*/*.c) \
$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
@@ -172,7 +172,7 @@ include_directories(${SDL2_BINARY_DIR}/include ${SDL2_SOURCE_DIR}/include)

set(SDL_SUBSYSTEMS
Atomic Audio Video Render Events Joystick Haptic Power Threads Timers
File Loadso CPUinfo)
File Loadso CPUinfo Filesystem)
foreach(_SUB ${SDL_SUBSYSTEMS})
string(TOUPPER ${_SUB} _OPT)
option(SDL_${_OPT} "Enable the ${_SUB} subsystem" ON)
@@ -714,6 +714,13 @@ if(UNIX AND NOT APPLE)
endif(LINUX)
endif(SDL_POWER)

if(SDL_FILESYSTEM)
set(SDL_FILESYSTEM_UNIX 1)
file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/unix/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
set(HAVE_SDL_FILESYSTEM TRUE)
endif(SDL_FILESYSTEM)

if(SDL_TIMERS)
set(SDL_TIMER_UNIX 1)
file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c)
@@ -814,6 +821,13 @@ elseif(WINDOWS)
set(HAVE_SDL_POWER TRUE)
endif(SDL_POWER)

if(SDL_FILESYSTEM)
set(SDL_FILESYSTEM_WINDOWS 1)
file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesytem/windows/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
set(HAVE_SDL_FILESYSTEM TRUE)
endif(SDL_FILESYSTEM)

# Libraries for Win32 native and MinGW
list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid)

@@ -924,6 +938,13 @@ elseif(APPLE)
set(SDL_FRAMEWORK_IOKIT 1)
endif()

if(SDL_FILESYSTEM)
set(SDL_FILESYSTEM_COCOA 1)
file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/cocoa/*.m)
set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
set(HAVE_SDL_FILESYSTEM TRUE)
endif()

# Actually load the frameworks at the end so we don't duplicate include.
if(SDL_FRAMEWORK_COCOA)
find_library(COCOA_LIBRARY Cocoa)
@@ -973,6 +994,11 @@ elseif(BEOS)
set(SOURCE_FILES ${SOURCE_FILES} ${BWINDOW_SOURCES})
set(HAVE_SDL_VIDEO TRUE)

set(SDL_FILESYSTEM_BEOS 1)
file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/beos/*.cc)
set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
set(HAVE_SDL_FILESYSTEM TRUE)

if(VIDEO_OPENGL)
# TODO: Use FIND_PACKAGE(OpenGL) instead
set(SDL_VIDEO_OPENGL 1)
@@ -1010,6 +1036,11 @@ if(NOT HAVE_SDL_LOADSO)
file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dummy/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES})
endif(NOT HAVE_SDL_LOADSO)
if(NOT HAVE_SDL_FILESYSTEM)
set(SDL_FILESYSTEM_DISABLED 1)
file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/dummy/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
endif(NOT HAVE_SDL_FILESYSTEM)

# We always need to have threads and timers around
if(NOT HAVE_SDL_THREADS)
@@ -54,6 +54,7 @@ HDRS = \
SDL_endian.h \
SDL_error.h \
SDL_events.h \
SDL_filesystem.h \
SDL_gamecontroller.h \
SDL_gesture.h \
SDL_haptic.h \
@@ -19,6 +19,7 @@ SOURCES = \
src/joystick/dummy/*.c \
src/loadso/dummy/*.c \
src/power/*.c \
src/filesystem/dummy/*.c \
src/render/*.c \
src/render/software/*.c \
src/stdlib/*.c \
@@ -19,7 +19,7 @@ SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \
./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \
./src/atomic/linux/*.c \
./src/atomic/linux/*.c ./src/filesystem/unix/*.c \
./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o ./src/video/x11/*.c


@@ -31,6 +31,7 @@ OBJS= src/SDL.o \
src/joystick/psp/SDL_sysjoystick.o \
src/power/SDL_power.o \
src/power/psp/SDL_syspower.o \
src/filesystem/dummy/SDL_sysfilesystem.o \
src/render/SDL_render.o \
src/render/SDL_yuv_sw.o \
src/render/psp/SDL_render_psp.o \
@@ -427,6 +427,10 @@
RelativePath="..\..\include\SDL_events.h"
>
</File>
<File
RelativePath="..\..\include\SDL_filesystem.h"
>
</File>
<File
RelativePath="..\..\include\SDL_gamecontroller.h"
>
@@ -1088,6 +1092,10 @@
RelativePath="..\..\src\events\SDL_sysevents.h"
>
</File>
<File
RelativePath="..\..\src\filesystem\windows\SDL_sysfilesystem.c"
>
</File>
<File
RelativePath="..\..\src\haptic\windows\SDL_syshaptic.c"
>
@@ -229,6 +229,7 @@
<ClInclude Include="..\..\include\SDL_endian.h" />
<ClInclude Include="..\..\include\SDL_error.h" />
<ClInclude Include="..\..\include\SDL_events.h" />
<ClInclude Include="..\..\include\SDL_filesystem.h" />
<ClInclude Include="..\..\include\SDL_gesture.h" />
<ClInclude Include="..\..\include\SDL_haptic.h" />
<ClInclude Include="..\..\include\SDL_hints.h" />
@@ -430,6 +431,7 @@
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\video\SDL_surface.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_syshaptic.c" />
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
@@ -19,7 +19,7 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>SDL2</ProjectName>
<ProjectName>SDL2</ProjectName>
<ProjectGuid>{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}</ProjectGuid>
<RootNamespace>SDL</RootNamespace>
</PropertyGroup>
@@ -233,6 +233,7 @@
<ClInclude Include="..\..\include\SDL_endian.h" />
<ClInclude Include="..\..\include\SDL_error.h" />
<ClInclude Include="..\..\include\SDL_events.h" />
<ClInclude Include="..\..\include\SDL_filesystem.h" />
<ClInclude Include="..\..\include\SDL_gesture.h" />
<ClInclude Include="..\..\include\SDL_haptic.h" />
<ClInclude Include="..\..\include\SDL_hints.h" />
@@ -433,6 +434,7 @@
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\video\SDL_surface.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_syshaptic.c" />
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
@@ -783,6 +783,7 @@ enable_events
enable_joystick
enable_haptic
enable_power
enable_filesystem
enable_threads
enable_timers
enable_file
@@ -1496,6 +1497,7 @@ Optional Features:
--enable-haptic Enable the haptic (force feedback) subsystem
[[default=yes]]
--enable-power Enable the power subsystem [[default=yes]]
--enable-filesystem Enable the filesystem subsystem [[default=yes]]
--enable-threads Enable the threading subsystem [[default=yes]]
--enable-timers Enable the timer subsystem [[default=yes]]
--enable-file Enable the file subsystem [[default=yes]]
@@ -16767,6 +16769,7 @@ SOURCES="$SOURCES $srcdir/src/haptic/*.c"
SOURCES="$SOURCES $srcdir/src/joystick/*.c"
SOURCES="$SOURCES $srcdir/src/libm/*.c"
SOURCES="$SOURCES $srcdir/src/power/*.c"
#SOURCES="$SOURCES $srcdir/src/filesystem/*.c"
SOURCES="$SOURCES $srcdir/src/render/*.c"
SOURCES="$SOURCES $srcdir/src/render/*/*.c"
SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
@@ -16870,6 +16873,18 @@ if test x$enable_power != xyes; then

$as_echo "#define SDL_POWER_DISABLED 1" >>confdefs.h

fi
# Check whether --enable-filesystem was given.
if test "${enable_filesystem+set}" = set; then :
enableval=$enable_filesystem;
else
enable_filesystem=yes
fi

if test x$enable_filesystem != xyes; then

$as_echo "#define SDL_FILESYSTEM_DISABLED 1" >>confdefs.h

fi
# Check whether --enable-threads was given.
if test "${enable_threads+set}" = set; then :
;;
esac
fi
# Set up files for the filesystem library
if test x$enable_filesystem = xyes; then

$as_echo "#define SDL_FILESYSTEM_UNIX 1" >>confdefs.h

SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
have_filesystem=yes
fi
# Set up files for the timer library
if test x$enable_timers = xyes; then

SOURCES="$SOURCES $srcdir/src/power/windows/SDL_syspower.c"
have_power=yes
fi
if test x$enable_filesystem = xyes; then

$as_echo "#define SDL_FILESYSTEM_WINDOWS 1" >>confdefs.h

SOURCES="$SOURCES $srcdir/src/filesystem/windows/SDL_sysfilesystem.c"
have_filesystem=yes
fi
# Set up files for the thread library
if test x$enable_threads = xyes; then

SOURCES="$SOURCES $srcdir/src/power/beos/*.c"
have_power=yes
fi
# Set up files for the system filesystem library
if test x$enable_filesystem = xyes; then

$as_echo "#define SDL_FILESYSTEM_BEOS 1" >>confdefs.h

SOURCES="$SOURCES $srcdir/src/power/beos/*.cc"
have_filesystem=yes
fi
# The BeOS platform requires special setup.
SOURCES="$srcdir/src/main/beos/*.cc $SOURCES"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
# have_haptic=yes
# EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
#fi
# Set up files for the power library
if test x$enable_power = xyes; then
SOURCES="$SOURCES $srcdir/src/power/uikit/*.m"
have_power=yes
# Set up files for the filesystem library
if test x$enable_filesystem = xyes; then
SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
have_filesystem=yes
fi
# Set up files for the timer library
if test x$enable_timers = xyes; then
SOURCES="$SOURCES $srcdir/src/power/macosx/*.c"
have_power=yes
fi
# Set up files for the filesystem library
if test x$enable_filesystem = xyes; then

$as_echo "#define SDL_FILESYSTEM_COCOA 1" >>confdefs.h

SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
have_filesystem=yes
fi
# Set up files for the timer library
if test x$enable_timers = xyes; then

fi
SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
fi
if test x$have_filesystem != xyes; then
if test x$enable_filesystem = xyes; then

$as_echo "#define SDL_FILESYSTEM_DISABLED 1" >>confdefs.h

fi
SOURCES="$SOURCES $srcdir/src/filesystem/dummy/*.c"
fi
if test x$have_loadso != xyes; then
if test x$enable_loadso = xyes; then

0 comments on commit 2dd7091

Please sign in to comment.