mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-30 16:45:17 -04:00
On OS X openmw now sets current directory to bundle root, openmw.cfg values is relative to bundle root
This commit is contained in:
parent
943eea8104
commit
768c9bdf07
@ -11,10 +11,16 @@ find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
|
|||||||
if(DPKG_PROGRAM)
|
if(DPKG_PROGRAM)
|
||||||
set(MORROWIND_DATA_FILES "/usr/share/games/openmw/data/" CACHE PATH "location of Morrowind data files")
|
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")
|
set(MORROWIND_RESOURCE_FILES "/usr/share/games/openmw/resources/" CACHE PATH "location of Morrowind data files")
|
||||||
|
else()
|
||||||
|
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()
|
else()
|
||||||
set(MORROWIND_DATA_FILES "data" CACHE PATH "location of Morrowind data files")
|
set(MORROWIND_DATA_FILES "data" CACHE PATH "location of Morrowind data files")
|
||||||
set(MORROWIND_RESOURCE_FILES "resources" CACHE PATH "location of Morrowind data files")
|
set(MORROWIND_RESOURCE_FILES "resources" CACHE PATH "location of Morrowind data files")
|
||||||
endif()
|
endif(APPLE)
|
||||||
|
endif(DPKG_PROGRAM)
|
||||||
|
|
||||||
if (WIN32)
|
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)
|
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)
|
||||||
|
@ -253,30 +253,13 @@ void OMW::Engine::addResourcesDirectory (const boost::filesystem::path& path)
|
|||||||
|
|
||||||
void OMW::Engine::setDataDir (const boost::filesystem::path& dataDir)
|
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);
|
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
|
// Set resource dir
|
||||||
void OMW::Engine::setResourceDir (const boost::filesystem::path& parResDir)
|
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);
|
mResDir = boost::filesystem::system_complete(parResDir);
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set start cell name (only interiors for now)
|
// Set start cell name (only interiors for now)
|
||||||
|
@ -111,6 +111,11 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine)
|
|||||||
|
|
||||||
int main(int argc, char**argv)
|
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
|
try
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user