Fixes for building with unity build

openmw-37
Alexander "Ace" Olofsson 9 years ago
parent 12b8fcf0bf
commit 7d4125d97f

@ -65,7 +65,7 @@ add_openmw_dir (mwworld
containerstore actiontalk actiontake manualref player cellfunctors failedaction containerstore actiontalk actiontake manualref player cellfunctors failedaction
cells localscripts customdata inventorystore ptr actionopen actionread cells localscripts customdata inventorystore ptr actionopen actionread
actionequip timestamp actionalchemy cellstore actionapply actioneat actionequip timestamp actionalchemy cellstore actionapply actioneat
esmstore store recordcmp fallback actionrepair actionsoulgem livecellref actiondoor store esmstore recordcmp fallback actionrepair actionsoulgem livecellref actiondoor
contentloader esmloader actiontrap cellreflist cellref physicssystem weather projectilemanager contentloader esmloader actiontrap cellreflist cellref physicssystem weather projectilemanager
) )
@ -179,4 +179,5 @@ if (MSVC)
if (CMAKE_CL_64) if (CMAKE_CL_64)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj") set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
endif (CMAKE_CL_64) endif (CMAKE_CL_64)
add_definitions("-D_USE_MATH_DEFINES")
endif (MSVC) endif (MSVC)

@ -31,7 +31,7 @@
namespace namespace
{ {
MyGUI::Colour getTextColour (const std::string& type) MyGUI::Colour getDialogueTextColour (const std::string& type)
{ {
return MyGUI::Colour::parse(MyGUI::LanguageManager::getInstance().replaceTags("#{fontcolour=" + type + "}")); return MyGUI::Colour::parse(MyGUI::LanguageManager::getInstance().replaceTags("#{fontcolour=" + type + "}"));
} }
@ -115,7 +115,7 @@ namespace MWGui
void Response::write(BookTypesetter::Ptr typesetter, KeywordSearchT* keywordSearch, std::map<std::string, Link*>& topicLinks) const void Response::write(BookTypesetter::Ptr typesetter, KeywordSearchT* keywordSearch, std::map<std::string, Link*>& topicLinks) const
{ {
BookTypesetter::Style* title = typesetter->createStyle("", getTextColour("header")); BookTypesetter::Style* title = typesetter->createStyle("", getDialogueTextColour("header"));
typesetter->sectionBreak(9); typesetter->sectionBreak(9);
if (mTitle != "") if (mTitle != "")
typesetter->write(title, to_utf8_span(mTitle.c_str())); typesetter->write(title, to_utf8_span(mTitle.c_str()));
@ -159,14 +159,14 @@ namespace MWGui
if (hyperLinks.size() && MWBase::Environment::get().getWindowManager()->getTranslationDataStorage().hasTranslation()) if (hyperLinks.size() && MWBase::Environment::get().getWindowManager()->getTranslationDataStorage().hasTranslation())
{ {
BookTypesetter::Style* style = typesetter->createStyle("", getTextColour("normal")); BookTypesetter::Style* style = typesetter->createStyle("", getDialogueTextColour("normal"));
size_t formatted = 0; // points to the first character that is not laid out yet size_t formatted = 0; // points to the first character that is not laid out yet
for (std::map<Range, intptr_t>::iterator it = hyperLinks.begin(); it != hyperLinks.end(); ++it) for (std::map<Range, intptr_t>::iterator it = hyperLinks.begin(); it != hyperLinks.end(); ++it)
{ {
intptr_t topicId = it->second; intptr_t topicId = it->second;
const MyGUI::Colour linkHot (getTextColour("link_over")); const MyGUI::Colour linkHot(getDialogueTextColour("link_over"));
const MyGUI::Colour linkNormal (getTextColour("link")); const MyGUI::Colour linkNormal(getDialogueTextColour("link"));
const MyGUI::Colour linkActive (getTextColour("link_pressed")); const MyGUI::Colour linkActive(getDialogueTextColour("link_pressed"));
BookTypesetter::Style* hotStyle = typesetter->createHotStyle (style, linkNormal, linkHot, linkActive, topicId); BookTypesetter::Style* hotStyle = typesetter->createHotStyle (style, linkNormal, linkHot, linkActive, topicId);
if (formatted < it->first.first) if (formatted < it->first.first)
typesetter->write(style, formatted, it->first.first); typesetter->write(style, formatted, it->first.first);
@ -199,11 +199,11 @@ namespace MWGui
void Response::addTopicLink(BookTypesetter::Ptr typesetter, intptr_t topicId, size_t begin, size_t end) const void Response::addTopicLink(BookTypesetter::Ptr typesetter, intptr_t topicId, size_t begin, size_t end) const
{ {
BookTypesetter::Style* style = typesetter->createStyle("", getTextColour("normal")); BookTypesetter::Style* style = typesetter->createStyle("", getDialogueTextColour("normal"));
const MyGUI::Colour linkHot (getTextColour("link_over")); const MyGUI::Colour linkHot(getDialogueTextColour("link_over"));
const MyGUI::Colour linkNormal (getTextColour("link")); const MyGUI::Colour linkNormal(getDialogueTextColour("link"));
const MyGUI::Colour linkActive (getTextColour("link_pressed")); const MyGUI::Colour linkActive(getDialogueTextColour("link_pressed"));
if (topicId) if (topicId)
style = typesetter->createHotStyle (style, linkNormal, linkHot, linkActive, topicId); style = typesetter->createHotStyle (style, linkNormal, linkHot, linkActive, topicId);
@ -217,7 +217,7 @@ namespace MWGui
void Message::write(BookTypesetter::Ptr typesetter, KeywordSearchT* keywordSearch, std::map<std::string, Link*>& topicLinks) const void Message::write(BookTypesetter::Ptr typesetter, KeywordSearchT* keywordSearch, std::map<std::string, Link*>& topicLinks) const
{ {
BookTypesetter::Style* title = typesetter->createStyle("", getTextColour("notify")); BookTypesetter::Style* title = typesetter->createStyle("", getDialogueTextColour("notify"));
typesetter->sectionBreak(9); typesetter->sectionBreak(9);
typesetter->write(title, to_utf8_span(mText.c_str())); typesetter->write(title, to_utf8_span(mText.c_str()));
} }
@ -486,9 +486,9 @@ namespace MWGui
typesetter->sectionBreak(9); typesetter->sectionBreak(9);
// choices // choices
const MyGUI::Colour linkHot (getTextColour("answer_over")); const MyGUI::Colour linkHot(getDialogueTextColour("answer_over"));
const MyGUI::Colour linkNormal (getTextColour("answer")); const MyGUI::Colour linkNormal(getDialogueTextColour("answer"));
const MyGUI::Colour linkActive (getTextColour("answer_pressed")); const MyGUI::Colour linkActive(getDialogueTextColour("answer_pressed"));
for (std::vector<std::pair<std::string, int> >::iterator it = mChoices.begin(); it != mChoices.end(); ++it) for (std::vector<std::pair<std::string, int> >::iterator it = mChoices.begin(); it != mChoices.end(); ++it)
{ {
Choice* link = new Choice(it->second); Choice* link = new Choice(it->second);

@ -1,4 +1,5 @@
#ifndef OPENMW_MECHANICS_STEERING_H #ifndef OPENMW_MECHANICS_STEERING_H
#define OPENMW_MECHANICS_STEERING_H
#include <osg/Math> #include <osg/Math>

@ -14,10 +14,10 @@
namespace namespace
{ {
class UpdateCameraCallback : public osg::NodeCallback class UpdateRenderCameraCallback : public osg::NodeCallback
{ {
public: public:
UpdateCameraCallback(MWRender::Camera* cam) UpdateRenderCameraCallback(MWRender::Camera* cam)
: mCamera(cam) : mCamera(cam)
{ {
} }
@ -67,7 +67,7 @@ namespace MWRender
mMainCam.yaw = 0.f; mMainCam.yaw = 0.f;
mMainCam.offset = 400.f; mMainCam.offset = 400.f;
mUpdateCallback = new UpdateCameraCallback(this); mUpdateCallback = new UpdateRenderCameraCallback(this);
mCamera->addUpdateCallback(mUpdateCallback); mCamera->addUpdateCallback(mUpdateCallback);
} }

@ -59,10 +59,10 @@ namespace
} }
class CameraUpdateCallback : public osg::NodeCallback class CameraUpdateGlobalCallback : public osg::NodeCallback
{ {
public: public:
CameraUpdateCallback(osg::Camera* cam, MWRender::GlobalMap* parent) CameraUpdateGlobalCallback(osg::Camera* cam, MWRender::GlobalMap* parent)
: mRendered(false) : mRendered(false)
, mCamera(cam) , mCamera(cam)
, mParent(parent) , mParent(parent)
@ -263,7 +263,7 @@ namespace MWRender
else else
camera->setClearMask(GL_NONE); camera->setClearMask(GL_NONE);
camera->setUpdateCallback(new CameraUpdateCallback(camera, this)); camera->setUpdateCallback(new CameraUpdateGlobalCallback(camera, this));
camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT, osg::Camera::PIXEL_BUFFER_RTT); camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT, osg::Camera::PIXEL_BUFFER_RTT);
camera->attach(osg::Camera::COLOR_BUFFER, mOverlayTexture); camera->attach(osg::Camera::COLOR_BUFFER, mOverlayTexture);

@ -27,10 +27,10 @@
namespace namespace
{ {
class CameraUpdateCallback : public osg::NodeCallback class CameraLocalUpdateCallback : public osg::NodeCallback
{ {
public: public:
CameraUpdateCallback(osg::Camera* cam, MWRender::LocalMap* parent) CameraLocalUpdateCallback(osg::Camera* cam, MWRender::LocalMap* parent)
: mRendered(false) : mRendered(false)
, mCamera(cam) , mCamera(cam)
, mParent(parent) , mParent(parent)
@ -205,7 +205,7 @@ osg::ref_ptr<osg::Camera> LocalMap::createOrthographicCamera(float x, float y, f
camera->setStateSet(stateset); camera->setStateSet(stateset);
camera->setGraphicsContext(mViewer->getCamera()->getGraphicsContext()); camera->setGraphicsContext(mViewer->getCamera()->getGraphicsContext());
camera->setViewport(0, 0, mMapResolution, mMapResolution); camera->setViewport(0, 0, mMapResolution, mMapResolution);
camera->setUpdateCallback(new CameraUpdateCallback(camera, this)); camera->setUpdateCallback(new CameraLocalUpdateCallback(camera, this));
return camera; return camera;
} }

@ -1,6 +1,5 @@
#include "sky.hpp" #include "sky.hpp"
#define _USE_MATH_DEFINES
#include <cmath> #include <cmath>
#include <osg/Transform> #include <osg/Transform>

@ -56,10 +56,10 @@ namespace MWScript
if (count == 0) if (count == 0)
return; return;
if(Misc::StringUtils::ciEqual(item, "gold_005") if(::Misc::StringUtils::ciEqual(item, "gold_005")
|| Misc::StringUtils::ciEqual(item, "gold_010") || ::Misc::StringUtils::ciEqual(item, "gold_010")
|| Misc::StringUtils::ciEqual(item, "gold_025") || ::Misc::StringUtils::ciEqual(item, "gold_025")
|| Misc::StringUtils::ciEqual(item, "gold_100")) || ::Misc::StringUtils::ciEqual(item, "gold_100"))
item = "gold_001"; item = "gold_001";
MWWorld::Ptr itemPtr = *ptr.getClass().getContainerStore (ptr).add (item, count, ptr); MWWorld::Ptr itemPtr = *ptr.getClass().getContainerStore (ptr).add (item, count, ptr);
@ -97,10 +97,10 @@ namespace MWScript
std::string item = runtime.getStringLiteral (runtime[0].mInteger); std::string item = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop(); runtime.pop();
if(Misc::StringUtils::ciEqual(item, "gold_005") if(::Misc::StringUtils::ciEqual(item, "gold_005")
|| Misc::StringUtils::ciEqual(item, "gold_010") || ::Misc::StringUtils::ciEqual(item, "gold_010")
|| Misc::StringUtils::ciEqual(item, "gold_025") || ::Misc::StringUtils::ciEqual(item, "gold_025")
|| Misc::StringUtils::ciEqual(item, "gold_100")) || ::Misc::StringUtils::ciEqual(item, "gold_100"))
item = "gold_001"; item = "gold_001";
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr); MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr);
@ -131,10 +131,10 @@ namespace MWScript
if (count == 0) if (count == 0)
return; return;
if(Misc::StringUtils::ciEqual(item, "gold_005") if(::Misc::StringUtils::ciEqual(item, "gold_005")
|| Misc::StringUtils::ciEqual(item, "gold_010") || ::Misc::StringUtils::ciEqual(item, "gold_010")
|| Misc::StringUtils::ciEqual(item, "gold_025") || ::Misc::StringUtils::ciEqual(item, "gold_025")
|| Misc::StringUtils::ciEqual(item, "gold_100")) || ::Misc::StringUtils::ciEqual(item, "gold_100"))
item = "gold_001"; item = "gold_001";
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr); MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr);

@ -228,7 +228,7 @@ namespace MWScript
// workaround broken endgame scripts that kill dagoth ur // workaround broken endgame scripts that kill dagoth ur
if (!R::implicit && if (!R::implicit &&
Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), "dagoth_ur_1")) ::Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), "dagoth_ur_1"))
{ {
runtime.push (peek); runtime.push (peek);

@ -994,7 +994,7 @@ namespace MWWorld
template<> template<>
inline void Store<ESM::Dialogue>::setUp() void Store<ESM::Dialogue>::setUp()
{ {
// DialInfos marked as deleted are kept during the loading phase, so that the linked list // DialInfos marked as deleted are kept during the loading phase, so that the linked list
// structure is kept intact for inserting further INFOs. Delete them now that loading is done. // structure is kept intact for inserting further INFOs. Delete them now that loading is done.
@ -1013,7 +1013,7 @@ namespace MWWorld
} }
template <> template <>
inline void Store<ESM::Dialogue>::load(ESM::ESMReader &esm, const std::string &id) { void Store<ESM::Dialogue>::load(ESM::ESMReader &esm, const std::string &id) {
std::string idLower = Misc::StringUtils::lowerCase(id); std::string idLower = Misc::StringUtils::lowerCase(id);
std::map<std::string, ESM::Dialogue>::iterator it = mStatic.find(idLower); std::map<std::string, ESM::Dialogue>::iterator it = mStatic.find(idLower);
@ -1029,7 +1029,6 @@ namespace MWWorld
// Script // Script
//========================================================================= //=========================================================================
template <>
inline void Store<ESM::Script>::load(ESM::ESMReader &esm, const std::string &id) { inline void Store<ESM::Script>::load(ESM::ESMReader &esm, const std::string &id) {
ESM::Script scpt; ESM::Script scpt;
scpt.load(esm); scpt.load(esm);
@ -1046,7 +1045,6 @@ namespace MWWorld
// StartScript // StartScript
//========================================================================= //=========================================================================
template <>
inline void Store<ESM::StartScript>::load(ESM::ESMReader &esm, const std::string &id) inline void Store<ESM::StartScript>::load(ESM::ESMReader &esm, const std::string &id)
{ {
ESM::StartScript s; ESM::StartScript s;

@ -1,6 +1,3 @@
#define _USE_MATH_DEFINES
#include <cmath>
#include "weather.hpp" #include "weather.hpp"
#include <components/misc/rng.hpp> #include <components/misc/rng.hpp>
@ -26,6 +23,8 @@
#include "fallback.hpp" #include "fallback.hpp"
#include "cellstore.hpp" #include "cellstore.hpp"
#include <cmath>
using namespace MWWorld; using namespace MWWorld;
namespace namespace

@ -47,7 +47,7 @@ add_component_dir (sceneutil
) )
add_component_dir (nif add_component_dir (nif
controlled effect niftypes record controller extra node record_ptr data niffile property nifkey data node base nifstream controlled effect niftypes record controller extra node record_ptr data niffile property nifkey base nifstream
) )
add_component_dir (nifosg add_component_dir (nifosg

@ -4,9 +4,9 @@
#include <cstring> #include <cstring>
#include <windows.h>
#include <shlobj.h> #include <shlobj.h>
#include <shlwapi.h> #include <shlwapi.h>
#include <WinReg.h>
#include <boost/locale.hpp> #include <boost/locale.hpp>
namespace bconv = boost::locale::conv; namespace bconv = boost::locale::conv;

@ -1,3 +1,6 @@
#ifndef VFS_BSAARCHIVE_HPP_
#define VFS_BSAARCHIVE_HPP_
#include "archive.hpp" #include "archive.hpp"
#include <components/bsa/bsa_file.hpp> #include <components/bsa/bsa_file.hpp>
@ -30,3 +33,5 @@ namespace VFS
}; };
} }
#endif
Loading…
Cancel
Save