From 920fc2b7828ad375d6720d470011a503c3922506 Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Mon, 25 Feb 2019 08:30:02 +0000 Subject: [PATCH] Increase the max number of textures to 512. Add config.h for settings like this. Fixes #29 --- GL/config.h | 8 ++++++++ GL/texture.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 GL/config.h diff --git a/GL/config.h b/GL/config.h new file mode 100644 index 0000000..b908a5a --- /dev/null +++ b/GL/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_H +#define CONFIG_H + + +#define MAX_TEXTURE_COUNT 512 + + +#endif // CONFIG_H diff --git a/GL/texture.c b/GL/texture.c index 44711af..b1f16a0 100644 --- a/GL/texture.c +++ b/GL/texture.c @@ -5,6 +5,7 @@ #include #include +#include "config.h" #include "../include/glext.h" #include "../include/glkos.h" @@ -133,7 +134,7 @@ static GLuint _glGetMipmapDataSize(TextureObject* obj) { } GLubyte _glKosInitTextures() { - named_array_init(&TEXTURE_OBJECTS, sizeof(TextureObject), 256); + named_array_init(&TEXTURE_OBJECTS, sizeof(TextureObject), MAX_TEXTURE_COUNT); SHARED_PALETTE = (TexturePalette*) malloc(sizeof(TexturePalette)); return 1;