From ae399543766733c5161c18553b87b66226c503ac Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 15 Dec 2018 01:37:19 +0000 Subject: [PATCH] Initialize rottile values to -1 with a loop like this instead, because doing it the C++ way increases the binary size by like 120KB git-svn-id: https://svn.eduke32.com/eduke32@7255 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/include/build.h | 2 +- source/build/src/tiles.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/build/include/build.h b/source/build/include/build.h index 87f0e451d..2cafc5c84 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -832,7 +832,7 @@ typedef struct { uint8_t sf; // anim. speed and flags } picanm_t; EXTERN picanm_t picanm[MAXTILES]; -typedef struct { int16_t newtile = -1; int16_t owner = -1; } rottile_t; +typedef struct { int16_t newtile; int16_t owner; } rottile_t; EXTERN rottile_t rottile[MAXTILES]; EXTERN intptr_t waloff[MAXTILES]; // stores pointers to cache -- SA diff --git a/source/build/src/tiles.cpp b/source/build/src/tiles.cpp index 915516177..e7af781ba 100644 --- a/source/build/src/tiles.cpp +++ b/source/build/src/tiles.cpp @@ -555,9 +555,12 @@ int32_t artLoadFiles(const char *filename, int32_t askedsize) Bmemset(&tilesiz[0], 0, sizeof(vec2s_t) * MAXTILES); Bmemset(picanm, 0, sizeof(picanm)); + for (auto &rot : rottile) + rot = { -1, -1 }; + // artsize = 0; - for (bssize_t tilefilei=0; tilefilei