Mario Editor: add save/load functionality
This commit is contained in:
+5
-1
@@ -96,6 +96,10 @@ MapObject parseBlock(std::ifstream &map_file) {
|
||||
modifier_id, modifier_data);
|
||||
}
|
||||
|
||||
void loadEmptyMap( std::vector<mapColumnType> &objects, size_t editor_width) {
|
||||
objects.resize(editor_width);
|
||||
}
|
||||
|
||||
// editor loader
|
||||
// TODO catch exception in calling functions
|
||||
void loadMap(std::shared_ptr<SDLPP::Scene> &scene,
|
||||
@@ -104,7 +108,7 @@ void loadMap(std::shared_ptr<SDLPP::Scene> &scene,
|
||||
bool editor, size_t editor_width) {
|
||||
if(!FSLib::exists(file)) {
|
||||
// create empty array large enough for initial editor window
|
||||
objects.resize(editor_width);
|
||||
loadEmptyMap(objects, editor_width);
|
||||
return;
|
||||
}
|
||||
auto renderer = scene->getRendererShared();
|
||||
|
||||
Reference in New Issue
Block a user