Mario Editor: initialize empty map with correct column size
This commit is contained in:
+3
-4
@@ -7,7 +7,6 @@
|
||||
#include "objectids.hpp"
|
||||
#include "global_vars.hpp"
|
||||
|
||||
// TODO move to one function
|
||||
void loadMap( std::shared_ptr< SDLPP::Scene > &scene,
|
||||
std::shared_ptr< SDLPP::RenderObject > mario,
|
||||
const std::string &file,
|
||||
@@ -22,7 +21,7 @@ void loadMap( std::shared_ptr< SDLPP::Scene > &scene,
|
||||
std::shared_ptr< SDLPP::RenderObject > &mario,
|
||||
const std::string &file,
|
||||
std::shared_ptr< SDLPP::Renderer > &renderer,
|
||||
std::vector< mapColumnType > &objects, bool editor ) {
|
||||
std::vector< mapColumnType > &objects, bool editor, size_t editor_width ) {
|
||||
std::ifstream map_file;
|
||||
map_file.open( file, std::ios::in | std::ios::binary );
|
||||
uint16_t cols;
|
||||
@@ -101,8 +100,8 @@ void loadMap( std::shared_ptr< SDLPP::Scene > &scene,
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( editor && objects.size() < 18 ) {
|
||||
objects.resize( 18 );
|
||||
if ( editor && objects.size() < editor_width ) {
|
||||
objects.resize( editor_width );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user