mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 10:09: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:
parent
57df734b1c
commit
9997b28757
1 changed files with 8 additions and 0 deletions
|
@ -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],
|
||||
|
|
Loading…
Reference in a new issue