From e780560d1e038eaf69b15598ae7d6f76966482d3 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Tue, 19 Nov 2013 14:55:41 -0500 Subject: [PATCH] Move default bit depth definitions to abstracted pixel buffer loading function. --- IO/src/ImageLoader.cpp | 5 +++++ IO/src/ImageLoaderPVR.cpp | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/IO/src/ImageLoader.cpp b/IO/src/ImageLoader.cpp index f2bbed0..8208ebc 100644 --- a/IO/src/ImageLoader.cpp +++ b/IO/src/ImageLoader.cpp @@ -138,6 +138,11 @@ unsigned int ImageLoader::GetChannelForPixel(uint32 x, uint32 y, uint32 ch) { } bool ImageLoader::LoadFromPixelBuffer(uint32 *data) { + m_RedChannelPrecision = 8; + m_GreenChannelPrecision = 8; + m_BlueChannelPrecision = 8; + m_AlphaChannelPrecision = 8; + const int nPixels = m_Width * m_Height; m_RedData = new uint8[nPixels]; m_GreenData = new uint8[nPixels]; diff --git a/IO/src/ImageLoaderPVR.cpp b/IO/src/ImageLoaderPVR.cpp index 765c9b4..5ec9e98 100644 --- a/IO/src/ImageLoaderPVR.cpp +++ b/IO/src/ImageLoaderPVR.cpp @@ -74,11 +74,6 @@ bool ImageLoaderPVR::ReadData() { return false; } - m_RedChannelPrecision = 8; - m_GreenChannelPrecision = 8; - m_BlueChannelPrecision = 8; - m_AlphaChannelPrecision = 8; - const pvrtexture::CPVRTextureHeader &hdr = pvrTex.getHeader(); m_Width = hdr.getWidth();