diff options
author | Simon Rettberg | 2020-12-02 08:23:52 +0100 |
---|---|---|
committer | Simon Rettberg | 2020-12-02 08:23:52 +0100 |
commit | 2954208d00d422b34fa3a69631b0a091f17a349d (patch) | |
tree | b4322e320155656af133b8f47025d00b17a68f64 /hacks/glx/glhanoi.c | |
parent | Update to 5.43 (diff) | |
download | xscreensaver-2954208d00d422b34fa3a69631b0a091f17a349d.tar.gz xscreensaver-2954208d00d422b34fa3a69631b0a091f17a349d.tar.xz xscreensaver-2954208d00d422b34fa3a69631b0a091f17a349d.zip |
5.44
Diffstat (limited to 'hacks/glx/glhanoi.c')
-rw-r--r-- | hacks/glx/glhanoi.c | 9 |
1 files changed, 5 insertions, 4 deletions
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) |