mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-25 14:18:56 +00:00
Cast our strlens to uint32 to avoid compiler warnings.
This commit is contained in:
parent
cc566471e9
commit
865239542a
1 changed files with 8 additions and 6 deletions
|
@ -110,10 +110,12 @@ bool ImageWriterKTX::WriteImage() {
|
|||
wtr.Write(0x04030201);
|
||||
|
||||
const char *orientationKey = "KTXorientation";
|
||||
const char *orientationValue = "S=r,T=u";
|
||||
const uint32 kvSz =
|
||||
strlen(orientationKey) + 1 // key
|
||||
+ strlen(orientationValue) + 1; // value
|
||||
uint32 oKeyLen = static_cast<uint32>(strlen(orientationKey));
|
||||
|
||||
const char *orientationValue = "S=r,T=d";
|
||||
uint32 oValLen = static_cast<uint32>(strlen(orientationValue));
|
||||
|
||||
const uint32 kvSz = oKeyLen + 1 + oValLen + 1;
|
||||
uint32 tkvSz = kvSz + 4; // total kv size
|
||||
tkvSz = (tkvSz + 3) & ~0x3; // 4-byte aligned
|
||||
|
||||
|
@ -153,8 +155,8 @@ bool ImageWriterKTX::WriteImage() {
|
|||
wtr.Write(1); // numberOfMipmapLevels
|
||||
wtr.Write(tkvSz); // total key value size
|
||||
wtr.Write(kvSz); // key value size
|
||||
wtr.Write(orientationKey, strlen(orientationKey) + 1); // key
|
||||
wtr.Write(orientationValue, strlen(orientationValue) + 1); // value
|
||||
wtr.Write(orientationKey, oKeyLen + 1); // key
|
||||
wtr.Write(orientationValue, oValLen + 1); // value
|
||||
wtr.Write(orientationKey, tkvSz - kvSz - 4); // padding
|
||||
|
||||
if(ci && ci->GetFormat() == FasTC::eCompressionFormat_BPTC) {
|
||||
|
|
Loading…
Reference in a new issue