diff --git a/WickedEngine/MainComponent.h b/WickedEngine/MainComponent.h index d36a48b5a..dd979363f 100644 --- a/WickedEngine/MainComponent.h +++ b/WickedEngine/MainComponent.h @@ -1,7 +1,6 @@ #pragma once #include "CommonInclude.h" #include "wiResourceManager.h" -#include "wiCVars.h" #include "wiColor.h" #include "wiFadeManager.h" #include "wiWindowRegistration.h" @@ -32,7 +31,6 @@ public: void activateComponent(RenderableComponent* component, int fadeFrames = 0, const wiColor& fadeColor = wiColor(0,0,0,255)); RenderableComponent* getActiveComponent(){ return activeComponent; } - wiCVars Props; wiResourceManager Content; void setFrameSkip(bool value){ frameskip = value; } diff --git a/WickedEngine/RenderableComponent.h b/WickedEngine/RenderableComponent.h index 8a1e7ce3f..8f6bd8638 100644 --- a/WickedEngine/RenderableComponent.h +++ b/WickedEngine/RenderableComponent.h @@ -3,7 +3,6 @@ #include "wiRenderTarget.h" #include "wiDepthTarget.h" #include "wiResourceManager.h" -#include "wiCVars.h" class RenderableComponent { @@ -13,7 +12,6 @@ protected: // create resolution dependant resources virtual void ResizeBuffers() {} public: - wiCVars Params; wiResourceManager Content; std::function onStart; diff --git a/WickedEngine/WickedEngine.h b/WickedEngine/WickedEngine.h index 5c8cf67c7..dd22425ec 100644 --- a/WickedEngine/WickedEngine.h +++ b/WickedEngine/WickedEngine.h @@ -35,7 +35,6 @@ #include "wiTimer.h" #include "wiHelper.h" #include "wiInputManager.h" -#include "wiCVars.h" #include "wiTextureHelper.h" #include "wiRandom.h" #include "wiColor.h" diff --git a/WickedEngine/WickedEngine_SHARED.vcxitems b/WickedEngine/WickedEngine_SHARED.vcxitems index de889d33c..e6c8c9836 100644 --- a/WickedEngine/WickedEngine_SHARED.vcxitems +++ b/WickedEngine/WickedEngine_SHARED.vcxitems @@ -314,7 +314,6 @@ - @@ -664,7 +663,6 @@ - diff --git a/WickedEngine/WickedEngine_SHARED.vcxitems.filters b/WickedEngine/WickedEngine_SHARED.vcxitems.filters index a332849dd..9ce0200e3 100644 --- a/WickedEngine/WickedEngine_SHARED.vcxitems.filters +++ b/WickedEngine/WickedEngine_SHARED.vcxitems.filters @@ -963,9 +963,6 @@ ENGINE\Physics - - ENGINE\Helpers - ENGINE\Graphics @@ -1838,9 +1835,6 @@ ENGINE\Physics - - ENGINE\Helpers - ENGINE\Graphics diff --git a/WickedEngine/wiCVars.cpp b/WickedEngine/wiCVars.cpp deleted file mode 100644 index 13da501b6..000000000 --- a/WickedEngine/wiCVars.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include "wiCVars.h" - -using namespace std; - -wiCVars* wiCVars::globalVars = nullptr; - -wiCVars::wiCVars() -{ - wiThreadSafeManager(); -} -wiCVars::~wiCVars() -{ - CleanUp(); -} -wiCVars* wiCVars::GetGlobal() -{ - if (globalVars == nullptr) - { - LOCK_STATIC(); - if (globalVars == nullptr) - globalVars = new wiCVars(); - UNLOCK_STATIC(); - } - return globalVars; -} - - -const wiCVars::Variable wiCVars::get(const std::string& name) -{ - container::iterator it = variables.find(name); - if(it!=variables.end()) - return it->second; - else return Variable::Invalid(); -} -bool wiCVars::set(const std::string& name, const std::string& value) -{ - if (!get(name).isValid()) - return false; - - LOCK(); - container::iterator it = variables.find(name); - if (it != variables.end()) - variables[name].data = value; - UNLOCK(); - - return true; -} -bool wiCVars::add(const std::string& name, const std::string& value, Data_Type newType) -{ - if(get(name).isValid()) - return false; - LOCK(); - variables.insert< pair >( pair(name,Variable(value,newType)) ); - UNLOCK(); - return true; -} -bool wiCVars::del(const std::string& name) -{ - if (!get(name).isValid()) - return false; - LOCK(); - variables.erase(name); - UNLOCK(); - return true; -} -bool wiCVars::CleanUp() -{ - LOCK(); - variables.clear(); - UNLOCK(); - return true; -} diff --git a/WickedEngine/wiCVars.h b/WickedEngine/wiCVars.h deleted file mode 100644 index 9975a5038..000000000 --- a/WickedEngine/wiCVars.h +++ /dev/null @@ -1,96 +0,0 @@ -#pragma once -#include "CommonInclude.h" -#include "wiHelper.h" -#include "wiThreadSafeManager.h" - -#include -#include - -class wiCVars : public wiThreadSafeManager -{ -public: - enum Data_Type{ - EMPTY, - TEXT, - INTEGER, - FLOAT, - BOOLEAN, - CVAR_DATATYPE_COUNT - }; -private: - struct Variable{ - std::string data; - Data_Type type; - Variable(const std::string& d = "", Data_Type t = TEXT):data(d),type(t){} - - bool isValid() const - { - return type != EMPTY && !data.empty(); - } - std::string get() const - { - return data; - } - int getInt() const - { - return atoi(data.c_str()); - } - double getFloat() const - { - return (double)atof(data.c_str()); - } - bool getBool() const - { - if (atoi(data.c_str()) != 0) - return true; - if (!wiHelper::toUpper(data).compare("TRUE")) - return true; - return false; - } - bool equals(const Variable& other) - { - if (type != other.type) - { - return false; - } - switch (type) - { - case wiCVars::TEXT: - return !data.compare(other.data); - break; - case wiCVars::INTEGER: - return getInt() == other.getInt(); - break; - case wiCVars::FLOAT: - return abs(getFloat() - other.getFloat()) < DBL_EPSILON; - break; - case wiCVars::BOOLEAN: - return getBool() == other.getBool(); - break; - default: - break; - } - - return false; - } - static Variable Invalid() - { - return Variable("", EMPTY); - } - }; - typedef std::map container; - container variables; - - static wiCVars* globalVars; -public: - wiCVars(); - ~wiCVars(); - static wiCVars* GetGlobal(); - - const Variable get(const std::string& name); - bool set(const std::string& name, const std::string& value); - bool add(const std::string& name, const std::string& value, Data_Type newType = Data_Type::TEXT); - bool del(const std::string& name); - bool CleanUp(); -}; -