From bbe678346863f0f954c0975d996d02cd18222c3a Mon Sep 17 00:00:00 2001 From: parasti Date: Sat, 9 Apr 2011 17:42:16 +0000 Subject: [PATCH] Fix remaining errors when compiling against GL ES 1.1 headers git-svn-id: https://s.snth.net/svn/neverball/branches/gles@3567 78b8d119-cf0a-0410-b17c-f493084dd1d7 --- ball/game_draw.c | 2 +- ball/main.c | 4 ++-- putt/game.c | 5 ++++- putt/main.c | 2 ++ share/glext.h | 2 +- share/gui.c | 4 ++-- share/image.c | 2 ++ share/item.c | 2 +- 8 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ball/game_draw.c b/ball/game_draw.c index 32f0c2f..0e71446 100644 --- a/ball/game_draw.c +++ b/ball/game_draw.c @@ -295,7 +295,7 @@ static void game_clip_refl(int d) static void game_clip_ball(const struct game_draw *gd, int d, const float *p) { - GLdouble r, c[3], pz[4], nz[4]; + GLfloat r, c[3], pz[4], nz[4]; /* Compute the plane giving the front of the ball, as seen from view.p. */ diff --git a/ball/main.c b/ball/main.c index 398d39c..d06092d 100644 --- a/ball/main.c +++ b/ball/main.c @@ -54,7 +54,7 @@ static void shot(void) static void toggle_wire(void) { -/* +#ifndef CONF_OPENGLES static int wire = 0; if (wire) @@ -71,7 +71,7 @@ static void toggle_wire(void) glDisable(GL_LIGHTING); wire = 1; } -*/ +#endif } /*---------------------------------------------------------------------------*/ diff --git a/putt/game.c b/putt/game.c index 1a85ee1..84d3792 100644 --- a/putt/game.c +++ b/putt/game.c @@ -177,7 +177,10 @@ static const struct d_mtrl *game_draw_balls(const struct d_mtrl *mq, fp->uv[ui].r, fp->uv[ui].r); - glColor4fv(color[ui]); + glColor4f(color[ui][0], + color[ui][1], + color[ui][2], + color[ui][3]); mq = ball_draw(mq, ball_M, pend_M, bill_M, t); } glPopMatrix(); diff --git a/putt/main.c b/putt/main.c index 3bf6aef..fe4a97c 100644 --- a/putt/main.c +++ b/putt/main.c @@ -54,6 +54,7 @@ static int shot(void) static void toggle_wire(void) { +#ifndef CONF_OPENGLES static int wire = 0; if (wire) @@ -70,6 +71,7 @@ static void toggle_wire(void) glDisable(GL_LIGHTING); wire = 1; } +#endif } /*---------------------------------------------------------------------------*/ diff --git a/share/glext.h b/share/glext.h index 06b54e3..7aec78e 100644 --- a/share/glext.h +++ b/share/glext.h @@ -107,7 +107,7 @@ void glext_init(void); #define glIsBuffer_ glIsBuffer #define glPointParameterfv_ glPointParameterfv -#define glOrtho_ glOrtho +#define glOrtho_ glOrthof #else /* No native linkage? Define the extension API. */ diff --git a/share/gui.c b/share/gui.c index 5197a57..8ac72d5 100644 --- a/share/gui.c +++ b/share/gui.c @@ -1297,7 +1297,7 @@ static void gui_paint_rect(int id, int st) glTranslatef((GLfloat) (widget[id].x + widget[id].w / 2), (GLfloat) (widget[id].y + widget[id].h / 2), 0.f); - glColor4fv(back[i]); + glColor4f(back[i][0], back[i][1], back[i][2], back[i][3]); draw_rect(id); } glPopMatrix(); @@ -1535,7 +1535,7 @@ void gui_paint(int id) gui_paint_text(id); draw_disable(); - glColor4ubv(gui_wht); + glColor4ub(gui_wht[0], gui_wht[1], gui_wht[2], gui_wht[3]); } glEnable(GL_DEPTH_TEST); glEnable(GL_LIGHTING); diff --git a/share/image.c b/share/image.c index 1a0e091..42a937a 100644 --- a/share/image.c +++ b/share/image.c @@ -113,7 +113,9 @@ static GLuint make_texture(const void *p, int w, int h, int b) #ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT int a = config_get_d(CONFIG_ANISO); #endif +#ifdef GL_GENERATE_MIPMAP_SGIS int m = config_get_d(CONFIG_MIPMAP); +#endif int k = config_get_d(CONFIG_TEXTURES); int W = w; int H = h; diff --git a/share/item.c b/share/item.c index 1d49e3b..d1b8aea 100644 --- a/share/item.c +++ b/share/item.c @@ -114,7 +114,7 @@ const struct d_mtrl *item_draw(const struct d_mtrl *mq, item_color(hp, c); - glColor4fv(c); + glColor4f(c[0], c[1], c[2], c[3]); glDepthMask(GL_FALSE); { -- 1.7.9.5