From 22a5f7198f8fd893fcf9bb590ef4aafb7a454593 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Wed, 4 Sep 2013 23:25:47 +0200 Subject: [PATCH] A few fixes to build on Windows --- apps/launcher/unshieldthread.hpp | 5 ++++- apps/opencs/model/world/refcollection.cpp | 2 ++ apps/opencs/model/world/refcollection.hpp | 4 +++- libs/openengine/ogre/lights.cpp | 10 +++++----- libs/openengine/ogre/lights.hpp | 15 +++++++++++++-- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/apps/launcher/unshieldthread.hpp b/apps/launcher/unshieldthread.hpp index b48d3d987..c4e15cccd 100644 --- a/apps/launcher/unshieldthread.hpp +++ b/apps/launcher/unshieldthread.hpp @@ -5,8 +5,9 @@ #include +#ifndef _WIN32 #include - +#endif class UnshieldThread : public QThread { @@ -33,7 +34,9 @@ class UnshieldThread : public QThread private: void extract_cab(const boost::filesystem::path& cab, const boost::filesystem::path& output_dir, bool extract_ini = false); +#ifndef _WIN32 bool extract_file(Unshield* unshield, boost::filesystem::path output_dir, const char* prefix, int index); +#endif boost::filesystem::path mMorrowindPath; boost::filesystem::path mTribunalPath; diff --git a/apps/opencs/model/world/refcollection.cpp b/apps/opencs/model/world/refcollection.cpp index 085817753..f06cfb545 100644 --- a/apps/opencs/model/world/refcollection.cpp +++ b/apps/opencs/model/world/refcollection.cpp @@ -6,9 +6,11 @@ #include "ref.hpp" #include "cell.hpp" +/* CSMWorld::RefCollection::RefCollection (Collection& cells) : mCells (cells), mNextId (0) {} +*/ void CSMWorld::RefCollection::load (ESM::ESMReader& reader, int cellIndex, bool base) { diff --git a/apps/opencs/model/world/refcollection.hpp b/apps/opencs/model/world/refcollection.hpp index 895315a17..c22f17d7b 100644 --- a/apps/opencs/model/world/refcollection.hpp +++ b/apps/opencs/model/world/refcollection.hpp @@ -17,7 +17,9 @@ namespace CSMWorld public: - RefCollection (Collection& cells); + RefCollection (Collection& cells) + : mCells (cells), mNextId (0) + {} void load (ESM::ESMReader& reader, int cellIndex, bool base); ///< Load a sequence of references. diff --git a/libs/openengine/ogre/lights.cpp b/libs/openengine/ogre/lights.cpp index 52aca6a70..ef16e0b2f 100644 --- a/libs/openengine/ogre/lights.cpp +++ b/libs/openengine/ogre/lights.cpp @@ -1,12 +1,12 @@ #include "lights.hpp" #include -#include + namespace OEngine { namespace Render { - +/* LightFunction::LightFunction(LightType type) : ControllerFunction(true) , mType(type) @@ -14,7 +14,7 @@ LightFunction::LightFunction(LightType type) , mDirection(1.0f) { } - +*/ Ogre::Real LightFunction::pulseAmplitude(Ogre::Real time) { return std::sin(time); @@ -97,13 +97,13 @@ Ogre::Real LightFunction::calculate(Ogre::Real value) return brightness; } - +/* LightValue::LightValue(Ogre::Light *light, const Ogre::ColourValue &color) : mTarget(light) , mColor(color) { } - +*/ Ogre::Real LightValue::getValue() const { return 0.0f; diff --git a/libs/openengine/ogre/lights.hpp b/libs/openengine/ogre/lights.hpp index c63f16425..46b3ff1d0 100644 --- a/libs/openengine/ogre/lights.hpp +++ b/libs/openengine/ogre/lights.hpp @@ -3,6 +3,7 @@ #include #include +#include /* * Controller classes to handle pulsing and flicker lights @@ -30,7 +31,13 @@ namespace Render { static Ogre::Real flickerFrequency(Ogre::Real phase); public: - LightFunction(LightType type); + LightFunction(LightType type) + : ControllerFunction(true) + , mType(type) + , mPhase(Ogre::Math::RangeRandom(-500.0f, +500.0f)) + , mDirection(1.0f) + { + } virtual Ogre::Real calculate(Ogre::Real value); }; @@ -40,7 +47,11 @@ namespace Render { Ogre::ColourValue mColor; public: - LightValue(Ogre::Light *light, const Ogre::ColourValue &color); + LightValue(Ogre::Light *light, const Ogre::ColourValue &color) + : mTarget(light) + , mColor(color) + { + } virtual Ogre::Real getValue() const; virtual void setValue(Ogre::Real value);