summaryrefslogtreecommitdiffstats
path: root/src/graphics/opengl/test/model_test.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-07-16 19:17:26 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-07-16 19:17:26 +0200
commit68a7bafe37adef0e5ef12c2d0e8461a21e05363b (patch)
treef0185e459ea0c5638fca7bada5f2e440fd9eda51 /src/graphics/opengl/test/model_test.cpp
parent54f4da87923465a5387e2e854b58616647deb7af (diff)
downloadcolobot-68a7bafe37adef0e5ef12c2d0e8461a21e05363b.tar.gz
colobot-68a7bafe37adef0e5ef12c2d0e8461a21e05363b.tar.bz2
colobot-68a7bafe37adef0e5ef12c2d0e8461a21e05363b.zip
Fixes in texture loading
- added other texture formats: BGR and BGRA - fixed texture loading in model viewer - moved code from texture.cpp module to texture.h
Diffstat (limited to 'src/graphics/opengl/test/model_test.cpp')
-rw-r--r--src/graphics/opengl/test/model_test.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/graphics/opengl/test/model_test.cpp b/src/graphics/opengl/test/model_test.cpp
index b73dc71..88404b7 100644
--- a/src/graphics/opengl/test/model_test.cpp
+++ b/src/graphics/opengl/test/model_test.cpp
@@ -66,8 +66,11 @@ void LoadTexture(Gfx::CGLDevice *device, const std::string &name)
else
{
Gfx::TextureCreateParams texCreateParams;
- texCreateParams.alpha = false;
texCreateParams.mipmap = true;
+ if (img.GetData()->surface->format->Amask == 0)
+ texCreateParams.format = Gfx::TEX_IMG_BGR;
+ else
+ texCreateParams.format = Gfx::TEX_IMG_BGRA;
texCreateParams.minFilter = Gfx::TEX_MIN_FILTER_LINEAR_MIPMAP_LINEAR;
texCreateParams.magFilter = Gfx::TEX_MAG_FILTER_LINEAR;
texCreateParams.wrapT = Gfx::TEX_WRAP_CLAMP;