| 188 | } |
| 189 | |
| 190 | void LocationZoomer::LoadFromSaveData(const ofxJSONElement& saveData) |
| 191 | { |
| 192 | mLocations.clear(); |
| 193 | for (int i = 0; i < saveData.size(); ++i) |
| 194 | { |
| 195 | try |
| 196 | { |
| 197 | int shortcut = saveData[i]["shortcut"].asInt(); |
| 198 | mLocations[shortcut].mZoomLevel = saveData[i]["zoomlevel"].asDouble(); |
| 199 | mLocations[shortcut].mOffset.set(saveData[i]["offset_x"].asDouble(), |
| 200 | saveData[i]["offset_y"].asDouble()); |
| 201 | } |
| 202 | catch (Json::LogicError& e) |
| 203 | { |
| 204 | TheSynth->LogEvent(__PRETTY_FUNCTION__ + std::string(" json error: ") + e.what(), kLogEventType_Error); |
| 205 | } |
| 206 | } |
| 207 | MoveToLocation(-1); |
| 208 | mCurrentProgress = .999f; |
| 209 | } |
no test coverage detected