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