NzImage now handles mipmaps

Added NzRenderer::SetClearColor(const Color&)
Added describe comment for pixel formats
Fixed NzPixelFormat conversion for RGBA4 and RGB5A1 types
Fixed NzRenderer::Clear prototype
Renamed NzLock to NzLockGuard
ResourceLoader's loaders are now tested from newest to oldest
This commit is contained in:
Lynix
2012-05-30 18:10:17 +02:00
parent f39e2f7d36
commit b220e00c88
17 changed files with 591 additions and 221 deletions

View File

@@ -31,11 +31,15 @@ inline bool NzPixelFormat::Convert(nzPixelFormat srcFormat, nzPixelFormat dstFor
ConvertFunction func = s_convertFunctions[srcFormat][dstFormat];
if (!func)
{
NazaraError("Pixel format conversion from " + ToString(srcFormat) + " to " + ToString(dstFormat) + " not supported");
NazaraError("Pixel format conversion from " + ToString(srcFormat) + " to " + ToString(dstFormat) + " is not supported");
return false;
}
func(static_cast<const nzUInt8*>(src), static_cast<const nzUInt8*>(src) + GetBPP(srcFormat), static_cast<nzUInt8*>(dst));
if (!func(static_cast<const nzUInt8*>(src), static_cast<const nzUInt8*>(src) + GetBPP(srcFormat), static_cast<nzUInt8*>(dst)))
{
NazaraError("Pixel format conversion from " + ToString(srcFormat) + " to " + ToString(dstFormat) + " failed");
return false;
}
return true;
}
@@ -51,11 +55,15 @@ inline bool NzPixelFormat::Convert(nzPixelFormat srcFormat, nzPixelFormat dstFor
ConvertFunction func = s_convertFunctions[srcFormat][dstFormat];
if (!func)
{
NazaraError("Pixel format conversion from " + ToString(srcFormat) + " to " + ToString(dstFormat) + " not supported");
NazaraError("Pixel format conversion from " + ToString(srcFormat) + " to " + ToString(dstFormat) + " is not supported");
return false;
}
func(static_cast<const nzUInt8*>(start), static_cast<const nzUInt8*>(end), static_cast<nzUInt8*>(dst));
if (!func(static_cast<const nzUInt8*>(start), static_cast<const nzUInt8*>(end), static_cast<nzUInt8*>(dst)))
{
NazaraError("Pixel format conversion from " + ToString(srcFormat) + " to " + ToString(dstFormat) + " failed");
return false;
}
return true;
}
@@ -100,13 +108,13 @@ inline nzUInt8 NzPixelFormat::GetBPP(nzPixelFormat format)
case nzPixelFormat_RGB32I:
return 12;
*/
case nzPixelFormat_RGBA16F:
return 8;
case nzPixelFormat_RGBA16I:
return 8;
/*
case nzPixelFormat_RGBA32F:
return 16;
@@ -145,6 +153,14 @@ inline bool NzPixelFormat::IsCompressed(nzPixelFormat format)
}
}
inline bool NzPixelFormat::IsConversionSupported(nzPixelFormat srcFormat, nzPixelFormat dstFormat)
{
if (srcFormat == dstFormat)
return true;
return s_convertFunctions[srcFormat][dstFormat] != nullptr;
}
inline bool NzPixelFormat::IsValid(nzPixelFormat format)
{
switch (format)
@@ -199,13 +215,13 @@ inline NzString NzPixelFormat::ToString(nzPixelFormat format)
case nzPixelFormat_RGB32I:
return "RGB32I";
*/
case nzPixelFormat_RGBA16F:
return "RGBA16F";
case nzPixelFormat_RGBA16I:
return "RGBA16I";
/*
case nzPixelFormat_RGBA32F:
return "RGBA32F";