forked from teamnwah/openmw-tes3coop
Remove dependency on OgrePlatform.h
This commit is contained in:
parent
4f0387bdb5
commit
0cc9b1bb40
2 changed files with 15 additions and 18 deletions
|
@ -12,8 +12,6 @@
|
||||||
#include <boost/iostreams/stream_buffer.hpp>
|
#include <boost/iostreams/stream_buffer.hpp>
|
||||||
#include <boost/filesystem/fstream.hpp>
|
#include <boost/filesystem/fstream.hpp>
|
||||||
|
|
||||||
#include <OgrePlatform.h>
|
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
// For OutputDebugString
|
// For OutputDebugString
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
@ -23,17 +21,18 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE
|
#if (defined(__APPLE__) || defined(__linux) || defined(__unix) || defined(__posix))
|
||||||
|
#define USE_CRASH_CATCHER 1
|
||||||
|
#else
|
||||||
|
#define USE_CRASH_CATCHER 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if USE_CRASH_CATCHER
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
extern int cc_install_handlers(int argc, char **argv, int num_signals, int *sigs, const char *logfile, int (*user_info)(char*, char*));
|
extern int cc_install_handlers(int argc, char **argv, int num_signals, int *sigs, const char *logfile, int (*user_info)(char*, char*));
|
||||||
extern int is_debugger_attached(void);
|
extern int is_debugger_attached(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// for Ogre::macBundlePath
|
|
||||||
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
|
|
||||||
#include <OSX/macUtils.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <boost/version.hpp>
|
#include <boost/version.hpp>
|
||||||
/**
|
/**
|
||||||
* Workaround for problems with whitespaces in paths in older versions of Boost library
|
* Workaround for problems with whitespaces in paths in older versions of Boost library
|
||||||
|
@ -364,7 +363,7 @@ int main(int argc, char**argv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE
|
#if USE_CRASH_CATCHER
|
||||||
// Unix crash catcher
|
// Unix crash catcher
|
||||||
if ((argc == 2 && strcmp(argv[1], "--cc-handle-crash") == 0) || !is_debugger_attached())
|
if ((argc == 2 && strcmp(argv[1], "--cc-handle-crash") == 0) || !is_debugger_attached())
|
||||||
{
|
{
|
||||||
|
@ -376,10 +375,10 @@ int main(int argc, char**argv)
|
||||||
std::cout << "Running in a debugger, not installing crash catcher" << std::endl;
|
std::cout << "Running in a debugger, not installing crash catcher" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
|
#ifdef __APPLE__
|
||||||
// set current dir to bundle path
|
// FIXME: set current dir to bundle path
|
||||||
boost::filesystem::path bundlePath = boost::filesystem::path(Ogre::macBundlePath()).parent_path();
|
//boost::filesystem::path bundlePath = boost::filesystem::path(Ogre::macBundlePath()).parent_path();
|
||||||
boost::filesystem::current_path(bundlePath);
|
//boost::filesystem::current_path(bundlePath);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
engine.reset(new OMW::Engine(cfgMgr));
|
engine.reset(new OMW::Engine(cfgMgr));
|
||||||
|
@ -391,7 +390,7 @@ int main(int argc, char**argv)
|
||||||
}
|
}
|
||||||
catch (std::exception &e)
|
catch (std::exception &e)
|
||||||
{
|
{
|
||||||
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE
|
#if (defined(__APPLE__) || defined(__linux) || defined(__unix) || defined(__posix))
|
||||||
if (!isatty(fileno(stdin)))
|
if (!isatty(fileno(stdin)))
|
||||||
#endif
|
#endif
|
||||||
SDL_ShowSimpleMessageBox(0, "OpenMW: Fatal error", e.what(), NULL);
|
SDL_ShowSimpleMessageBox(0, "OpenMW: Fatal error", e.what(), NULL);
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
#ifndef COMPONENTS_FILES_LOWLEVELFILE_HPP
|
#ifndef COMPONENTS_FILES_LOWLEVELFILE_HPP
|
||||||
#define COMPONENTS_FILES_LOWLEVELFILE_HPP
|
#define COMPONENTS_FILES_LOWLEVELFILE_HPP
|
||||||
|
|
||||||
#include <OgrePlatform.h>
|
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#define FILE_API_STDIO 0
|
#define FILE_API_STDIO 0
|
||||||
#define FILE_API_POSIX 1
|
#define FILE_API_POSIX 1
|
||||||
#define FILE_API_WIN32 2
|
#define FILE_API_WIN32 2
|
||||||
|
|
||||||
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
|
#if defined(__linux) || defined(__unix) || defined(__posix)
|
||||||
#define FILE_API FILE_API_POSIX
|
#define FILE_API FILE_API_POSIX
|
||||||
#elif OGRE_PLATFORM == OGRE_PLATFORM_WIN32
|
#elif defined(_WIN32)
|
||||||
#define FILE_API FILE_API_WIN32
|
#define FILE_API FILE_API_WIN32
|
||||||
#else
|
#else
|
||||||
#define FILE_API FILE_API_STDIO
|
#define FILE_API FILE_API_STDIO
|
||||||
|
|
Loading…
Reference in a new issue