1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-29 07:58:30 +02:00

Add comment to magic numbers in FILESYSTEM_mountassets()

Now you know why there's a 7, a 14, and a 1 in the first SDL_strlcpy()
of the function.
This commit is contained in:
Misa 2021-02-26 22:38:26 -08:00 committed by Ethan Lee
parent 57df734b1c
commit 9997b28757

View File

@ -208,6 +208,14 @@ void FILESYSTEM_mountassets(const char* path)
const char* zip_normal;
char dir[MAX_PATH];
/* path is going to look like "levels/LEVELNAME.vvvvvv".
* We want LEVELNAME, which entails starting from index 7
* (which is how long "levels/" is)
* and then grabbing path_size-14 characters
* (14 chars because "levels/" and ".vvvvvv" are both 7 chars).
* We also add 1 when calculating the amount of bytes to grab
* to account for the null terminator.
*/
SDL_strlcpy(
filename,
&path[7],