1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-25 22:18:30 +02:00

Remove zeroed arrays from tower functions in M&P

This removes the arrays of zeroes that still take up space in the
binary. It doesn't seem like the compiler optimizes or compresses these
zeroes anyway, so just remove them instead, and make
load()/loadminitower()/loadminitower2() no-op functions. The
minitower/contents arrays are already initialized zeroed-out, anyway, so
there's no need to keep these other arrays around.

This saves exactly 72 kilobytes of memory and binary size.
This commit is contained in:
Misa 2020-08-02 21:15:58 -07:00 committed by Ethan Lee
parent f07a8d2143
commit 8af37bc693

View File

@ -197,11 +197,9 @@ void towerclass::loadminitower1()
12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,
12,12,12,12,12,12,12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,
};
#else
static const short tmap[100*40] = {0};
#endif
SDL_memcpy(minitower, tmap, sizeof(minitower));
#endif
}
void towerclass::loadminitower2()
@ -309,11 +307,9 @@ void towerclass::loadminitower2()
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,21,28,28,0,0,0,0,0,0,0,0,0,20,12,12,12,12,12,
};
#else
static const short tmap[100*40] = {0};
#endif
SDL_memcpy(minitower, tmap, sizeof(minitower));
#endif
}
@ -1151,9 +1147,7 @@ void towerclass::loadmap()
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
};
#else
static const short tmap[700*40] = {0};
#endif
SDL_memcpy(contents, tmap, sizeof(contents));
#endif
}