fixed renderhud:drawscope() buggy OpenGL code
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4823 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+30
-13
@@ -95,19 +95,36 @@ void drawscope()
|
||||
x2 = VIRTW/2 + w/2;
|
||||
float s1 = VIRTW/16, s2 = VIRTH/24;
|
||||
glDisable(GL_BLEND);
|
||||
glColor3ub(0, 0, 0);
|
||||
glBegin(GL_TRIANGLE_FAN);
|
||||
glVertex2f( 0, 0); glVertex2f(VIRTW, 0); glVertex2f(VIRTW, 4*s2); glVertex2f( 0, 4*s2);
|
||||
glVertex2f( 0, 4*s2); glVertex2f( 3*s1, 4*s2); glVertex2f( 3*s1, 20*s2); glVertex2f( 0, 20*s2);
|
||||
glVertex2f( 0, 20*s2); glVertex2f(VIRTW, 20*s2); glVertex2f(VIRTW, VIRTH); glVertex2f( 0, VIRTH);
|
||||
glVertex2f(13*s1, 4*s2); glVertex2f(VIRTW, 4*s2); glVertex2f(VIRTW, 20*s2); glVertex2f(13*s1,20*s2);
|
||||
glEnd();
|
||||
glBegin(GL_TRIANGLES);
|
||||
glVertex2f( 3*s1, 3*s2); glVertex2f( 7*s1, 3*s2); glVertex2f( 3*s1, 9*s2);
|
||||
glVertex2f( 9*s1, 3*s2); glVertex2f(14*s1, 3*s2); glVertex2f(14*s1, 9*s2);
|
||||
glVertex2f(14*s1,15*s2); glVertex2f(14*s1,20*s2); glVertex2f( 9*s1,20*s2);
|
||||
glVertex2f( 7*s1,20*s2); glVertex2f( 3*s1,20*s2); glVertex2f( 3*s1,15*s2);
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glColor3ub( 0, 0, 0);
|
||||
//glColor3ub(255, 0, 0);
|
||||
glVertex2f( 0, 0);
|
||||
glVertex2f(VIRTW, 0);
|
||||
glVertex2f(VIRTW, 4*s2);
|
||||
glVertex2f( 0, 4*s2);
|
||||
|
||||
glVertex2f( 0, 4*s2);
|
||||
glVertex2f(3*s1, 4*s2);
|
||||
glVertex2f(3*s1,20*s2);
|
||||
glVertex2f( 0,20*s2);
|
||||
|
||||
glVertex2f( 0, 20*s2);
|
||||
glVertex2f(VIRTW, 20*s2);
|
||||
glVertex2f(VIRTW, VIRTH);
|
||||
glVertex2f( 0, VIRTH);
|
||||
|
||||
glVertex2f(13*s1, 4*s2);
|
||||
glVertex2f(VIRTW, 4*s2);
|
||||
glVertex2f(VIRTW,20*s2);
|
||||
glVertex2f(13*s1,20*s2);
|
||||
glEnd();
|
||||
glBegin(GL_TRIANGLES);
|
||||
glVertex2f( 3*s1, 3*s2); glVertex2f( 7*s1, 3*s2); glVertex2f( 3*s1, 9*s2);
|
||||
glVertex2f( 9*s1, 3*s2); glVertex2f(14*s1, 3*s2); glVertex2f(14*s1, 9*s2);
|
||||
glVertex2f(14*s1,15*s2); glVertex2f(14*s1,20*s2); glVertex2f( 9*s1,20*s2);
|
||||
glVertex2f( 7*s1,20*s2); glVertex2f( 3*s1,20*s2); glVertex2f( 3*s1,15*s2);
|
||||
glEnd();
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBindTexture(GL_TEXTURE_2D, scopetex->id);
|
||||
|
||||
Reference in New Issue
Block a user