Skip to content

Commit

Permalink
added NONE to reserved for future option of adding encryption formats
Browse files Browse the repository at this point in the history
  • Loading branch information
kyy13 committed Mar 22, 2022
1 parent 2201648 commit 0c1d301
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ All character types are stored in ASCII where the smallest byte corresponds to t
| `0...3` | *signature*<br>`PODX` |
| `4...7` | *endianness*<br>`LITE` little endian<br>`BIGE` big endian |
| `8...11` | *checksum*<br>`NONE` no checksum<br>`AD32` adler32 <br>`CR32` crc32 |
| `12...15` | *reserved* |
| `12...15` | *reserved*<br>`NONE` |

#### BODY
| byte(s) | value(s)
Expand Down
7 changes: 7 additions & 0 deletions src/PxLoadFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,13 @@ PxResult pxLoadFile(PxContainer* container, const char* fileName, PxChecksum che
{
return PS_FILE_CORRUPT;
}

// Reserved
if (memcmp(header + 12, cNONE, 4) != 0)
{
return PS_FILE_CORRUPT;
}


// Calculate checksum

Expand Down
4 changes: 2 additions & 2 deletions src/PxSaveFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ PxResult pxSaveFile(PxContainer* container, const char* fileName, PxCompression
return PS_ARGUMENT_ERROR;
}

// Padding
memset(header + 12, 0, 4);
// Reserved Bytes
memcpy(header + 12, cNONE, 4);

file.write(header, 16);

Expand Down

0 comments on commit 0c1d301

Please sign in to comment.