Increase the max number of textures to 512. Add config.h for settings like this. Fixes #29

This commit is contained in:
Luke Benstead 2019-02-25 08:30:02 +00:00
parent 7368f5c290
commit 920fc2b782
2 changed files with 10 additions and 1 deletions

8
GL/config.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef CONFIG_H
#define CONFIG_H
#define MAX_TEXTURE_COUNT 512
#endif // CONFIG_H

View File

@ -5,6 +5,7 @@
#include <stdlib.h>
#include <assert.h>
#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;