From 23b307ad13024134908849b53b756dd6073f8d56 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 1 Nov 2013 20:24:09 +0300 Subject: move physfs initialisation code in physfstools. --- src/main.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index f9ee5d5d7..765d0d11c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -304,26 +304,11 @@ int main(int argc, char *argv[]) _exit(0); } - // Initialize PhysicsFS -#if defined(__native_client__) - if (!PHYSFS_init("/fakebinary")) -#elif defined(ANDROID) +#ifdef ANDROID mkdir_r(getSdStoragePath().c_str()); - - if (!PHYSFS_init((getRealPath(".").append("/fakebinary")).c_str())) -#else - if (!PHYSFS_init(argv[0])) #endif - { - std::cout << "Error while initializing PhysFS: " - << PHYSFS_getLastError() << std::endl; - return 1; - } - - PhysFs::updateDirSeparator(); - - atexit((void(*)()) PHYSFS_deinit); + PhysFs::init(argv[0]); XML::initXML(); #if SDL_IMAGE_VERSION_ATLEAST(1, 2, 11) IMG_Init(IMG_INIT_PNG); -- cgit v1.2.3-60-g2f50