97{
98 scale = data["scale"];
99
100 if (isDefault && data["isDefault"])
101 {
102 return;
103 }
104
105 isDefault = data["isDefault"];
106 interpolated = data["interpolated"];
107 npScale = data["npsc"];
108 inv = data["inv"];
109 autoTiled = data["autoTiled"];
110 numTiles = data["numTiles"];
111 posi[0] = data["posiX"];
112 posi[1] = data["posiY"];
113 rota = data["rota"];
114
115 if (isDefault)
116 {
117 delete heightmap;
118 heightmap =
new Heightmap(GetExecutableDir() + PATH_SEPARATOR
"Data" PATH_SEPARATOR
"heightmaps" PATH_SEPARATOR
"flat.png");
119 }
120
121 else
122 {
123 std::string
hash = data[
"heightmap"];
124
125 if (!ProjectManager::Get()->AssetExists(hash))
126 {
127 ShowMessageBox("Failed to Load Heightmap : " + hash, "Error");
128 isDefault = true;
129 }
130
131 else
132 {
133 delete heightmap;
134 heightmap =
new Heightmap(ProjectManager::Get()->GetResourcePath() + PATH_SEPARATOR + ProjectManager::Get()->GetAsset(hash));
135 Log("Loaded Cached Heightmap : " + hash);
136 }
137 }
138}
std::size_t hash(const BasicJsonType &j)
hash a JSON value