forked from mirror/openmw-tes3mp
android-build
This commit is contained in:
parent
16aafc26bc
commit
7cd2d4809c
7 changed files with 92 additions and 20 deletions
|
@ -7,7 +7,11 @@
|
|||
#include <pwd.h>
|
||||
#include <unistd.h>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
|
||||
/*bool flag=false;
|
||||
#ifdef ENABLE_PLUGIN_GLES2
|
||||
flag=true;
|
||||
#endif
|
||||
*/
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -54,23 +58,40 @@ LinuxPath::LinuxPath(const std::string& application_name)
|
|||
|
||||
boost::filesystem::path LinuxPath::getUserConfigPath() const
|
||||
{
|
||||
return getEnv("XDG_CONFIG_HOME", getUserHome() / ".config") / mName;
|
||||
//if (flag==false)
|
||||
// return getEnv("XDG_CONFIG_HOME", getUserHome() / ".config") / mName;
|
||||
//else
|
||||
return getEnv("XDG_CONFIG_HOME", "/sdcard/morrowind/config") / mName;
|
||||
|
||||
}
|
||||
|
||||
boost::filesystem::path LinuxPath::getUserDataPath() const
|
||||
{
|
||||
return getEnv("XDG_DATA_HOME", getUserHome() / ".local/share") / mName;
|
||||
//if (flag==false)
|
||||
// return getEnv("XDG_DATA_HOME", getUserHome() / ".local/share") / mName;
|
||||
//else
|
||||
return getEnv("XDG_DATA_HOME", "/sdcard/morrowind/share") / mName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
boost::filesystem::path LinuxPath::getCachePath() const
|
||||
{
|
||||
return getEnv("XDG_CACHE_HOME", getUserHome() / ".cache") / mName;
|
||||
//if (flag==false)
|
||||
// return getEnv("XDG_CACHE_HOME", getUserHome() / ".cache") / mName;
|
||||
//else
|
||||
return getEnv("XDG_CACHE_HOME", "/sdcard/morrowind/cache") / mName;
|
||||
|
||||
}
|
||||
|
||||
boost::filesystem::path LinuxPath::getGlobalConfigPath() const
|
||||
{
|
||||
boost::filesystem::path globalPath("/etc/");
|
||||
return globalPath / mName;
|
||||
//if (flag==false)
|
||||
// boost::filesystem::path globalPath("/etc/");
|
||||
//else
|
||||
boost::filesystem::path globalPath("/sdcard/morrowind/");
|
||||
|
||||
return globalPath / mName;
|
||||
}
|
||||
|
||||
boost::filesystem::path LinuxPath::getLocalPath() const
|
||||
|
@ -80,8 +101,12 @@ boost::filesystem::path LinuxPath::getLocalPath() const
|
|||
|
||||
boost::filesystem::path LinuxPath::getGlobalDataPath() const
|
||||
{
|
||||
boost::filesystem::path globalDataPath("/usr/share/games/");
|
||||
return globalDataPath / mName;
|
||||
//if (flag==false)
|
||||
// boost::filesystem::path globalDataPath("/usr/share/games/");
|
||||
//else
|
||||
boost::filesystem::path globalDataPath("/sdcard/morrowind/data");
|
||||
|
||||
return globalDataPath / mName;
|
||||
}
|
||||
|
||||
boost::filesystem::path LinuxPath::getInstallPath() const
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
/**
|
||||
* \namespace Files
|
||||
*/
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "ogreplugin.hpp"
|
||||
|
||||
|
||||
namespace bfs = boost::filesystem;
|
||||
|
||||
namespace
|
||||
|
@ -82,13 +83,20 @@ namespace OgreInit
|
|||
#ifdef ENABLE_PLUGIN_GL
|
||||
, mGLPlugin(NULL)
|
||||
#endif
|
||||
#ifdef ENABLE_PLUGIN_Direct3D9
|
||||
#ifdef ENABLE_PLUGIN_GLES2
|
||||
, mGLES2Plugin(NULL)
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_PLUGIN_Direct3D9
|
||||
, mD3D9Plugin(NULL)
|
||||
#endif
|
||||
{}
|
||||
|
||||
Ogre::Root* OgreInit::init(const std::string &logPath)
|
||||
{
|
||||
/*
|
||||
if (flag1==false)
|
||||
{
|
||||
// Set up logging first
|
||||
new Ogre::LogManager;
|
||||
Ogre::Log *log = Ogre::LogManager::getSingleton().createLog(logPath);
|
||||
|
@ -100,10 +108,10 @@ namespace OgreInit
|
|||
|
||||
// Disable logging to cout/cerr
|
||||
log->setDebugOutputEnabled(false);
|
||||
|
||||
}*/
|
||||
mRoot = new Ogre::Root("", "", "");
|
||||
|
||||
#if defined(ENABLE_PLUGIN_GL) || defined(ENABLE_PLUGIN_Direct3D9) || defined(ENABLE_PLUGIN_CgProgramManager) || defined(ENABLE_PLUGIN_OctreeSceneManager) || defined(ENABLE_PLUGIN_ParticleFX)
|
||||
#if defined(ENABLE_PLUGIN_GL) || (ENABLE_PLUGIN_GLES2) || defined(ENABLE_PLUGIN_Direct3D9) || defined(ENABLE_PLUGIN_CgProgramManager) || defined(ENABLE_PLUGIN_OctreeSceneManager) || defined(ENABLE_PLUGIN_ParticleFX)
|
||||
loadStaticPlugins();
|
||||
#else
|
||||
loadPlugins();
|
||||
|
@ -133,7 +141,12 @@ namespace OgreInit
|
|||
delete mGLPlugin;
|
||||
mGLPlugin = NULL;
|
||||
#endif
|
||||
#ifdef ENABLE_PLUGIN_Direct3D9
|
||||
#ifdef ENABLE_PLUGIN_GLES2
|
||||
delete mGLES2Plugin;
|
||||
mGLES2Plugin = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_PLUGIN_Direct3D9
|
||||
delete mD3D9Plugin;
|
||||
mD3D9Plugin = NULL;
|
||||
#endif
|
||||
|
@ -157,7 +170,12 @@ namespace OgreInit
|
|||
mGLPlugin = new Ogre::GLPlugin();
|
||||
mRoot->installPlugin(mGLPlugin);
|
||||
#endif
|
||||
#ifdef ENABLE_PLUGIN_Direct3D9
|
||||
#ifdef ENABLE_PLUGIN_GLES2
|
||||
mGLES2Plugin = new Ogre::GLES2Plugin();
|
||||
mRoot->installPlugin(mGLES2Plugin);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_PLUGIN_Direct3D9
|
||||
mD3D9Plugin = new Ogre::D3D9Plugin();
|
||||
mRoot->installPlugin(mD3D9Plugin);
|
||||
#endif
|
||||
|
|
|
@ -17,6 +17,11 @@
|
|||
#ifdef ENABLE_PLUGIN_GL
|
||||
# include "OgreGLPlugin.h"
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_PLUGIN_GLES2
|
||||
# include "OgreGLES2Plugin.h"
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_PLUGIN_Direct3D9
|
||||
# include "OgreD3D9Plugin.h"
|
||||
#endif
|
||||
|
@ -51,6 +56,8 @@ namespace OgreInit
|
|||
void loadStaticPlugins();
|
||||
void loadPlugins();
|
||||
void loadParticleFactories();
|
||||
//bool flag1=false;
|
||||
|
||||
|
||||
|
||||
#ifdef ENABLE_PLUGIN_CgProgramManager
|
||||
|
@ -65,7 +72,11 @@ namespace OgreInit
|
|||
#ifdef ENABLE_PLUGIN_GL
|
||||
Ogre::GLPlugin* mGLPlugin;
|
||||
#endif
|
||||
#ifdef ENABLE_PLUGIN_Direct3D9
|
||||
#ifdef ENABLE_PLUGIN_GLES2
|
||||
Ogre::GLES2Plugin* mGLES2Plugin;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_PLUGIN_Direct3D9
|
||||
Ogre::D3D9Plugin* mD3D9Plugin;
|
||||
#endif
|
||||
|
||||
|
|
25
extern/sdl4ogre/sdlwindowhelper.cpp
vendored
25
extern/sdl4ogre/sdlwindowhelper.cpp
vendored
|
@ -10,6 +10,7 @@
|
|||
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
|
||||
#include "osx_utils.h"
|
||||
#endif
|
||||
bool flag1=false;
|
||||
|
||||
namespace SFO
|
||||
{
|
||||
|
@ -26,6 +27,7 @@ SDLWindowHelper::SDLWindowHelper (SDL_Window* window, int w, int h,
|
|||
throw std::runtime_error("Couldn't get WM Info!");
|
||||
|
||||
Ogre::String winHandle;
|
||||
Ogre::String winHandleSurface;
|
||||
|
||||
switch (wmInfo.subsystem)
|
||||
{
|
||||
|
@ -43,10 +45,21 @@ SDLWindowHelper::SDLWindowHelper (SDL_Window* window, int w, int h,
|
|||
winHandle = Ogre::StringConverter::toString(WindowContentViewHandle(wmInfo));
|
||||
break;
|
||||
#else
|
||||
case SDL_SYSWM_X11:
|
||||
winHandle = Ogre::StringConverter::toString((unsigned long)wmInfo.info.x11.window);
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
default:
|
||||
throw std::runtime_error("Unexpected WM!");
|
||||
break;
|
||||
|
@ -54,8 +67,14 @@ SDLWindowHelper::SDLWindowHelper (SDL_Window* window, int w, int h,
|
|||
|
||||
/// \todo externalWindowHandle is deprecated according to the source code. Figure out a way to get parentWindowHandle
|
||||
/// to work properly. On Linux/X11 it causes an occasional GLXBadDrawable error.
|
||||
params.insert(std::make_pair("externalWindowHandle", winHandle));
|
||||
if (flag1==false)
|
||||
params.insert(std::make_pair("externalWindowHandle", winHandle));
|
||||
else
|
||||
{
|
||||
params.insert(std::make_pair("externalWindowHandle", winHandle));
|
||||
params.insert(std::make_pair("externalSurface", winHandleSurface));
|
||||
|
||||
}
|
||||
mWindow = Ogre::Root::getSingleton().createRenderWindow(title, w, h, fullscreen, ¶ms);
|
||||
}
|
||||
|
||||
|
|
|
@ -653,7 +653,7 @@ void MyGUIManager::updateWindow (Ogre::RenderWindow *wnd)
|
|||
|
||||
void MyGUIManager::windowResized()
|
||||
{
|
||||
mRenderManager->setActiveViewport(0);
|
||||
// mRenderManager->setActiveViewport(0);
|
||||
}
|
||||
|
||||
void MyGUIManager::shutdown()
|
||||
|
|
|
@ -138,7 +138,7 @@ void OgreRenderer::createWindow(const std::string &title, const WindowSettings&
|
|||
settings.window_x, // width, in pixels
|
||||
settings.window_y, // height, in pixels
|
||||
SDL_WINDOW_SHOWN
|
||||
| (settings.fullscreen ? SDL_WINDOW_FULLSCREEN : 0) | SDL_WINDOW_RESIZABLE
|
||||
| (settings.fullscreen ? SDL_WINDOW_FULLSCREEN : 0) | SDL_WINDOW_RESIZABLE
|
||||
);
|
||||
|
||||
SFO::SDLWindowHelper helper(mSDLWindow, settings.window_x, settings.window_y, title, settings.fullscreen, params);
|
||||
|
|
Loading…
Reference in a new issue