Added some decoration for stream read and write

This commit is contained in:
korenkonder
2023-10-24 15:54:28 +03:00
parent 299ec11bef
commit 4296dcdadf
7 changed files with 42 additions and 13 deletions
+2 -2
View File
@@ -188,7 +188,7 @@ void dds::read(const wchar_t* path) {
goto End;
DDS_HEADER dds_h = {};
if (s.read(&dds_h, sizeof(DDS_HEADER)) != sizeof(DDS_HEADER))
if (s.read(dds_h) != sizeof(DDS_HEADER))
goto End;
if (!((dds_h.flags & DDSD_CAPS) && (dds_h.flags & DDSD_HEIGHT)
@@ -362,7 +362,7 @@ void dds::write(const wchar_t* path) {
s.open(path_dds, L"wb");
if (s.check_not_null()) {
s.write_uint32_t_reverse_endianness(DDS_MAGIC, true);
s.write(&dds_h, sizeof(DDS_HEADER));
s.write(dds_h);
uint32_t index = 0;
do