mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03: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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user