summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/texture.cpp25
-rw-r--r--docs/CHANGES.txt9
2 files changed, 21 insertions, 13 deletions
diff --git a/common/texture.cpp b/common/texture.cpp
index 72a0453..4b9997b 100644
--- a/common/texture.cpp
+++ b/common/texture.cpp
@@ -100,7 +100,7 @@ void Texture::LoadIndex(File* idx)
switch (bt)
{
case LC_INTENSITY:
- m_nFormat = GL_LUMINANCE;
+ m_nFormat = GL_LUMINANCE_ALPHA;
m_nFileSize = m_nWidth*m_nHeight;
break;
case LC_RGB:
@@ -135,11 +135,14 @@ void Texture::Load(bool bFilter)
if (!bin.Open(filename, "rb"))
return;
- bits = malloc(m_nFileSize);
+ if (m_nFormat == GL_LUMINANCE_ALPHA)
+ bits = malloc (m_nFileSize*2);
+ else
+ bits = malloc (m_nFileSize);
- bin.Seek(m_nOffset, SEEK_SET);
- bin.Read(bits, m_nFileSize);
- bin.Close();
+ bin.Seek (m_nOffset, SEEK_SET);
+ bin.Read (bits, m_nFileSize);
+ bin.Close ();
FinishLoadImage (bFilter, bits);
@@ -201,12 +204,17 @@ bool Texture::FinishLoadImage (bool bFilter, void *data)
switch (m_nFormat)
{
- case GL_LUMINANCE: components = 1; break;
+ case GL_LUMINANCE_ALPHA: components = 2; break;
case GL_RGB: components = 3; break;
case GL_RGBA: components = 4; break;
default: return false;
}
+ // create an alpha channel for the texture
+ if (m_nFormat == GL_LUMINANCE_ALPHA)
+ for (i = m_nWidth*m_nHeight-1; i >= 0; i--)
+ ((GLubyte*)data)[i*2+1] = ((GLubyte*)data)[i*2] = ((GLubyte*)data)[i];
+
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &maxsize);
for (pow2 = 1; pow2 < m_nWidth; pow2 = pow2 << 1);
@@ -233,10 +241,7 @@ bool Texture::FinishLoadImage (bool bFilter, void *data)
data = tmp;
}
- if (m_nFormat == GL_LUMINANCE)
- glTexImage2D (GL_TEXTURE_2D, 0, GL_INTENSITY4, w, h, 0, m_nFormat, GL_UNSIGNED_BYTE, data);
- else
- glTexImage2D (GL_TEXTURE_2D, 0, components, w, h, 0, m_nFormat, GL_UNSIGNED_BYTE, data);
+ glTexImage2D (GL_TEXTURE_2D, 0, components, w, h, 0, m_nFormat, GL_UNSIGNED_BYTE, data);
if (bFilter)
for (level = 1; ((w != 1) || (h != 1)); level++)
diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt
index b111409..f133920 100644
--- a/docs/CHANGES.txt
+++ b/docs/CHANGES.txt
@@ -1,13 +1,16 @@
This is a changelog for developers only, not for ordinary users.
-21/02/2000
+13/03/2001
+ - Fixed texture font not visible on some video cards.
+
+21/02/2001
- New shortcuts: Home/End keys will change the Pieces List selection (win32).
- Fixed the creation and destruction of the MainWnd under win32.
-19/02/2000
+19/02/2001
- The "Mouse moves in 3D" option now applies to rotations too.
-04/02/2000
+04/02/2001
- When multiple pieces are selected, rotate around the piece that has focus.
- Clicking on a piece with focus now deselects it.
- Only define LC_HAVE_PNGLIB if zlib is available.