Commit 3283251a authored by nadro's avatar nadro

- Added to PVR loader support for following uncompressed formats:

 * ECF_A1R5G5B5
 * ECF_R5G6B5
 * ECF_R8G8B8
 * ECF_A8R8G8B8

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5261 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 56ebb84c
...@@ -101,9 +101,25 @@ core::array<IImage*> CImageLoaderPVR::loadImages(io::IReadFile* file, E_TEXTURE_ ...@@ -101,9 +101,25 @@ core::array<IImage*> CImageLoaderPVR::loadImages(io::IReadFile* file, E_TEXTURE_
file->seek(helperDataSize, true); file->seek(helperDataSize, true);
} }
if (header.PixelFormat & 0xFFFFFFFF00000000) // Uncompressed texture formats if (header.PixelFormat & 0xFFFFFFFF00000000)
{ {
// TO-DO add support for uncompressed images. switch (header.PixelFormat)
{
case 0x505050162677261:
format = ECF_A1R5G5B5;
break;
case 0x5060500626772:
format = ECF_R5G6B5;
break;
case 0x8080800626772:
format = ECF_R8G8B8;
break;
case 0x808080861726762:
format = ECF_A8R8G8B8;
break;
default:
break;
}
} }
else // Compressed texture formats else // Compressed texture formats
{ {
...@@ -151,6 +167,7 @@ core::array<IImage*> CImageLoaderPVR::loadImages(io::IReadFile* file, E_TEXTURE_ ...@@ -151,6 +167,7 @@ core::array<IImage*> CImageLoaderPVR::loadImages(io::IReadFile* file, E_TEXTURE_
format = ECF_UNKNOWN; format = ECF_UNKNOWN;
break; break;
} }
}
if (format != ECF_UNKNOWN) if (format != ECF_UNKNOWN)
{ {
...@@ -193,7 +210,7 @@ core::array<IImage*> CImageLoaderPVR::loadImages(io::IReadFile* file, E_TEXTURE_ ...@@ -193,7 +210,7 @@ core::array<IImage*> CImageLoaderPVR::loadImages(io::IReadFile* file, E_TEXTURE_
mipMapsDataArray.set_used(imageArray.size()); mipMapsDataArray.set_used(imageArray.size());
for (u32 j = 0; j < mipMapsDataArray.size(); ++j) for (u32 j = 0; j < mipMapsDataArray.size(); ++j)
mipMapsDataArray[j] =new u8[dataSize]; mipMapsDataArray[j] = new u8[dataSize];
} }
// read texture // read texture
...@@ -234,7 +251,6 @@ core::array<IImage*> CImageLoaderPVR::loadImages(io::IReadFile* file, E_TEXTURE_ ...@@ -234,7 +251,6 @@ core::array<IImage*> CImageLoaderPVR::loadImages(io::IReadFile* file, E_TEXTURE_
for (u32 i = 0; i < mipMapsDataArray.size(); ++i) for (u32 i = 0; i < mipMapsDataArray.size(); ++i)
imageArray[i]->setMipMapsData(mipMapsDataArray[i], true, true); imageArray[i]->setMipMapsData(mipMapsDataArray[i], true, true);
} }
}
return imageArray; return imageArray;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment