MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / validateHeader

Function validateHeader

Engine/source/gfx/bitmap/ddsData.h:871–893  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

869 }
870
871 const bool validateHeader(const DDS_HEADER &header)
872 {
873 if (header.size != DDS_HEADER_SIZE)
874 {
875 Con::errorf("DDS_HEADER - incorrect header size. Expected 124 bytes.");
876 return false;
877 }
878
879 if (!(header.flags & DDS_HEADER_FLAGS_TEXTURE))
880 {
881 Con::errorf("DDS_HEADER - incorrect surface description flags.");
882 return false;
883 }
884
885 if ((header.flags & (DDS_HEADER_FLAGS_LINEARSIZE | DDS_HEADER_FLAGS_PITCH)) == (DDS_HEADER_FLAGS_LINEARSIZE | DDS_HEADER_FLAGS_PITCH))
886 {
887 // Both are invalid!
888 Con::errorf("DDS_HEADER - encountered both DDSD_LINEARSIZE and DDSD_PITCH!");
889 return false;
890 }
891
892 return true;
893 }
894
895 const bool validateHeaderDx10(const DDS_HEADER_DXT10 &header)
896 {

Callers 2

readHeaderMethod · 0.85
writeHeaderMethod · 0.85

Calls 1

errorfFunction · 0.50

Tested by

no test coverage detected