#include <Config.h>
|
| void | ReadConfigElement (std::string name, std::string type, Json object) |
| |
| void | ReadString (std::string name, std::string object) |
| |
| void | ReadInt (std::string name, int object) |
| |
| void | ReadFloat (std::string name, float object) |
| |
| void | ReadBool (std::string name, bool object) |
| |
| void | ReadVector2 (std::string name, D3DXVECTOR2 object) |
| |
| void | ReadColor (std::string name, D3DXVECTOR4 object) |
| |
Definition at line 13 of file Config.h.
◆ Config()
| IncrementalEngine::Config::Config |
( |
| ) |
|
Definition at line 6 of file Config.cpp.
10 (std::istreambuf_iterator<char>(t)),
11 std::istreambuf_iterator<char>()
14 std::string error =
"";
15 auto resources = Json::parse(json, error);
19 StringAsWCHAR_ptr(error, LPCWSTR Error);
20 MessageBox(NULL, Error, L
"Config Error", MB_OK);
23 auto items = resources.object_items();
26 MessageBox(NULL, L
"Resources load failed. Check file structure.", L
"Config Error", MB_OK);
30 for (
auto const& item : items)
32 auto obj = item.second.object_items().begin();
◆ ReadBool()
| void IncrementalEngine::Config::ReadBool |
( |
std::string |
name, |
|
|
bool |
object |
|
) |
| |
|
private |
Definition at line 105 of file Config.cpp.
107 if (name ==
"Fullscreen")
110 if (name ==
"VsyncEnabled")
113 if (name ==
"ShowCursor")
◆ ReadColor()
| void IncrementalEngine::Config::ReadColor |
( |
std::string |
name, |
|
|
D3DXVECTOR4 |
object |
|
) |
| |
|
private |
Definition at line 123 of file Config.cpp.
125 if (name ==
"BackgroundColor")
◆ ReadConfigElement()
| void IncrementalEngine::Config::ReadConfigElement |
( |
std::string |
name, |
|
|
std::string |
type, |
|
|
Json |
object |
|
) |
| |
|
private |
Definition at line 39 of file Config.cpp.
48 ReadInt(name,
object.int_value());
61 if (type ==
"vector2")
63 auto items =
object.object_items();
64 D3DXVECTOR2 vector = D3DXVECTOR2(
65 (items.find(
"x")->second).number_value(),
66 (items.find(
"y")->second).number_value()
73 auto items =
object.object_items();
74 D3DXVECTOR4 vector = D3DXVECTOR4(
75 (items.find(
"r")->second).number_value(),
76 (items.find(
"g")->second).number_value(),
77 (items.find(
"b")->second).number_value(),
78 (items.find(
"a")->second).number_value()
◆ ReadFloat()
| void IncrementalEngine::Config::ReadFloat |
( |
std::string |
name, |
|
|
float |
object |
|
) |
| |
|
private |
Definition at line 96 of file Config.cpp.
98 if (name ==
"ScreenDepth")
101 if (name ==
"ScreenNear")
◆ ReadInt()
| void IncrementalEngine::Config::ReadInt |
( |
std::string |
name, |
|
|
int |
object |
|
) |
| |
|
private |
◆ ReadString()
| void IncrementalEngine::Config::ReadString |
( |
std::string |
name, |
|
|
std::string |
object |
|
) |
| |
|
private |
Definition at line 84 of file Config.cpp.
86 if (name ==
"ApplicationName")
◆ ReadVector2()
| void IncrementalEngine::Config::ReadVector2 |
( |
std::string |
name, |
|
|
D3DXVECTOR2 |
object |
|
) |
| |
|
private |
Definition at line 117 of file Config.cpp.
119 if (name ==
"WindowSize")
◆ ApplicationName
| std::string IncrementalEngine::Config::ApplicationName |
◆ BackgroundColor
| D3DXVECTOR4 IncrementalEngine::Config::BackgroundColor |
◆ Fullscreen
| bool IncrementalEngine::Config::Fullscreen |
◆ ScreenDepth
| float IncrementalEngine::Config::ScreenDepth |
◆ ScreenNear
| float IncrementalEngine::Config::ScreenNear |
◆ ShowCursor
| bool IncrementalEngine::Config::ShowCursor |
◆ VsyncEnabled
| bool IncrementalEngine::Config::VsyncEnabled |
◆ WindowSize
| D3DXVECTOR2 IncrementalEngine::Config::WindowSize |