mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 12:58:00 +03:00
Fix and prevent -Wextra-semi warning
This commit is contained in:
parent
bfa303f73b
commit
063fff7fa4
34 changed files with 111 additions and 107 deletions
|
@ -101,3 +101,4 @@ TabWidth: 4
|
||||||
UseTab: Never
|
UseTab: Never
|
||||||
StatementMacros:
|
StatementMacros:
|
||||||
- META_Object
|
- META_Object
|
||||||
|
- META_StateAttribute
|
||||||
|
|
|
@ -582,7 +582,7 @@ endif()
|
||||||
|
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wundef -Wno-unused-parameter -pedantic -Wno-long-long ${CMAKE_CXX_FLAGS}")
|
set(OPENMW_CXX_FLAGS "-Wall -Wextra -Wundef -Wextra-semi -Wno-unused-parameter -pedantic -Wno-long-long ${OPENMW_CXX_FLAGS}")
|
||||||
add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON )
|
add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON )
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
@ -592,12 +592,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND NOT APPLE)
|
if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND NOT APPLE)
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 3.6)
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 3.6)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-potentially-evaluated-expression")
|
set(${OPENMW_CXX_FLAGS} "${OPENMW_CXX_FLAGS} -Wno-potentially-evaluated-expression")
|
||||||
endif ()
|
endif ()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.6)
|
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.6)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-parameter")
|
set(${OPENMW_CXX_FLAGS} "${OPENMW_CXX_FLAGS} -Wno-unused-but-set-parameter")
|
||||||
endif()
|
endif()
|
||||||
endif (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
endif (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||||
|
|
||||||
|
|
|
@ -937,7 +937,7 @@ public:
|
||||||
{
|
{
|
||||||
if (Settings::Manager::getInt("lua num threads", "Lua") > 0)
|
if (Settings::Manager::getInt("lua num threads", "Lua") > 0)
|
||||||
mThread = std::thread([this] { threadBody(); });
|
mThread = std::thread([this] { threadBody(); });
|
||||||
};
|
}
|
||||||
|
|
||||||
~LuaWorker()
|
~LuaWorker()
|
||||||
{
|
{
|
||||||
|
@ -969,7 +969,7 @@ public:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
update();
|
update();
|
||||||
};
|
}
|
||||||
|
|
||||||
void join()
|
void join()
|
||||||
{
|
{
|
||||||
|
|
|
@ -84,7 +84,7 @@ namespace MWBase
|
||||||
virtual void setupPlayer(const MWWorld::Ptr&) = 0;
|
virtual void setupPlayer(const MWWorld::Ptr&) = 0;
|
||||||
|
|
||||||
// Saving
|
// Saving
|
||||||
int countSavedGameRecords() const { return 1; };
|
int countSavedGameRecords() const { return 1; }
|
||||||
virtual void write(ESM::ESMWriter& writer, Loading::Listener& progress) = 0;
|
virtual void write(ESM::ESMWriter& writer, Loading::Listener& progress) = 0;
|
||||||
virtual void saveLocalScripts(const MWWorld::Ptr& ptr, ESM::LuaScripts& data) = 0;
|
virtual void saveLocalScripts(const MWWorld::Ptr& ptr, ESM::LuaScripts& data) = 0;
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace MWGui
|
||||||
|
|
||||||
void onDeleteCustomData(const MWWorld::Ptr& ptr) override;
|
void onDeleteCustomData(const MWWorld::Ptr& ptr) override;
|
||||||
|
|
||||||
void treatNextOpenAsLoot() { mTreatNextOpenAsLoot = true; };
|
void treatNextOpenAsLoot() { mTreatNextOpenAsLoot = true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DragAndDrop* mDragAndDrop;
|
DragAndDrop* mDragAndDrop;
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MessageBox(MessageBoxManager& parMessageBoxManager, std::string_view message);
|
MessageBox(MessageBoxManager& parMessageBoxManager, std::string_view message);
|
||||||
const std::string& getMessage() { return mMessage; };
|
const std::string& getMessage() { return mMessage; }
|
||||||
int getHeight();
|
int getHeight();
|
||||||
void update(int height);
|
void update(int height);
|
||||||
void setVisible(bool value);
|
void setVisible(bool value);
|
||||||
|
|
|
@ -48,8 +48,8 @@ namespace MWInput
|
||||||
void resetIdleTime();
|
void resetIdleTime();
|
||||||
float getIdleTime() const { return mTimeIdle; }
|
float getIdleTime() const { return mTimeIdle; }
|
||||||
|
|
||||||
bool isAlwaysRunActive() const { return mAlwaysRunActive; };
|
bool isAlwaysRunActive() const { return mAlwaysRunActive; }
|
||||||
bool isSneaking() const { return mSneaking; };
|
bool isSneaking() const { return mSneaking; }
|
||||||
|
|
||||||
void setAttemptJump(bool enabled) { mAttemptJump = enabled; }
|
void setAttemptJump(bool enabled) { mAttemptJump = enabled; }
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ namespace MWMechanics
|
||||||
virtual MWWorld::Ptr getTarget() const;
|
virtual MWWorld::Ptr getTarget() const;
|
||||||
|
|
||||||
/// Get the destination point of the AI package (not applicable to all AI packages, default return (0, 0, 0))
|
/// Get the destination point of the AI package (not applicable to all AI packages, default return (0, 0, 0))
|
||||||
virtual osg::Vec3f getDestination(const MWWorld::Ptr& actor) const { return osg::Vec3f(0, 0, 0); };
|
virtual osg::Vec3f getDestination(const MWWorld::Ptr& actor) const { return osg::Vec3f(0, 0, 0); }
|
||||||
|
|
||||||
/// Return true if having this AiPackage makes the actor side with the target in fights (default false)
|
/// Return true if having this AiPackage makes the actor side with the target in fights (default false)
|
||||||
bool sideWithTarget() const { return mOptions.mSideWithTarget; }
|
bool sideWithTarget() const { return mOptions.mSideWithTarget; }
|
||||||
|
|
|
@ -24,14 +24,14 @@ namespace MWMechanics
|
||||||
Stat();
|
Stat();
|
||||||
Stat(T base, T modified);
|
Stat(T base, T modified);
|
||||||
|
|
||||||
const T& getBase() const { return mBase; };
|
const T& getBase() const { return mBase; }
|
||||||
|
|
||||||
T getModified(bool capped = true) const;
|
T getModified(bool capped = true) const;
|
||||||
T getModifier() const { return mModifier; };
|
T getModifier() const { return mModifier; }
|
||||||
|
|
||||||
void setBase(const T& value) { mBase = value; };
|
void setBase(const T& value) { mBase = value; }
|
||||||
|
|
||||||
void setModifier(const T& modifier) { mModifier = modifier; };
|
void setModifier(const T& modifier) { mModifier = modifier; }
|
||||||
|
|
||||||
void writeState(ESM::StatState<T>& state) const;
|
void writeState(ESM::StatState<T>& state) const;
|
||||||
void readState(const ESM::StatState<T>& state);
|
void readState(const ESM::StatState<T>& state);
|
||||||
|
@ -63,13 +63,13 @@ namespace MWMechanics
|
||||||
DynamicStat(T base, T modified, T current);
|
DynamicStat(T base, T modified, T current);
|
||||||
DynamicStat(const Stat<T>& stat, T current);
|
DynamicStat(const Stat<T>& stat, T current);
|
||||||
|
|
||||||
const T& getBase() const { return mStatic.getBase(); };
|
const T& getBase() const { return mStatic.getBase(); }
|
||||||
T getModified(bool capped = true) const { return mStatic.getModified(capped); };
|
T getModified(bool capped = true) const { return mStatic.getModified(capped); }
|
||||||
const T& getCurrent() const { return mCurrent; };
|
const T& getCurrent() const { return mCurrent; }
|
||||||
T getRatio(bool nanIsZero = true) const;
|
T getRatio(bool nanIsZero = true) const;
|
||||||
|
|
||||||
/// Set base and adjust current accordingly.
|
/// Set base and adjust current accordingly.
|
||||||
void setBase(const T& value) { mStatic.setBase(value); };
|
void setBase(const T& value) { mStatic.setBase(value); }
|
||||||
|
|
||||||
void setCurrent(const T& value, bool allowDecreaseBelowZero = false, bool allowIncreaseAboveModified = false);
|
void setCurrent(const T& value, bool allowDecreaseBelowZero = false, bool allowIncreaseAboveModified = false);
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace MWRender
|
||||||
{
|
{
|
||||||
osg::Vec4f stubColor = osg::Vec4f(0, 0, 0, 0);
|
osg::Vec4f stubColor = osg::Vec4f(0, 0, 0, 0);
|
||||||
return attachMesh(model, bonename, false, &stubColor);
|
return attachMesh(model, bonename, false, &stubColor);
|
||||||
};
|
}
|
||||||
osg::ref_ptr<osg::Node> attach(
|
osg::ref_ptr<osg::Node> attach(
|
||||||
const std::string& model, std::string_view bonename, std::string_view bonefilter, bool isLight);
|
const std::string& model, std::string_view bonename, std::string_view bonefilter, bool isLight);
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ namespace MWRender
|
||||||
|
|
||||||
void setTextKeyListener(TextKeyListener* listener);
|
void setTextKeyListener(TextKeyListener* listener);
|
||||||
|
|
||||||
virtual bool updateCarriedLeftVisible(const int weaptype) const { return false; };
|
virtual bool updateCarriedLeftVisible(const int weaptype) const { return false; }
|
||||||
|
|
||||||
typedef std::unordered_map<std::string, osg::ref_ptr<osg::MatrixTransform>, Misc::StringUtils::CiHash,
|
typedef std::unordered_map<std::string, osg::ref_ptr<osg::MatrixTransform>, Misc::StringUtils::CiHash,
|
||||||
Misc::StringUtils::CiEqual>
|
Misc::StringUtils::CiEqual>
|
||||||
|
|
|
@ -32,7 +32,9 @@ namespace MWRender
|
||||||
CollisionView(btVector3 orig, btVector3 normal)
|
CollisionView(btVector3 orig, btVector3 normal)
|
||||||
: mOrig(orig)
|
: mOrig(orig)
|
||||||
, mEnd(orig + normal * 20)
|
, mEnd(orig + normal * 20)
|
||||||
, mCreated(std::chrono::steady_clock::now()){};
|
, mCreated(std::chrono::steady_clock::now())
|
||||||
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
std::vector<CollisionView> mCollisionViews;
|
std::vector<CollisionView> mCollisionViews;
|
||||||
osg::ref_ptr<osg::Group> mShapesRoot;
|
osg::ref_ptr<osg::Group> mShapesRoot;
|
||||||
|
@ -69,7 +71,9 @@ namespace MWRender
|
||||||
void showCollisions();
|
void showCollisions();
|
||||||
|
|
||||||
void drawContactPoint(const btVector3& PointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime,
|
void drawContactPoint(const btVector3& PointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime,
|
||||||
const btVector3& color) override{};
|
const btVector3& color) override
|
||||||
|
{
|
||||||
|
}
|
||||||
void drawSphere(btScalar radius, const btTransform& transform, const btVector3& color) override;
|
void drawSphere(btScalar radius, const btTransform& transform, const btVector3& color) override;
|
||||||
|
|
||||||
void reportErrorWarning(const char* warningString) override;
|
void reportErrorWarning(const char* warningString) override;
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace MWRender
|
||||||
class CellRender
|
class CellRender
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~CellRender(){};
|
virtual ~CellRender() = default;
|
||||||
|
|
||||||
/// Make the cell visible. Load the cell if necessary.
|
/// Make the cell visible. Load the cell if necessary.
|
||||||
virtual void show() = 0;
|
virtual void show() = 0;
|
||||||
|
|
|
@ -185,7 +185,7 @@ namespace MWRender
|
||||||
|
|
||||||
camera->setNodeMask(Mask_RenderToTexture);
|
camera->setNodeMask(Mask_RenderToTexture);
|
||||||
camera->addChild(mGroup);
|
camera->addChild(mGroup);
|
||||||
};
|
}
|
||||||
|
|
||||||
void apply(osg::Camera* camera) override
|
void apply(osg::Camera* camera) override
|
||||||
{
|
{
|
||||||
|
@ -195,7 +195,7 @@ namespace MWRender
|
||||||
|
|
||||||
if (shouldDoTextureArray())
|
if (shouldDoTextureArray())
|
||||||
Stereo::setMultiviewMatrices(mGroup->getOrCreateStateSet(), { mPerspectiveMatrix, mPerspectiveMatrix });
|
Stereo::setMultiviewMatrices(mGroup->getOrCreateStateSet(), { mPerspectiveMatrix, mPerspectiveMatrix });
|
||||||
};
|
}
|
||||||
|
|
||||||
void addChild(osg::Node* node) { mGroup->addChild(node); }
|
void addChild(osg::Node* node) { mGroup->addChild(node); }
|
||||||
|
|
||||||
|
|
|
@ -92,17 +92,17 @@ namespace
|
||||||
mFloats.clear();
|
mFloats.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
int getShort(std::size_t index) const { return getLocal(index, mShorts); };
|
int getShort(std::size_t index) const { return getLocal(index, mShorts); }
|
||||||
|
|
||||||
int getLong(std::size_t index) const { return getLocal(index, mLongs); };
|
int getLong(std::size_t index) const { return getLocal(index, mLongs); }
|
||||||
|
|
||||||
float getFloat(std::size_t index) const { return getLocal(index, mFloats); };
|
float getFloat(std::size_t index) const { return getLocal(index, mFloats); }
|
||||||
|
|
||||||
void setShort(std::size_t index, int value) { setLocal(value, index, mShorts); };
|
void setShort(std::size_t index, int value) { setLocal(value, index, mShorts); }
|
||||||
|
|
||||||
void setLong(std::size_t index, int value) { setLocal(value, index, mLongs); };
|
void setLong(std::size_t index, int value) { setLocal(value, index, mLongs); }
|
||||||
|
|
||||||
void setFloat(std::size_t index, float value) { setLocal(value, index, mFloats); };
|
void setFloat(std::size_t index, float value) { setLocal(value, index, mFloats); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class GlobalVariables
|
class GlobalVariables
|
||||||
|
@ -128,17 +128,17 @@ namespace
|
||||||
mFloats.clear();
|
mFloats.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
int getShort(std::string_view name) const { return getGlobal(name, mShorts); };
|
int getShort(std::string_view name) const { return getGlobal(name, mShorts); }
|
||||||
|
|
||||||
int getLong(std::string_view name) const { return getGlobal(name, mLongs); };
|
int getLong(std::string_view name) const { return getGlobal(name, mLongs); }
|
||||||
|
|
||||||
float getFloat(std::string_view name) const { return getGlobal(name, mFloats); };
|
float getFloat(std::string_view name) const { return getGlobal(name, mFloats); }
|
||||||
|
|
||||||
void setShort(std::string_view name, int value) { mShorts[std::string(name)] = value; };
|
void setShort(std::string_view name, int value) { mShorts[std::string(name)] = value; }
|
||||||
|
|
||||||
void setLong(std::string_view name, int value) { mLongs[std::string(name)] = value; };
|
void setLong(std::string_view name, int value) { mLongs[std::string(name)] = value; }
|
||||||
|
|
||||||
void setFloat(std::string_view name, float value) { mFloats[std::string(name)] = value; };
|
void setFloat(std::string_view name, float value) { mFloats[std::string(name)] = value; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class TestInterpreterContext : public Interpreter::Context
|
class TestInterpreterContext : public Interpreter::Context
|
||||||
|
@ -147,65 +147,65 @@ namespace
|
||||||
std::map<std::string, GlobalVariables, std::less<>> mMembers;
|
std::map<std::string, GlobalVariables, std::less<>> mMembers;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::string_view getTarget() const override { return {}; };
|
std::string_view getTarget() const override { return {}; }
|
||||||
|
|
||||||
int getLocalShort(int index) const override { return mLocals.getShort(index); };
|
int getLocalShort(int index) const override { return mLocals.getShort(index); }
|
||||||
|
|
||||||
int getLocalLong(int index) const override { return mLocals.getLong(index); };
|
int getLocalLong(int index) const override { return mLocals.getLong(index); }
|
||||||
|
|
||||||
float getLocalFloat(int index) const override { return mLocals.getFloat(index); };
|
float getLocalFloat(int index) const override { return mLocals.getFloat(index); }
|
||||||
|
|
||||||
void setLocalShort(int index, int value) override { mLocals.setShort(index, value); };
|
void setLocalShort(int index, int value) override { mLocals.setShort(index, value); }
|
||||||
|
|
||||||
void setLocalLong(int index, int value) override { mLocals.setLong(index, value); };
|
void setLocalLong(int index, int value) override { mLocals.setLong(index, value); }
|
||||||
|
|
||||||
void setLocalFloat(int index, float value) override { mLocals.setFloat(index, value); };
|
void setLocalFloat(int index, float value) override { mLocals.setFloat(index, value); }
|
||||||
|
|
||||||
void messageBox(std::string_view message, const std::vector<std::string>& buttons) override{};
|
void messageBox(std::string_view message, const std::vector<std::string>& buttons) override {}
|
||||||
|
|
||||||
void report(const std::string& message) override{};
|
void report(const std::string& message) override {}
|
||||||
|
|
||||||
int getGlobalShort(std::string_view name) const override { return {}; };
|
int getGlobalShort(std::string_view name) const override { return {}; }
|
||||||
|
|
||||||
int getGlobalLong(std::string_view name) const override { return {}; };
|
int getGlobalLong(std::string_view name) const override { return {}; }
|
||||||
|
|
||||||
float getGlobalFloat(std::string_view name) const override { return {}; };
|
float getGlobalFloat(std::string_view name) const override { return {}; }
|
||||||
|
|
||||||
void setGlobalShort(std::string_view name, int value) override{};
|
void setGlobalShort(std::string_view name, int value) override {}
|
||||||
|
|
||||||
void setGlobalLong(std::string_view name, int value) override{};
|
void setGlobalLong(std::string_view name, int value) override {}
|
||||||
|
|
||||||
void setGlobalFloat(std::string_view name, float value) override{};
|
void setGlobalFloat(std::string_view name, float value) override {}
|
||||||
|
|
||||||
std::vector<std::string> getGlobals() const override { return {}; };
|
std::vector<std::string> getGlobals() const override { return {}; }
|
||||||
|
|
||||||
char getGlobalType(std::string_view name) const override { return ' '; };
|
char getGlobalType(std::string_view name) const override { return ' '; }
|
||||||
|
|
||||||
std::string getActionBinding(std::string_view action) const override { return {}; };
|
std::string getActionBinding(std::string_view action) const override { return {}; }
|
||||||
|
|
||||||
std::string_view getActorName() const override { return {}; };
|
std::string_view getActorName() const override { return {}; }
|
||||||
|
|
||||||
std::string_view getNPCRace() const override { return {}; };
|
std::string_view getNPCRace() const override { return {}; }
|
||||||
|
|
||||||
std::string_view getNPCClass() const override { return {}; };
|
std::string_view getNPCClass() const override { return {}; }
|
||||||
|
|
||||||
std::string_view getNPCFaction() const override { return {}; };
|
std::string_view getNPCFaction() const override { return {}; }
|
||||||
|
|
||||||
std::string_view getNPCRank() const override { return {}; };
|
std::string_view getNPCRank() const override { return {}; }
|
||||||
|
|
||||||
std::string_view getPCName() const override { return {}; };
|
std::string_view getPCName() const override { return {}; }
|
||||||
|
|
||||||
std::string_view getPCRace() const override { return {}; };
|
std::string_view getPCRace() const override { return {}; }
|
||||||
|
|
||||||
std::string_view getPCClass() const override { return {}; };
|
std::string_view getPCClass() const override { return {}; }
|
||||||
|
|
||||||
std::string_view getPCRank() const override { return {}; };
|
std::string_view getPCRank() const override { return {}; }
|
||||||
|
|
||||||
std::string_view getPCNextRank() const override { return {}; };
|
std::string_view getPCNextRank() const override { return {}; }
|
||||||
|
|
||||||
int getPCBounty() const override { return {}; };
|
int getPCBounty() const override { return {}; }
|
||||||
|
|
||||||
std::string_view getCurrentCellName() const override { return {}; };
|
std::string_view getCurrentCellName() const override { return {}; }
|
||||||
|
|
||||||
int getMemberShort(std::string_view id, std::string_view name, bool global) const override
|
int getMemberShort(std::string_view id, std::string_view name, bool global) const override
|
||||||
{
|
{
|
||||||
|
@ -213,7 +213,7 @@ namespace
|
||||||
if (it != mMembers.end())
|
if (it != mMembers.end())
|
||||||
return it->second.getShort(name);
|
return it->second.getShort(name);
|
||||||
return {};
|
return {};
|
||||||
};
|
}
|
||||||
|
|
||||||
int getMemberLong(std::string_view id, std::string_view name, bool global) const override
|
int getMemberLong(std::string_view id, std::string_view name, bool global) const override
|
||||||
{
|
{
|
||||||
|
@ -221,7 +221,7 @@ namespace
|
||||||
if (it != mMembers.end())
|
if (it != mMembers.end())
|
||||||
return it->second.getLong(name);
|
return it->second.getLong(name);
|
||||||
return {};
|
return {};
|
||||||
};
|
}
|
||||||
|
|
||||||
float getMemberFloat(std::string_view id, std::string_view name, bool global) const override
|
float getMemberFloat(std::string_view id, std::string_view name, bool global) const override
|
||||||
{
|
{
|
||||||
|
@ -229,22 +229,22 @@ namespace
|
||||||
if (it != mMembers.end())
|
if (it != mMembers.end())
|
||||||
return it->second.getFloat(name);
|
return it->second.getFloat(name);
|
||||||
return {};
|
return {};
|
||||||
};
|
}
|
||||||
|
|
||||||
void setMemberShort(std::string_view id, std::string_view name, int value, bool global) override
|
void setMemberShort(std::string_view id, std::string_view name, int value, bool global) override
|
||||||
{
|
{
|
||||||
mMembers[std::string(id)].setShort(name, value);
|
mMembers[std::string(id)].setShort(name, value);
|
||||||
};
|
}
|
||||||
|
|
||||||
void setMemberLong(std::string_view id, std::string_view name, int value, bool global) override
|
void setMemberLong(std::string_view id, std::string_view name, int value, bool global) override
|
||||||
{
|
{
|
||||||
mMembers[std::string(id)].setLong(name, value);
|
mMembers[std::string(id)].setLong(name, value);
|
||||||
};
|
}
|
||||||
|
|
||||||
void setMemberFloat(std::string_view id, std::string_view name, float value, bool global) override
|
void setMemberFloat(std::string_view id, std::string_view name, float value, bool global) override
|
||||||
{
|
{
|
||||||
mMembers[std::string(id)].setFloat(name, value);
|
mMembers[std::string(id)].setFloat(name, value);
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CompiledScript
|
struct CompiledScript
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace Bsa
|
||||||
Hash hash;
|
Hash hash;
|
||||||
|
|
||||||
// Zero-terminated file name
|
// Zero-terminated file name
|
||||||
const char* name() const { return &(*namesBuffer)[namesOffset]; };
|
const char* name() const { return &(*namesBuffer)[namesOffset]; }
|
||||||
|
|
||||||
uint32_t namesOffset = 0;
|
uint32_t namesOffset = 0;
|
||||||
std::vector<char>* namesBuffer = nullptr;
|
std::vector<char>* namesBuffer = nullptr;
|
||||||
|
|
|
@ -149,7 +149,7 @@ namespace Compiler
|
||||||
|
|
||||||
in.seekg(p_orig);
|
in.seekg(p_orig);
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
|
|
||||||
void blank()
|
void blank()
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,7 +53,7 @@ namespace Debug
|
||||||
|
|
||||||
DebugGroup(const DebugGroup& debugGroup, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
|
DebugGroup(const DebugGroup& debugGroup, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
|
||||||
|
|
||||||
META_StateAttribute(Debug, DebugGroup, osg::StateAttribute::Type(101));
|
META_StateAttribute(Debug, DebugGroup, osg::StateAttribute::Type(101))
|
||||||
|
|
||||||
void apply(osg::State& state) const override;
|
void apply(osg::State& state) const override;
|
||||||
|
|
||||||
|
|
|
@ -35,10 +35,10 @@ namespace ESM
|
||||||
const std::string& getDesc() const { return mHeader.mData.desc; }
|
const std::string& getDesc() const { return mHeader.mData.desc; }
|
||||||
const std::vector<Header::MasterData>& getGameFiles() const { return mHeader.mMaster; }
|
const std::vector<Header::MasterData>& getGameFiles() const { return mHeader.mMaster; }
|
||||||
const Header& getHeader() const { return mHeader; }
|
const Header& getHeader() const { return mHeader; }
|
||||||
int getFormat() const { return mHeader.mFormat; };
|
int getFormat() const { return mHeader.mFormat; }
|
||||||
const NAME& retSubName() const { return mCtx.subName; }
|
const NAME& retSubName() const { return mCtx.subName; }
|
||||||
uint32_t getSubSize() const { return mCtx.leftSub; }
|
uint32_t getSubSize() const { return mCtx.leftSub; }
|
||||||
const std::filesystem::path& getName() const { return mCtx.filename; };
|
const std::filesystem::path& getName() const { return mCtx.filename; }
|
||||||
bool isOpen() const { return mEsm != nullptr; }
|
bool isOpen() const { return mEsm != nullptr; }
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
@ -73,7 +73,7 @@ namespace ESM
|
||||||
void openRaw(const std::filesystem::path& filename);
|
void openRaw(const std::filesystem::path& filename);
|
||||||
|
|
||||||
/// Get the current position in the file. Make sure that the file has been opened!
|
/// Get the current position in the file. Make sure that the file has been opened!
|
||||||
size_t getFileOffset() const { return mEsm->tellg(); };
|
size_t getFileOffset() const { return mEsm->tellg(); }
|
||||||
|
|
||||||
// This is a quick hack for multiple esm/esp files. Each plugin introduces its own
|
// This is a quick hack for multiple esm/esp files. Each plugin introduces its own
|
||||||
// terrain palette, but ESMReader does not pass a reference to the correct plugin
|
// terrain palette, but ESMReader does not pass a reference to the correct plugin
|
||||||
|
@ -200,7 +200,7 @@ namespace ESM
|
||||||
bool peekNextSub(NAME name);
|
bool peekNextSub(NAME name);
|
||||||
|
|
||||||
// Store the current subrecord name for the next call of getSubName()
|
// Store the current subrecord name for the next call of getSubName()
|
||||||
void cacheSubName() { mCtx.subCached = true; };
|
void cacheSubName() { mCtx.subCached = true; }
|
||||||
|
|
||||||
// Read subrecord name. This gets called a LOT, so I've optimized it
|
// Read subrecord name. This gets called a LOT, so I've optimized it
|
||||||
// slightly.
|
// slightly.
|
||||||
|
@ -283,7 +283,7 @@ namespace ESM
|
||||||
[[noreturn]] void fail(const std::string& msg);
|
[[noreturn]] void fail(const std::string& msg);
|
||||||
|
|
||||||
/// Sets font encoder for ESM strings
|
/// Sets font encoder for ESM strings
|
||||||
void setEncoder(ToUTF8::Utf8Encoder* encoder) { mEncoder = encoder; };
|
void setEncoder(ToUTF8::Utf8Encoder* encoder) { mEncoder = encoder; }
|
||||||
|
|
||||||
/// Get record flags of last record
|
/// Get record flags of last record
|
||||||
unsigned int getRecordFlags() { return mRecordFlags; }
|
unsigned int getRecordFlags() { return mRecordFlags; }
|
||||||
|
|
|
@ -123,7 +123,9 @@ namespace ESM
|
||||||
, mSkill(skill)
|
, mSkill(skill)
|
||||||
, mWeaponClass(weaponClass)
|
, mWeaponClass(weaponClass)
|
||||||
, mAmmoType(ammoType)
|
, mAmmoType(ammoType)
|
||||||
, mFlags(flags){};
|
, mFlags(flags)
|
||||||
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,16 +147,16 @@ namespace ESM4
|
||||||
|
|
||||||
inline bool isEsm4() const { return true; }
|
inline bool isEsm4() const { return true; }
|
||||||
|
|
||||||
inline void setEncoder(const ToUTF8::StatelessUtf8Encoder* encoder) { mEncoder = encoder; };
|
inline void setEncoder(const ToUTF8::StatelessUtf8Encoder* encoder) { mEncoder = encoder; }
|
||||||
|
|
||||||
const std::vector<ESM::MasterData>& getGameFiles() const { return mHeader.mMaster; }
|
const std::vector<ESM::MasterData>& getGameFiles() const { return mHeader.mMaster; }
|
||||||
|
|
||||||
inline int getRecordCount() const { return mHeader.mData.records; }
|
inline int getRecordCount() const { return mHeader.mData.records; }
|
||||||
inline const std::string getAuthor() const { return mHeader.mAuthor; }
|
inline const std::string getAuthor() const { return mHeader.mAuthor; }
|
||||||
inline int getFormat() const { return 0; }; // prob. not relevant for ESM4
|
inline int getFormat() const { return 0; } // prob. not relevant for ESM4
|
||||||
inline const std::string getDesc() const { return mHeader.mDesc; }
|
inline const std::string getDesc() const { return mHeader.mDesc; }
|
||||||
|
|
||||||
inline std::filesystem::path getFileName() const { return mCtx.filename; }; // not used
|
inline std::filesystem::path getFileName() const { return mCtx.filename; } // not used
|
||||||
|
|
||||||
inline bool hasMoreRecs() const { return (mFileSize - mCtx.fileRead) > 0; }
|
inline bool hasMoreRecs() const { return (mFileSize - mCtx.fileRead) > 0; }
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace LuaUi
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& name() const noexcept { return mName; };
|
const std::string& name() const noexcept { return mName; }
|
||||||
const osg::Vec2f size()
|
const osg::Vec2f size()
|
||||||
{
|
{
|
||||||
MyGUI::ILayer* p = refresh();
|
MyGUI::ILayer* p = refresh();
|
||||||
|
|
|
@ -96,7 +96,7 @@ namespace LuaUi
|
||||||
|
|
||||||
virtual void updateTemplate();
|
virtual void updateTemplate();
|
||||||
virtual void updateProperties();
|
virtual void updateProperties();
|
||||||
virtual void updateChildren(){};
|
virtual void updateChildren() {}
|
||||||
|
|
||||||
lua_State* lua() const { return mLua; }
|
lua_State* lua() const { return mLua; }
|
||||||
|
|
||||||
|
|
2
components/sceneutil/clearcolor.hpp
Executable file → Normal file
2
components/sceneutil/clearcolor.hpp
Executable file → Normal file
|
@ -28,7 +28,7 @@ namespace SceneUtil
|
||||||
|
|
||||||
META_StateAttribute(fx, ClearColor, static_cast<osg::StateAttribute::Type>(100))
|
META_StateAttribute(fx, ClearColor, static_cast<osg::StateAttribute::Type>(100))
|
||||||
|
|
||||||
int compare(const StateAttribute& sa) const override
|
int compare(const StateAttribute& sa) const override
|
||||||
{
|
{
|
||||||
COMPARE_StateAttribute_Types(ClearColor, sa);
|
COMPARE_StateAttribute_Types(ClearColor, sa);
|
||||||
|
|
||||||
|
|
|
@ -318,10 +318,7 @@ namespace SceneUtil
|
||||||
|
|
||||||
META_StateAttribute(SceneUtil, DisableLight, osg::StateAttribute::LIGHT)
|
META_StateAttribute(SceneUtil, DisableLight, osg::StateAttribute::LIGHT)
|
||||||
|
|
||||||
unsigned int getMember() const override
|
unsigned int getMember() const override { return mIndex; }
|
||||||
{
|
|
||||||
return mIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool getModeUsage(ModeUsage& usage) const override
|
bool getModeUsage(ModeUsage& usage) const override
|
||||||
{
|
{
|
||||||
|
@ -387,7 +384,7 @@ namespace SceneUtil
|
||||||
|
|
||||||
META_StateAttribute(SceneUtil, FFPLightStateAttribute, osg::StateAttribute::LIGHT)
|
META_StateAttribute(SceneUtil, FFPLightStateAttribute, osg::StateAttribute::LIGHT)
|
||||||
|
|
||||||
void apply(osg::State& state) const override
|
void apply(osg::State& state) const override
|
||||||
{
|
{
|
||||||
if (mLights.empty())
|
if (mLights.empty())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -178,7 +178,7 @@ namespace SceneUtil
|
||||||
|
|
||||||
META_StateAttribute(SceneUtil, UBOManager, osg::StateAttribute::LIGHT)
|
META_StateAttribute(SceneUtil, UBOManager, osg::StateAttribute::LIGHT)
|
||||||
|
|
||||||
void apply(osg::State& state) const override;
|
void apply(osg::State& state) const override;
|
||||||
|
|
||||||
auto& getLightBuffer(size_t frameNum) { return mLightBuffers[frameNum % 2]; }
|
auto& getLightBuffer(size_t frameNum) { return mLightBuffers[frameNum % 2]; }
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace SceneUtil {
|
||||||
|
|
||||||
MWShadowTechnique(const MWShadowTechnique& vdsm, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
|
MWShadowTechnique(const MWShadowTechnique& vdsm, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
|
||||||
|
|
||||||
META_Object(SceneUtil, MWShadowTechnique);
|
META_Object(SceneUtil, MWShadowTechnique)
|
||||||
|
|
||||||
/** initialize the ShadowedScene and local cached data structures.*/
|
/** initialize the ShadowedScene and local cached data structures.*/
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace SceneUtil
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// @brief Handles the animation for osgAnimation formats
|
/// @brief Handles the animation for osgAnimation formats
|
||||||
OsgAnimationController(){};
|
OsgAnimationController() = default;
|
||||||
|
|
||||||
OsgAnimationController(const OsgAnimationController& copy, const osg::CopyOp& copyop);
|
OsgAnimationController(const OsgAnimationController& copy, const osg::CopyOp& copyop);
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace SceneUtil
|
||||||
|
|
||||||
OsgaRigGeometry(const OsgaRigGeometry& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
|
OsgaRigGeometry(const OsgaRigGeometry& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
|
||||||
|
|
||||||
META_Object(SceneUtil, OsgaRigGeometry);
|
META_Object(SceneUtil, OsgaRigGeometry)
|
||||||
|
|
||||||
void computeMatrixFromRootSkeleton(osg::MatrixList mtxList);
|
void computeMatrixFromRootSkeleton(osg::MatrixList mtxList);
|
||||||
};
|
};
|
||||||
|
@ -36,7 +36,7 @@ namespace SceneUtil
|
||||||
|
|
||||||
RigGeometryHolder(const osgAnimation::RigGeometry& copy, const osg::CopyOp& copyop);
|
RigGeometryHolder(const osgAnimation::RigGeometry& copy, const osg::CopyOp& copyop);
|
||||||
|
|
||||||
META_Object(SceneUtil, RigGeometryHolder);
|
META_Object(SceneUtil, RigGeometryHolder)
|
||||||
|
|
||||||
void setSourceRigGeometry(osg::ref_ptr<OsgaRigGeometry> sourceRigGeometry);
|
void setSourceRigGeometry(osg::ref_ptr<OsgaRigGeometry> sourceRigGeometry);
|
||||||
osg::ref_ptr<OsgaRigGeometry> getSourceRigGeometry() const;
|
osg::ref_ptr<OsgaRigGeometry> getSourceRigGeometry() const;
|
||||||
|
|
|
@ -62,12 +62,12 @@ namespace SceneUtil
|
||||||
osg::Camera* getCamera(osgUtil::CullVisitor* cv);
|
osg::Camera* getCamera(osgUtil::CullVisitor* cv);
|
||||||
|
|
||||||
/// Set default settings - optionally override in derived classes
|
/// Set default settings - optionally override in derived classes
|
||||||
virtual void setDefaults(osg::Camera* camera){};
|
virtual void setDefaults(osg::Camera* camera) {}
|
||||||
|
|
||||||
/// Apply state - to override in derived classes
|
/// Apply state - to override in derived classes
|
||||||
/// @note Due to the view mapping approach you *have* to apply all camera settings, even if they have not
|
/// @note Due to the view mapping approach you *have* to apply all camera settings, even if they have not
|
||||||
/// changed since the last frame.
|
/// changed since the last frame.
|
||||||
virtual void apply(osg::Camera* camera){};
|
virtual void apply(osg::Camera* camera) {}
|
||||||
|
|
||||||
/// Apply any state specific to the Left view. Default implementation does nothing. Called after apply()
|
/// Apply any state specific to the Left view. Default implementation does nothing. Called after apply()
|
||||||
virtual void applyLeft(osg::Camera* camera) {}
|
virtual void applyLeft(osg::Camera* camera) {}
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace Shader
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
META_StateAttribute(Shader, RemovedAlphaFunc, ALPHAFUNC);
|
META_StateAttribute(Shader, RemovedAlphaFunc, ALPHAFUNC)
|
||||||
|
|
||||||
void apply(osg::State& state) const override {}
|
void apply(osg::State& state) const override {}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace Stereo
|
||||||
|
|
||||||
int width() const { return mWidth; }
|
int width() const { return mWidth; }
|
||||||
int height() const { return mHeight; }
|
int height() const { return mHeight; }
|
||||||
int samples() const { return mSamples; };
|
int samples() const { return mSamples; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
osg::Texture2D* createTexture(GLint sourceFormat, GLint sourceType, GLint internalFormat);
|
osg::Texture2D* createTexture(GLint sourceFormat, GLint sourceType, GLint internalFormat);
|
||||||
|
@ -122,8 +122,8 @@ namespace Stereo
|
||||||
|
|
||||||
void dirty() { mDirtyLayers = true; }
|
void dirty() { mDirtyLayers = true; }
|
||||||
|
|
||||||
const osg::FrameBufferObject* resolveFbo() const { return mResolveFbo; };
|
const osg::FrameBufferObject* resolveFbo() const { return mResolveFbo; }
|
||||||
const osg::FrameBufferObject* msaaFbo() const { return mMsaaFbo; };
|
const osg::FrameBufferObject* msaaFbo() const { return mMsaaFbo; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupLayers();
|
void setupLayers();
|
||||||
|
|
|
@ -74,7 +74,7 @@ namespace Stereo
|
||||||
//! Sets up any definitions necessary for stereo rendering
|
//! Sets up any definitions necessary for stereo rendering
|
||||||
void shaderStereoDefines(Shader::ShaderManager::DefineMap& defines) const;
|
void shaderStereoDefines(Shader::ShaderManager::DefineMap& defines) const;
|
||||||
|
|
||||||
const std::shared_ptr<MultiviewFramebuffer>& multiviewFramebuffer() { return mMultiviewFramebuffer; };
|
const std::shared_ptr<MultiviewFramebuffer>& multiviewFramebuffer() { return mMultiviewFramebuffer; }
|
||||||
|
|
||||||
//! Sets rendering resolution of each eye to eyeResolution.
|
//! Sets rendering resolution of each eye to eyeResolution.
|
||||||
//! Once set, there will no longer be any connection between rendering resolution and screen/window resolution.
|
//! Once set, there will no longer be any connection between rendering resolution and screen/window resolution.
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace Terrain
|
||||||
_children.reserve(4);
|
_children.reserve(4);
|
||||||
_children.push_back(child);
|
_children.push_back(child);
|
||||||
child->addParent(this);
|
child->addParent(this);
|
||||||
};
|
}
|
||||||
|
|
||||||
float distance(const osg::Vec3f& v) const;
|
float distance(const osg::Vec3f& v) const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue