shithub: choc

Download patch

ref: d67c5cd7ae78261a730508bc5bb4ed78ccf6fa05
parent: 2932aef2247dd4f6c654416e4272cfbf872401a1
author: Simon Howard <fraggle@gmail.com>
date: Tue Jan 27 16:55:17 EST 2009

Fix for R_InitTranslationTables to not align on a 256 byte boundary
(fixes 64 bit)

Subversion-branch: /branches/raven-branch
Subversion-revision: 1435

--- a/src/heretic/r_draw.c
+++ b/src/heretic/r_draw.c
@@ -244,8 +244,7 @@
     V_LoadTintTable();
 
     // Allocate translation tables
-    translationtables = Z_Malloc(256 * 3 + 255, PU_STATIC, 0);
-    translationtables = (byte *) (((int) translationtables + 255) & ~255);
+    translationtables = Z_Malloc(256 * 3, PU_STATIC, 0);
 
     // Fill out the translation tables
     for (i = 0; i < 256; i++)
--- a/src/hexen/r_draw.c
+++ b/src/hexen/r_draw.c
@@ -328,9 +328,7 @@
     V_LoadTintTable();
 
     // Allocate translation tables
-    translationtables = Z_Malloc(256 * 3 * (MAXPLAYERS - 1) + 255,
-                                 PU_STATIC, 0);
-    translationtables = (byte *) (((int) translationtables + 255) & ~255);
+    translationtables = Z_Malloc(256 * 3 * (MAXPLAYERS - 1), PU_STATIC, 0);
 
     for (i = 0; i < 3 * (MAXPLAYERS - 1); i++)
     {