summaryrefslogtreecommitdiffstats
path: root/src/graphics
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2013-10-28 19:36:43 +0100
committerPiotr Dziwinski <piotrdz@gmail.com>2013-10-28 19:36:43 +0100
commit70af33e45d286bc6f62a392d0b967aafdc7548e4 (patch)
treef783e7ed6dc373d603ddeef612db2e7f82290d94 /src/graphics
parent75871cc9cafb0dc03a7d34c1031a7dbfe7da8919 (diff)
downloadcolobot-70af33e45d286bc6f62a392d0b967aafdc7548e4.tar.gz
colobot-70af33e45d286bc6f62a392d0b967aafdc7548e4.tar.bz2
colobot-70af33e45d286bc6f62a392d0b967aafdc7548e4.zip
Revert "Merge pull request #243 from OdyX/dev-fix-textures-loading"
Looks like it doesn't work on all platforms
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/engine/engine.cpp2
-rw-r--r--src/graphics/opengl/gldevice.cpp8
2 files changed, 3 insertions, 7 deletions
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index 5cf7b23..e973eec 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -276,7 +276,7 @@ bool CEngine::Create()
Math::LoadOrthoProjectionMatrix(m_matProjInterface, 0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f);
TextureCreateParams params;
- params.format = TEX_IMG_AUTO;
+ params.format = TEX_IMG_RGB;
params.minFilter = TEX_MIN_FILTER_NEAREST;
params.magFilter = TEX_MAG_FILTER_NEAREST;
params.mipmap = false;
diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp
index 9f64fab..bbabdd6 100644
--- a/src/graphics/opengl/gldevice.cpp
+++ b/src/graphics/opengl/gldevice.cpp
@@ -606,7 +606,7 @@ Texture CGLDevice::CreateTexture(ImageData *data, const TextureCreateParams &par
}
else if (params.format == TEX_IMG_AUTO)
{
- if (data->surface->format->BytesPerPixel == 4)
+ if (data->surface->format->Amask != 0)
{
if ((data->surface->format->Amask == 0xFF000000) &&
(data->surface->format->Rmask == 0x00FF0000) &&
@@ -630,7 +630,7 @@ Texture CGLDevice::CreateTexture(ImageData *data, const TextureCreateParams &par
convert = true;
}
}
- else if (data->surface->format->BytesPerPixel == 3)
+ else
{
if ((data->surface->format->Rmask == 0xFF0000) &&
(data->surface->format->Gmask == 0x00FF00) &&
@@ -652,10 +652,6 @@ Texture CGLDevice::CreateTexture(ImageData *data, const TextureCreateParams &par
convert = true;
}
}
- else {
- GetLogger()->Error("Unknown data surface format");
- assert(false);
- }
}
else
assert(false);