fixes
This commit is contained in:
@@ -331,16 +331,12 @@ namespace dds
|
||||
// returns the width of the texture in pixels
|
||||
constexpr unsigned width() const
|
||||
{
|
||||
if (header.dwFlags & DDSD_WIDTH)
|
||||
return header.dwWidth;
|
||||
return 1;
|
||||
return header.dwWidth < 1 ? 1 : header.dwWidth;
|
||||
}
|
||||
// returns the height of the texture in pixels
|
||||
constexpr unsigned height() const
|
||||
{
|
||||
if (header.dwFlags & DDSD_HEIGHT)
|
||||
return header.dwHeight;
|
||||
return 1;
|
||||
return header.dwHeight < 1 ? 1 : header.dwHeight;
|
||||
}
|
||||
// returns the depth of the texture in pixels
|
||||
constexpr unsigned depth() const
|
||||
|
||||
@@ -315,7 +315,7 @@ namespace wi
|
||||
resource->container_filesize = filesize;
|
||||
resource->container_fileoffset = container_fileoffset;
|
||||
|
||||
if (resource->filedata.empty() && (has_flag(flags, Flags::IMPORT_RETAIN_FILEDATA) || has_flag(flags, Flags::IMPORT_DELAY)))
|
||||
if (filedata != nullptr && resource->filedata.empty() && (has_flag(flags, Flags::IMPORT_RETAIN_FILEDATA) || has_flag(flags, Flags::IMPORT_DELAY)))
|
||||
{
|
||||
// resource was loaded with external filedata, and we want to retain filedata
|
||||
// this must also happen when using IMPORT_DELAY!
|
||||
|
||||
Reference in New Issue
Block a user