From dd4bdcb770428c3785b1601a77deed45d14415ac Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 18 Mar 2017 18:07:37 +0000 Subject: [PATCH] Inline OGL_TEXTURE_LIST_SIZE --- common/include/internal.h | 2 -- similar/arch/ogl/ogl.cpp | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/common/include/internal.h b/common/include/internal.h index 93022118e..b2fec5725 100644 --- a/common/include/internal.h +++ b/common/include/internal.h @@ -15,8 +15,6 @@ #ifdef __cplusplus -/* I assume this ought to be >= MAX_BITMAP_FILES in piggy.h? */ -#define OGL_TEXTURE_LIST_SIZE 20000 void ogl_init_texture_list_internal(void); void ogl_smash_texture_list_internal(void); diff --git a/similar/arch/ogl/ogl.cpp b/similar/arch/ogl/ogl.cpp index d116a205a..e13b5a992 100644 --- a/similar/arch/ogl/ogl.cpp +++ b/similar/arch/ogl/ogl.cpp @@ -126,7 +126,8 @@ static int r_polyc,r_tpolyc,r_bitmapc,r_ubitbltc; #define OGL_BINDTEXTURE(a) glBindTexture(GL_TEXTURE_2D, a); -static array ogl_texture_list; +/* I assume this ought to be >= MAX_BITMAP_FILES in piggy.h? */ +static array ogl_texture_list; static int ogl_texture_list_cur; /* some function prototypes */ @@ -261,11 +262,11 @@ void ogl_smash_texture_list_internal(void){ } ogl_texture* ogl_get_free_texture(void){ - int i; - for (i=0;i=OGL_TEXTURE_LIST_SIZE) + if (++ogl_texture_list_cur >= ogl_texture_list.size()) ogl_texture_list_cur=0; } Error("OGL: texture list full!\n");