Initial image implementation
This commit is contained in:
@@ -167,7 +167,7 @@ void json_extract(const json& j, const string& key, string& out)
|
||||
}
|
||||
}
|
||||
|
||||
void json_extract(const nlohmann::json& j, const string& key, int& out)
|
||||
void json_extract(const json& j, const string& key, int& out)
|
||||
{
|
||||
if (j.contains(key) && j[key].is_number_integer())
|
||||
{
|
||||
@@ -175,7 +175,7 @@ void json_extract(const nlohmann::json& j, const string& key, int& out)
|
||||
}
|
||||
}
|
||||
|
||||
void json_extract(const nlohmann::json& j, const string& key, bool& out)
|
||||
void json_extract(const json& j, const string& key, bool& out)
|
||||
{
|
||||
if (j.contains(key) && j[key].is_boolean())
|
||||
{
|
||||
@@ -238,10 +238,24 @@ void json_extract(const json& j, const string& key, SDL_Color& out)
|
||||
}
|
||||
}
|
||||
|
||||
void json_extract(const nlohmann::json& j, const string& key, Uint8& out)
|
||||
void json_extract(const json& j, const string& key, Uint8& out)
|
||||
{
|
||||
if (j.contains(key) && j[key].is_number_unsigned())
|
||||
{
|
||||
out = j[key];
|
||||
}
|
||||
}
|
||||
|
||||
void json_extract(const json& j, const string& key, ImageResize& out)
|
||||
{
|
||||
if (j.contains(key))
|
||||
{
|
||||
try
|
||||
{
|
||||
out = j[key].get<ImageResize>();
|
||||
}
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user