From 59a4f0e8ba5a474b62afcea0a64ab3947dfbfd09 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 24 Sep 2015 06:31:58 +0000 Subject: [PATCH] Defs: Fix a bug with the tilefromtexture { texture } subtoken, where alphacut was interpreted in an inverse fashion, generally causing hightile textures defined this way to appear completely transparent. git-svn-id: https://svn.eduke32.com/eduke32@5356 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/defs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/build/src/defs.c b/polymer/eduke32/build/src/defs.c index d06e2238a..0eab822e7 100644 --- a/polymer/eduke32/build/src/defs.c +++ b/polymer/eduke32/build/src/defs.c @@ -277,7 +277,7 @@ static int32_t Defs_ImportTileFromTexture(char const * const fn, int32_t const t #ifdef USE_OPENGL if (istexture) - hicsetsubsttex(tile, 0, fn, (float)alphacut / 255.f, 1.0f, 1.0f, 1.0f, 1.0f, HICR_NOSAVE|HICR_NOCOMPRESS); + hicsetsubsttex(tile, 0, fn, (float)(255-alphacut) * (1.f/255.f), 1.0f, 1.0f, 1.0f, 1.0f, HICR_NOSAVE|HICR_NOCOMPRESS); #endif return 1; @@ -297,7 +297,7 @@ static int32_t Defs_ImportTileFromTexture(char const * const fn, int32_t const t #ifdef USE_OPENGL if (istexture) - hicsetsubsttex(tile, 0, fn, (float) alphacut / 255.f, 1.0f, 1.0f, 1.0, 1.0, HICR_NOSAVE|HICR_NOCOMPRESS); + hicsetsubsttex(tile, 0, fn, (float)(255-alphacut) * (1.f/255.f), 1.0f, 1.0f, 1.0, 1.0, HICR_NOSAVE|HICR_NOCOMPRESS); #else UNREFERENCED_PARAMETER(istexture); #endif