Skip loading authorship info in render

This commit is contained in:
Tamás Bálint Misius 2023-01-22 09:17:13 +01:00
parent a438584871
commit 75191e7ac5
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
3 changed files with 6 additions and 4 deletions

View File

@ -51,7 +51,7 @@ int main(int argc, char *argv[])
GameSave * gameSave = NULL; GameSave * gameSave = NULL;
try try
{ {
gameSave = new GameSave(fileData); gameSave = new GameSave(fileData, false);
} }
catch (ParseException &e) catch (ParseException &e)
{ {

View File

@ -27,8 +27,9 @@ GameSave::GameSave(int width, int height)
setSize(width, height); setSize(width, height);
} }
GameSave::GameSave(const std::vector<char> &data) GameSave::GameSave(const std::vector<char> &data, bool newWantAuthors)
{ {
wantAuthors = newWantAuthors;
blockWidth = 0; blockWidth = 0;
blockHeight = 0; blockHeight = 0;
@ -688,7 +689,7 @@ void GameSave::readOPS(const std::vector<char> &data)
fprintf(stderr, "Wrong type for %s\n", bson_iterator_key(&iter)); fprintf(stderr, "Wrong type for %s\n", bson_iterator_key(&iter));
} }
} }
else if (!strcmp(bson_iterator_key(&iter), "authors")) else if (wantAuthors && !strcmp(bson_iterator_key(&iter), "authors"))
{ {
if (bson_iterator_type(&iter) == BSON_OBJECT) if (bson_iterator_type(&iter) == BSON_OBJECT)
{ {

View File

@ -115,6 +115,7 @@ public:
int airMode = 0; int airMode = 0;
float ambientAirTemp = R_TEMP + 273.15f; float ambientAirTemp = R_TEMP + 273.15f;
int edgeMode = 0; int edgeMode = 0;
bool wantAuthors = true;
//Signs //Signs
std::vector<sign> signs; std::vector<sign> signs;
@ -130,7 +131,7 @@ public:
int pmapbits = 8; // default to 8 bits for older saves int pmapbits = 8; // default to 8 bits for older saves
GameSave(int width, int height); GameSave(int width, int height);
GameSave(const std::vector<char> &data); GameSave(const std::vector<char> &data, bool newWantAuthors = true);
void setSize(int width, int height); void setSize(int width, int height);
// return value is [ fakeFromNewerVersion, gameData ] // return value is [ fakeFromNewerVersion, gameData ]
std::pair<bool, std::vector<char>> Serialise() const; std::pair<bool, std::vector<char>> Serialise() const;