Added generic button

This commit is contained in:
2022-06-21 14:52:36 +02:00
parent a3a1e900b5
commit 2402567330
8 changed files with 100 additions and 4 deletions
+6 -4
View File
@@ -6,6 +6,7 @@
#include "blocks.hpp"
#include "objectids.hpp"
#include "global_vars.hpp"
#include "filesystem.hpp"
#define TERRAIN_TYPE_HAS_ADDITIONAL 0x8
#define WIDE_TERRAIN_HAS_ADDITIONAL 0x8000
@@ -101,13 +102,14 @@ void loadMap(std::shared_ptr<SDLPP::Scene> &scene,
std::shared_ptr<SDLPP::RenderObject> &mario,
const std::string &file, std::vector<mapColumnType> &objects,
bool editor, size_t editor_width) {
auto renderer = scene->getRendererShared();
std::ifstream map_file;
map_file.open(file, std::ios::in | std::ios::binary);
if(!map_file.is_open()) {
if(!FSLib::exists(file)) {
// create empty array large enough for initial editor window
objects.resize(editor_width);
return;
}
auto renderer = scene->getRendererShared();
std::ifstream map_file;
map_file.open(file, std::ios::in | std::ios::binary);
uint16_t version;
map_file.read((char *)&version, sizeof(uint16_t) / sizeof(char));
switch(version) {