fix ogl gr_ucircle (d1x r1.29)

This commit is contained in:
Bradley Bell 2004-05-19 03:41:58 +00:00
parent 217f1a7e91
commit 693717b603
2 changed files with 9 additions and 21 deletions

View file

@ -1,5 +1,7 @@
2004-05-18 Bradley Bell <btb@icculus.org>
* arch/ogl/ogl.c: fix ogl gr_ucircle (d1x r1.29)
* arch/ogl/gr.c: fix off-by-one error in ogl_urect, right and
bottom are inclusive not exclusive (d1x r1.28)

View file

@ -1,4 +1,4 @@
/* $Id: ogl.c,v 1.16 2004-05-19 03:29:04 btb Exp $ */
/* $Id: ogl.c,v 1.17 2004-05-19 03:41:58 btb Exp $ */
/*
*
* Graphics support functions for OpenGL.
@ -88,8 +88,6 @@ int ogl_sgis_multitexture_ok=0;
#endif
int sphereh=0;
int circleh5=0;
int circleh10=0;
int cross_lh[2]={0,0};
int primary_lh[3]={0,0,0};
int secondary_lh[5]={0,0,0,0,0};
@ -146,8 +144,6 @@ void ogl_init_texture_list_internal(void){
void ogl_smash_texture_list_internal(void){
int i;
sphereh=0;
circleh5=0;
circleh10=0;
memset(cross_lh,0,sizeof(cross_lh));
memset(primary_lh,0,sizeof(primary_lh));
memset(secondary_lh,0,sizeof(secondary_lh));
@ -586,28 +582,18 @@ int g3_draw_sphere(g3s_point *pnt,fix rad){
return 0;
}
int gr_ucircle(fix xc1,fix yc1,fix r1){//dunno if this really works, radar doesn't seem to.. hm..
int gr_ucircle(fix xc1, fix yc1, fix r1)
{
int c;
c=grd_curcanv->cv_color;
OGL_DISABLE(TEXTURE_2D);
// glPointSize(f2glf(rad));
glColor3f(CPAL2Tr(c),CPAL2Tg(c),CPAL2Tb(c));
// glBegin(GL_POINTS);
// glVertex3f(f2glf(pnt->p3_vec.x),f2glf(pnt->p3_vec.y),-f2glf(pnt->p3_vec.z));
// glEnd();
glPushMatrix();
glmprintf((0,"circle: %f(%i),%f(%i),%f\n",(f2fl(xc1)+grd_curcanv->cv_bitmap.bm_x)/(float)last_width,f2i(xc1),(f2fl(yc1)+grd_curcanv->cv_bitmap.bm_y)/(float)last_height,f2i(yc1),f2fl(r1)));
glTranslatef(
(f2fl(xc1)+grd_curcanv->cv_bitmap.bm_x)/(float)last_width,
1.0-(f2fl(yc1)+grd_curcanv->cv_bitmap.bm_y)/(float)last_height,0);
glScalef(f2fl(r1),f2fl(r1),f2fl(r1));
if (r1<=i2f(5)){
if (!circleh5) circleh5=circle_list_init(5,GL_LINE_LOOP,GL_COMPILE_AND_EXECUTE);
else glCallList(circleh5);
}else{
if (!circleh10) circleh10=circle_list_init(10,GL_LINE_LOOP,GL_COMPILE_AND_EXECUTE);
else glCallList(circleh10);
}
(f2fl(xc1) + grd_curcanv->cv_bitmap.bm_x + 0.5) / (float)last_width,
1.0 - (f2fl(yc1) + grd_curcanv->cv_bitmap.bm_y + 0.5) / (float)last_height,0);
glScalef(f2fl(r1) / last_width, f2fl(r1) / last_height, 1.0);
ogl_drawcircle(10 + 2 * (int)(M_PI * f2fl(r1) / 19), GL_LINE_LOOP);
glPopMatrix();
return 0;
}