diff --git a/src/gl/render.c b/src/gl/render.c
index e9dc5b5addb443537778fc50ed596e4a0f05244b..6b62793494c418920d95a9206420ceba7e3c1aae 100644 (file)
--- a/src/gl/render.c
+++ b/src/gl/render.c
#include "view.h"
#include "switch.h" // sw_secrets
-#include <OpenGL/GL.h>
+#ifdef __APPLE__
+# include <OpenGL/gl.h>
+#else
+# include <GL/gl.h>
+#endif
#include <stdlib.h> // malloc free abs
#include <assert.h> // assert
#include <SDL.h>
GLint size = 0;
cache *c = NULL;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size);
- size /= 2; // TODO remove hack or detect ibook bug
+ size = size < 512 ? size : 512; // more can be buggy on older hardware
if (size) {
glGenTextures(1, &id);
if (id) {
static short getani (char n[8]) {
short i = 0;
- while (i < ANIT && strncasecmp(n, anm[i][0], 8) != 0) {
+ while (i < ANIT - 1 && strncasecmp(n, anm[i][0], 8) != 0) {
i++;
}
- return i < ANIT ? i + 1 : 0;
+ return i < ANIT - 1 ? i + 1 : 0;
}
int R_get_special_id (int n) {
};
} else if (strncasecmp(s, "_WATER_", 7) == 0) {
walp[max_textures] = (image) {
- .n = (void*)(s[7] - '0' + 1),
+ .n = (void*)((intptr_t)s[7] - '0' + 1),
.x = 0,
.y = 0,
.w = 8,
s[4] = '0' + sky;
R_gl_free_image(&horiz);
horiz = R_gl_loadimage(s);
-}
\ No newline at end of file
+}