Move MyGUI platform to components

c++11
scrawl 9 years ago
parent db7fe1952d
commit a59940a2c7

@ -44,7 +44,7 @@ add_openmw_dir (mwgui
itemmodel containeritemmodel inventoryitemmodel sortfilteritemmodel itemview
tradeitemmodel companionitemmodel pickpocketitemmodel controllers savegamedialog
recharge mode videowidget backgroundimage itemwidget screenfader debugwindow spellmodel spellview
draganddrop timeadvancer jailscreen myguiplatform myguirendermanager myguidatamanager myguitexture
draganddrop timeadvancer jailscreen
)
add_openmw_dir (mwdialogue
@ -107,9 +107,6 @@ endif(WIN32)
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
# for MyGUI platform
find_package(OpenGL REQUIRED)
if (NOT ANDROID)
add_executable(openmw
${OPENMW_FILES}
@ -139,7 +136,6 @@ target_link_libraries(openmw
${BULLET_LIBRARIES}
${MYGUI_LIBRARIES}
${SDL2_LIBRARY}
${OPENGL_gl_LIBRARY}
"osg-ffmpeg-videoplayer"
"oics"
components

@ -343,7 +343,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
osg::ref_ptr<osg::Group> guiRoot = new osg::Group;
guiRoot->setNodeMask(MWRender::Mask_GUI);
rootNode->addChild(guiRoot);
MWGui::WindowManager* window = new MWGui::WindowManager(mViewer, guiRoot, mResourceSystem->getTextureManager(),
MWGui::WindowManager* window = new MWGui::WindowManager(mViewer, guiRoot, mResourceSystem.get(),
mCfgMgr.getLogPath().string() + std::string("/"), myguiResources,
mScriptConsoleMode, mTranslationDataStorage, mEncoding, mExportFonts, mFallbackMap);
mEnvironment.setWindowManager (window);

@ -26,8 +26,12 @@
#include <components/fontloader/fontloader.hpp>
#include <components/resource/resourcesystem.hpp>
#include <components/translation/translation.hpp>
#include <components/myguiplatform/myguiplatform.hpp>
#include <components/widgets/widgets.hpp>
#include <components/widgets/tags.hpp>
@ -91,13 +95,11 @@
#include "controllers.hpp"
#include "jailscreen.hpp"
#include "myguiplatform.hpp"
namespace MWGui
{
WindowManager::WindowManager(
osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::TextureManager* textureManager
osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::ResourceSystem* resourceSystem
, const std::string& logpath, const std::string& resourcePath, bool consoleOnlyScripts,
Translation::Storage& translationDataStorage, ToUTF8::FromType encoding, bool exportFonts, const std::map<std::string, std::string>& fallbackMap)
: mConsoleOnlyScripts(consoleOnlyScripts)
@ -173,7 +175,7 @@ namespace MWGui
, mCurrentModals()
, mFallbackMap(fallbackMap)
{
mGuiPlatform = new Platform(viewer, guiRoot, textureManager);
mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getTextureManager());
mGuiPlatform->initialise(resourcePath, logpath);
MyGUI::Gui* gui = new MyGUI::Gui;

@ -38,20 +38,6 @@ namespace Translation
class Storage;
}
namespace OEngine
{
namespace GUI
{
class Layout;
class MyGUIManager;
}
namespace Render
{
class OgreRenderer;
}
}
namespace osg
{
class Group;
@ -63,7 +49,7 @@ namespace osgViewer
namespace Resource
{
class TextureManager;
class ResourceSystem;
}
namespace SFO
@ -71,6 +57,11 @@ namespace SFO
class CursorManager;
}
namespace osgMyGUI
{
class Platform;
}
namespace MWGui
{
class WindowBase;
@ -107,15 +98,13 @@ namespace MWGui
class DebugWindow;
class JailScreen;
class Platform;
class WindowManager : public MWBase::WindowManager
{
public:
typedef std::pair<std::string, int> Faction;
typedef std::vector<Faction> FactionList;
WindowManager(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::TextureManager* textureManager,
WindowManager(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::ResourceSystem* resourceSystem,
const std::string& logpath, const std::string& cacheDir, bool consoleOnlyScripts,
Translation::Storage& translationDataStorage, ToUTF8::FromType encoding, bool exportFonts, const std::map<std::string,std::string>& fallbackMap);
virtual ~WindowManager();
@ -365,7 +354,7 @@ namespace MWGui
virtual void cycleWeapon(bool next);
private:
Platform* mGuiPlatform;
osgMyGUI::Platform* mGuiPlatform;
bool mConsoleOnlyScripts;

@ -223,6 +223,8 @@ namespace MWSound
{
if (found->first.size() >= pattern.size() && found->first.substr(0, pattern.size()) == pattern)
filelist.push_back(found->first);
else
break;
++found;
}

@ -33,15 +33,9 @@ namespace Loading
class Listener;
}
namespace Render
{
class OgreRenderer;
}
namespace MWRender
{
class SkyManager;
class CellRender;
class RenderingManager;
}
@ -59,7 +53,6 @@ namespace MWWorld
private:
//OEngine::Render::OgreRenderer& mRenderer;
CellStore* mCurrentCell; // the cell the player is in
CellStoreCollection mActiveCells;
bool mCellChanged;

@ -53,15 +53,9 @@ namespace Files
class Collections;
}
namespace Render
{
class OgreRenderer;
}
namespace MWRender
{
class SkyManager;
class CellRender;
class Animation;
class Camera;
}

@ -20,6 +20,8 @@ else (GIT_CHECKOUT)
configure_file(${VERSION_HPP_IN} ${VERSION_HPP})
endif (GIT_CHECKOUT)
find_package(OpenGL REQUIRED)
# source files
add_component_dir (settings
@ -116,6 +118,10 @@ add_component_dir (ogreinit
ogreinit ogreplugin
)
add_component_dir (myguiplatform
myguirendermanager myguidatamanager myguiplatform myguitexture
)
add_component_dir (widgets
box imagebutton tags list numericeditbox sharedstatebutton windowcaption widgets
)
@ -170,6 +176,8 @@ target_link_libraries(components
${OGRE_LIBRARIES}
${OENGINE_LIBRARY}
${OPENSCENEGRAPH_LIBRARIES}
# For MyGUI platform
${OPENGL_gl_LIBRARY}
)
if (GIT_CHECKOUT)

@ -7,7 +7,7 @@
#include <iostream>
namespace MWGui
namespace osgMyGUI
{
void DataManager::setResourcePath(const std::string &path)

@ -1,9 +1,9 @@
#ifndef OPENMW_MWGUI_MYGUIDATAMANAGER_H
#define OPENMW_MWGUI_MYGUIDATAMANAGER_H
#ifndef OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUIDATAMANAGER_H
#define OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUIDATAMANAGER_H
#include <MyGUI_DataManager.h>
namespace MWGui
namespace osgMyGUI
{

@ -1,5 +1,5 @@
#ifndef OPENMW_MWGUI_MYGUIPLATFORM_H
#define OPENMW_MWGUI_MYGUIPLATFORM_H
#ifndef OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUIPLATFORM_H
#define OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUIPLATFORM_H
#include "MyGUI_Prerequest.h"
#include "MyGUI_LogManager.h"
@ -7,7 +7,7 @@
#include "myguirendermanager.hpp"
#include "myguidatamanager.hpp"
namespace MWGui
namespace osgMyGUI
{
class Platform

@ -48,24 +48,24 @@ namespace
// Proxy to forward a Drawable's draw call to RenderManager::drawFrame
class Renderable : public osg::Drawable {
MWGui::RenderManager *mParent;
osgMyGUI::RenderManager *mParent;
virtual void drawImplementation(osg::RenderInfo &renderInfo) const
{ mParent->drawFrame(renderInfo); }
public:
Renderable(MWGui::RenderManager *parent=nullptr) : mParent(parent) { }
Renderable(osgMyGUI::RenderManager *parent=nullptr) : mParent(parent) { }
Renderable(const Renderable &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
: osg::Drawable(copy, copyop)
, mParent(copy.mParent)
{ }
META_Object(MWGui, Renderable)
META_Object(osgMyGUI, Renderable)
};
// Proxy to forward an OSG resize event to RenderManager::setViewSize
class ResizeHandler : public osgGA::GUIEventHandler {
MWGui::RenderManager *mParent;
osgMyGUI::RenderManager *mParent;
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
{
@ -79,19 +79,19 @@ class ResizeHandler : public osgGA::GUIEventHandler {
}
public:
ResizeHandler(MWGui::RenderManager *parent=nullptr) : mParent(parent) { }
ResizeHandler(osgMyGUI::RenderManager *parent=nullptr) : mParent(parent) { }
ResizeHandler(const ResizeHandler &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
: osg::Object(copy, copyop), osgGA::GUIEventHandler(copy, copyop)
, mParent(copy.mParent)
{ }
META_Object(MWGui, ResizeHandler)
META_Object(osgMyGUI, ResizeHandler)
};
}
namespace MWGui
namespace osgMyGUI
{
class OSGVertexBuffer : public MyGUI::IVertexBuffer

@ -1,5 +1,5 @@
#ifndef OPENMW_MWGUI_MYGUIRENDERMANAGER_H
#define OPENMW_MWGUI_MYGUIRENDERMANAGER_H
#ifndef OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUIRENDERMANAGER_H
#define OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUIRENDERMANAGER_H
#include <MyGUI_RenderManager.h>
@ -22,7 +22,7 @@ namespace osg
class RenderInfo;
}
namespace MWGui
namespace osgMyGUI
{
class RenderManager : public MyGUI::RenderManager, public MyGUI::IRenderTarget

@ -7,7 +7,7 @@
#include <components/resource/texturemanager.hpp>
namespace MWGui
namespace osgMyGUI
{
OSGTexture::OSGTexture(const std::string &name, Resource::TextureManager* textureManager)

@ -1,5 +1,5 @@
#ifndef OPENMW_MWGUI_MYGUITEXTURE_H
#define OPENMW_MWGUI_MYGUITEXTURE_H
#ifndef OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUITEXTURE_H
#define OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUITEXTURE_H
#include <MyGUI_ITexture.h>
@ -16,7 +16,7 @@ namespace Resource
class TextureManager;
}
namespace MWGui
namespace osgMyGUI
{
class OSGTexture : public MyGUI::ITexture {

@ -1,5 +1,5 @@
#ifndef MWGUI_IMAGEBUTTON_H
#define MWGUI_IMAGEBUTTON_H
#ifndef OPENMW_COMPONENTS_WIDGETS_IMAGEBUTTON_H
#define OPENMW_COMPONENTS_WIDGETS_IMAGEBUTTON_H
#include <MyGUI_ImageBox.h>

@ -1,5 +1,5 @@
#ifndef MWGUI_LIST_HPP
#define MWGUI_LIST_HPP
#ifndef OPENMW_COMPONENTS_WIDGETS_LIST_HPP
#define OPENMW_COMPONENTS_WIDGETS_LIST_HPP
#include <MyGUI_ScrollView.h>

Loading…
Cancel
Save