summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Marchesin <stephane.marchesin@gmail.com>2010-04-21 22:55:05 -0700
committerStephane Marchesin <stephane.marchesin@gmail.com>2010-04-21 22:55:05 -0700
commit0b1329f231e114e981710adf6929360c4711d6fb (patch)
tree7f2d4a16b360ace36f818f349b362ebe4b9da5f1
parent37c917c57b073e07ab6011a897813760e32d1127 (diff)
GL: fix this damn winnie thingie.
-rw-r--r--render-gl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/render-gl.c b/render-gl.c
index 15f05cc..c5d6340 100644
--- a/render-gl.c
+++ b/render-gl.c
@@ -53,15 +53,16 @@ void render_palette(void)
u32 i;
for (i = 0; i < 256; i++) {
u16 p = mem[0x2b00 + i];
- that[4*i] = 255*(p & 31) / 31.0f;
- that[4*i+1] = 255*((p >> 5) & 31) / 31.0f;
- that[4*i+2] = 255*((p >> 10) & 31) / 31.0f;
+ that[4*i] = 255*(p & 31) / 31;
+ that[4*i+1] = 255*((p >> 5) & 31) / 31;
+ that[4*i+2] = 255*((p >> 10) & 31) / 31;
that[4*i+3] = 255*(1-(p >> 15));
}
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_1D, palette_texture);
glTexSubImage1D(GL_TEXTURE_1D, 0, 0, 256, GL_BGRA, GL_UNSIGNED_BYTE, that);
+ glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP);
error();
}