From 2954208d00d422b34fa3a69631b0a091f17a349d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 2 Dec 2020 08:23:52 +0100 Subject: 5.44 --- hacks/glx/glhanoi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'hacks/glx/glhanoi.c') diff --git a/hacks/glx/glhanoi.c b/hacks/glx/glhanoi.c index 46cdc68..11ac75f 100644 --- a/hacks/glx/glhanoi.c +++ b/hacks/glx/glhanoi.c @@ -1424,13 +1424,14 @@ static GLubyte *makeTexture(glhcfg *glhanoi, int x_size, int y_size, int z_size, tex_col_t *), tex_col_t * colours) { int i, j, k; - GLubyte *textureData; + GLuint *textureData; GLuint *texturePtr; double x, y, z; double xi, yi, zi; + /* As we use GL_RGBA format, we must assign 4 bytes per element */ if((textureData = - calloc(x_size * y_size * z_size, sizeof(GLubyte))) == NULL) { + calloc(x_size * y_size * z_size, sizeof(*texturePtr))) == NULL) { return NULL; } @@ -1439,7 +1440,7 @@ static GLubyte *makeTexture(glhcfg *glhanoi, int x_size, int y_size, int z_size, zi = 1.0 / z_size; z = 0.0; - texturePtr = (void *)textureData; + texturePtr = textureData; for(k = 0; k < z_size; k++, z += zi) { y = 0.0; for(j = 0; j < y_size; j++, y += yi) { @@ -1450,7 +1451,7 @@ static GLubyte *makeTexture(glhcfg *glhanoi, int x_size, int y_size, int z_size, } } } - return textureData; + return (GLubyte *)textureData; } static void freeTexCols(tex_col_t*p) -- cgit v1.2.3-55-g7522