Bugfix for win32 loading jpg texture's

This commit is contained in:
Mark Vejvoda
2010-04-09 06:51:13 +00:00
parent d61e7cd4c3
commit 06b21ca4ee
6 changed files with 70 additions and 13 deletions

View File

@@ -10,9 +10,12 @@
// ==============================================================
#include "texture.h"
#include "util.h"
#include "leak_dumper.h"
using namespace Shared::Util;
namespace Shared{ namespace Graphics{
// =====================================================
@@ -37,6 +40,8 @@ Texture::Texture(){
void Texture1D::load(const string &path){
this->path= path;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] this->path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,this->path.c_str());
if (pixmap.getComponents() == -1) { //TODO: look where you really need that
pixmap.init(defaultComponents);
}
@@ -49,6 +54,8 @@ void Texture1D::load(const string &path){
void Texture2D::load(const string &path){
this->path= path;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] this->path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,this->path.c_str());
if (pixmap.getComponents() == -1) {
pixmap.init(defaultComponents);
}
@@ -61,6 +68,8 @@ void Texture2D::load(const string &path){
void Texture3D::loadSlice(const string &path, int slice){
this->path= path;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] this->path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,this->path.c_str());
if (pixmap.getComponents() == -1) {
pixmap.init(defaultComponents);
}
@@ -73,6 +82,8 @@ void Texture3D::loadSlice(const string &path, int slice){
void TextureCube::loadFace(const string &path, int face){
this->path= path;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] this->path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,this->path.c_str());
if (pixmap.getFace(0)->getComponents() == -1) {
pixmap.init(defaultComponents);
}