fixed all code for building on all platforms inlcudng ANDROID

deque
root 10 years ago
parent 57a8b9cdb5
commit 8a8b91dfe1

@ -58,6 +58,15 @@ if (ANDROID)
set(CMAKE_FIND_ROOT_PATH ${OPENMW_DEPENDENCIES_DIR} "${CMAKE_FIND_ROOT_PATH}")
endif (ANDROID)
if (NOT ANDROID)
ADD_DEFINITIONS(-DNOT_ANDROID)
endif()
if (ANDROID)
ADD_DEFINITIONS(-DBUILD_ANDROID)
endif()
# doxygen main page
configure_file ("${OpenMW_SOURCE_DIR}/docs/mainpage.hpp.cmake" "${OpenMW_SOURCE_DIR}/docs/mainpage.hpp")

@ -19,6 +19,14 @@ endif ()
if(NOT WIN32 AND NOT ANDROID)
set(GAME ${GAME} crashcatcher.cpp)
endif()
if (NOT ANDROID)
ADD_DEFINITIONS(-DNOT_ANDROID)
endif()
if (ANDROID)
ADD_DEFINITIONS(-DBUILD_ANDROID)
endif()
set(GAME_HEADER
engine.hpp

@ -58,39 +58,51 @@ LinuxPath::LinuxPath(const std::string& application_name)
boost::filesystem::path LinuxPath::getUserConfigPath() const
{
//if (flag==false)
// return getEnv("XDG_CONFIG_HOME", getUserHome() / ".config") / mName;
#ifdef NOT_ANDROID
return getEnv("XDG_CONFIG_HOME", getUserHome() / ".config") / mName;
#endif
//else
return getEnv("XDG_CONFIG_HOME", "/sdcard/morrowind/config") / mName;
#ifdef BUILD_ANDROID
return getEnv("XDG_CONFIG_HOME", "/sdcard/morrowind/config") / mName;
#endif
}
boost::filesystem::path LinuxPath::getUserDataPath() const
{
//if (flag==false)
// return getEnv("XDG_DATA_HOME", getUserHome() / ".local/share") / mName;
#ifdef NOT_ANDROID
return getEnv("XDG_DATA_HOME", getUserHome() / ".local/share") / mName;
#endif
//else
#ifdef BUILD_ANDROID
return getEnv("XDG_DATA_HOME", "/sdcard/morrowind/share") / mName;
#endif
}
boost::filesystem::path LinuxPath::getCachePath() const
{
//if (flag==false)
// return getEnv("XDG_CACHE_HOME", getUserHome() / ".cache") / mName;
#ifdef NOT_ANDROID
return getEnv("XDG_CACHE_HOME", getUserHome() / ".cache") / mName;
#endif
//else
#ifdef BUILD_ANDROID
return getEnv("XDG_CACHE_HOME", "/sdcard/morrowind/cache") / mName;
#endif
}
boost::filesystem::path LinuxPath::getGlobalConfigPath() const
{
//if (flag==false)
// boost::filesystem::path globalPath("/etc/");
#ifdef NOT_ANDROID
boost::filesystem::path globalPath("/etc/");
#endif
//else
#ifdef BUILD_ANDROID
boost::filesystem::path globalPath("/sdcard/morrowind/");
#endif
return globalPath / mName;
}
@ -102,10 +114,14 @@ boost::filesystem::path LinuxPath::getLocalPath() const
boost::filesystem::path LinuxPath::getGlobalDataPath() const
{
//if (flag==false)
// boost::filesystem::path globalDataPath("/usr/share/games/");
#ifdef NOT_ANDROID
boost::filesystem::path globalDataPath("/usr/share/games/");
#endif
//else
#ifdef BUILD_ANDROID
boost::filesystem::path globalDataPath("/sdcard/morrowind/data");
#endif
return globalDataPath / mName;
}

@ -94,9 +94,9 @@ namespace OgreInit
Ogre::Root* OgreInit::init(const std::string &logPath)
{
/*
if (flag1==false)
{
#ifdef NOT_ANDROID
// Set up logging first
new Ogre::LogManager;
Ogre::Log *log = Ogre::LogManager::getSingleton().createLog(logPath);
@ -108,7 +108,7 @@ namespace OgreInit
// Disable logging to cout/cerr
log->setDebugOutputEnabled(false);
}*/
#endif
mRoot = new Ogre::Root("", "", "");
#if defined(ENABLE_PLUGIN_GL) || (ENABLE_PLUGIN_GLES2) || defined(ENABLE_PLUGIN_Direct3D9) || defined(ENABLE_PLUGIN_CgProgramManager) || defined(ENABLE_PLUGIN_OctreeSceneManager) || defined(ENABLE_PLUGIN_ParticleFX)

@ -44,18 +44,21 @@ SDLWindowHelper::SDLWindowHelper (SDL_Window* window, int w, int h,
winHandle = Ogre::StringConverter::toString(WindowContentViewHandle(wmInfo));
break;
#else
#elif BUILD_ANDROID
case SDL_SYSWM_ANDROID:
winHandle = Ogre::StringConverter::toString((unsigned long)wmInfo.info.android.window);
winHandleSurface = Ogre::StringConverter::toString((unsigned long)wmInfo.info.android.surface);
flag1=true;
break;
if (flag1==false)
{
//case SDL_SYSWM_X11:
// winHandle = Ogre::StringConverter::toString((unsigned long)wmInfo.info.x11.window);
// break;
}
#elif NOT_ANDROID
case SDL_SYSWM_X11:
winHandle = Ogre::StringConverter::toString((unsigned long)wmInfo.info.x11.window);
break;
#endif

@ -653,7 +653,9 @@ void MyGUIManager::updateWindow (Ogre::RenderWindow *wnd)
void MyGUIManager::windowResized()
{
// mRenderManager->setActiveViewport(0);
#ifdef NOT_ANDROID
mRenderManager->setActiveViewport(0);
#endif
}
void MyGUIManager::shutdown()

Loading…
Cancel
Save