diff --git a/CMakeLists.txt b/CMakeLists.txt index bf0ed0dbd..47864ee2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,9 +12,15 @@ if(DPKG_PROGRAM) set(MORROWIND_DATA_FILES "/usr/share/games/openmw/data/" CACHE PATH "location of Morrowind data files") set(MORROWIND_RESOURCE_FILES "/usr/share/games/openmw/resources/" CACHE PATH "location of Morrowind data files") else() - set(MORROWIND_DATA_FILES "data" CACHE PATH "location of Morrowind data files") - set(MORROWIND_RESOURCE_FILES "resources" CACHE PATH "location of Morrowind data files") -endif() + if (APPLE) + # set path inside bundle + set(MORROWIND_DATA_FILES "Contents/Resources/data" CACHE PATH "location of Morrowind data files") + set(MORROWIND_RESOURCE_FILES "Contents/Resources/resources" CACHE PATH "location of Morrowind data files") + else() + set(MORROWIND_DATA_FILES "data" CACHE PATH "location of Morrowind data files") + set(MORROWIND_RESOURCE_FILES "resources" CACHE PATH "location of Morrowind data files") + endif(APPLE) +endif(DPKG_PROGRAM) if (WIN32) option(USE_DEBUG_CONSOLE "whether a debug console should be enabled for debug builds, if false debug output is redirected to Visual Studio output" ON) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 7c289e435..a4544a006 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -253,30 +253,13 @@ void OMW::Engine::addResourcesDirectory (const boost::filesystem::path& path) void OMW::Engine::setDataDir (const boost::filesystem::path& dataDir) { -#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE - // FIXME possibly hack, should use Carbon methods to get resource path - mDataDir = boost::filesystem::path(Ogre::macBundlePath() + "/Contents/Resources"); - mDataDir = mDataDir / dataDir; -#else mDataDir = boost::filesystem::system_complete (dataDir); -#endif - std::cout << "mDataDir: " << mDataDir << std::endl; - std::cout << "dataDir: " << dataDir << std::endl; - std::cout << "initial path: " << boost::filesystem::initial_path() << std::endl; - std::cout << "mac bundle path: " << Ogre::macBundlePath() << std::endl; } // Set resource dir void OMW::Engine::setResourceDir (const boost::filesystem::path& parResDir) { -#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE - // FIXME possibly hack, should use Carbon methods to get resource path - mResDir = boost::filesystem::path(Ogre::macBundlePath() + "/Contents/Resources"); - mResDir = mResDir / parResDir; -#else mResDir = boost::filesystem::system_complete(parResDir); -#endif - } // Set start cell name (only interiors for now) diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index f47273ee1..e26d81969 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -111,11 +111,16 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine) int main(int argc, char**argv) { +#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE + // set current dir to bundle path + boost::filesystem::path bundlePath = boost::filesystem::path(Ogre::macBundlePath()); + boost::filesystem::current_path(bundlePath); +#endif try { OMW::Engine engine; - + if (parseOptions (argc, argv, engine)) { engine.go();