Clean global variables.

This commit is contained in:
yunfeibai
2016-11-29 11:11:41 -08:00
parent d48b03f23b
commit 5fe36ca200
4 changed files with 47 additions and 159 deletions

View File

@@ -4,10 +4,6 @@
#include "our_gl.h"
#include "Bullet3Common/b3MinMax.h"
extern int indexmap[10000000];
extern int count;
extern bool setindex;
IShader::~IShader() {}
Matrix viewport(int x, int y, int w, int h)
@@ -144,10 +140,6 @@ void triangle(mat<4,3,float> &clipc, IShader &shader, TGAImage &image, float *zb
Vec3f bc_clip = Vec3f(bc_screen.x/pts[0][3], bc_screen.y/pts[1][3], bc_screen.z/pts[2][3]);
bc_clip = bc_clip/(bc_clip.x+bc_clip.y+bc_clip.z);
float frag_depth = -1*(clipc[2]*bc_clip);
if (setindex)
{
indexmap[count] = P.x+P.y*image.get_width();
}
if (bc_screen.x<0 || bc_screen.y<0 || bc_screen.z<0 ||
zbuffer[P.x+P.y*image.get_width()]>frag_depth)
continue;