~james-gangur/sqee/trunk

« back to all changes in this revision

Viewing changes to include/sqee/app/Settings.hpp

  • Committer: james.gangur at gmail
  • Date: 2015-10-13 02:55:15 UTC
  • Revision ID: james.gangur@gmail.com-20151013025515-uj2rnpflxeyt6csf
Refactored Texture objects:
 - format, iFormat and preset are now passed to the ctor
 - allocate_storage is now responsible for setting up the texture
 - added a delete_object method, for saving video memory
 - allocate_storage now takes a mipmaps argument
 - buffer_memory now takes a data type argument
 - removed the mutable textures entirely
Refactored sq::Settings:
 - Settings are now stored in Boxed_Value objects, making supporting new types easier
 - Added Boxed_Value versions of the mod/get functions for use with chaiscript
All texture members are now stored as value types, rather than unique_ptrs
Refactored chaiscript files. More consistent and improved compile times.
Moved RPG's SkyBox, Ambient and Skylight objects into their own files
Tidied up most of the wcoe objects regarding direct state access
For rpg Object derived classes, prefer using value members over unique_ptrs
Fixed reflections, added new Reflects object to Renderer

Particles still need to be fixed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#pragma once
2
2
#include <sqee/forward.hpp>
3
3
#include <unordered_map>
4
 
#include <unordered_set>
 
4
 
 
5
namespace chaiscript { class Boxed_Value; }
5
6
 
6
7
namespace sq {
7
8
 
8
9
/// The SQEE Settings manager
9
10
class Settings final : NonCopyable {
10
11
public:
11
 
    template <class T> void add(const string& _key, const T& _val);
12
 
    template <class T> void mod(const string& _key, const T& _val);
13
 
    template <class T> bool check(const string& _key) const;
14
 
    template <class T> T get(const string& _key) const;
15
 
    void clear_changed();
 
12
    Settings(); ~Settings();
 
13
 
 
14
    template<class T> void add(const string& _key, T _val);
 
15
    template<class T> void mod(const string& _key, T _val);
 
16
    template<class T> T get(const string& _key) const;
 
17
 
 
18
    void cs_mod(const string& _key, chai::Boxed_Value _val);
 
19
    chai::Boxed_Value cs_get(const string& _key) const;
16
20
 
17
21
private:
18
 
    std::unordered_map<string, int> intMap;
19
 
    std::unordered_map<string, bool> boolMap;
20
 
    std::unordered_map<string, float> floatMap;
21
 
    std::unordered_map<string, string> stringMap;
22
 
    std::unordered_set<string> intChanges;
23
 
    std::unordered_set<string> boolChanges;
24
 
    std::unordered_set<string> floatChanges;
25
 
    std::unordered_set<string> stringChanges;
 
22
    unique_ptr<std::unordered_map<string, chai::Boxed_Value>> settingMap;
26
23
};
27
24
 
28
25
}