Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
| Show First 20 Lines • Show All 884 Lines • ▼ Show 20 Lines | DirectDrawSurface::DirectDrawSurface(unsigned char *mem, uint size) : stream(mem, size), header() | ||||
| /* Some ATI2 compressed normal maps do not have their | /* Some ATI2 compressed normal maps do not have their | ||||
| * normal flag set, so force it here (the original nvtt don't do | * normal flag set, so force it here (the original nvtt don't do | ||||
| * this, but the decompressor has a -forcenormal flag). */ | * this, but the decompressor has a -forcenormal flag). */ | ||||
| if (header.pf.fourcc == FOURCC_ATI2) { | if (header.pf.fourcc == FOURCC_ATI2) { | ||||
| header.setNormalFlag(true); | header.setNormalFlag(true); | ||||
| } | } | ||||
| } | } | ||||
| DirectDrawSurface::~DirectDrawSurface() | |||||
| { | |||||
| } | |||||
| bool DirectDrawSurface::isValid() const | bool DirectDrawSurface::isValid() const | ||||
| { | { | ||||
| if (header.fourcc != FOURCC_DDS || header.size != 124) { | if (header.fourcc != FOURCC_DDS || header.size != 124) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| const uint required = (DDSD_WIDTH | DDSD_HEIGHT /*|DDSD_CAPS|DDSD_PIXELFORMAT*/); | const uint required = (DDSD_WIDTH | DDSD_HEIGHT /*|DDSD_CAPS|DDSD_PIXELFORMAT*/); | ||||
| if ((header.flags & required) != required) { | if ((header.flags & required) != required) { | ||||
| ▲ Show 20 Lines • Show All 669 Lines • Show Last 20 Lines | |||||