1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 18:19:43 +01: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; const char* zip_normal;
char dir[MAX_PATH]; 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( SDL_strlcpy(
filename, filename,
&path[7], &path[7],