//Functions
void Sprite::Draw()
{
- int i, j, k;
+ int k;
static float M[16];
static XYZ point;
static float distancemult;
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask(0);
glAlphaFunc(GL_GREATER, 0.0001);
- for (i = 0; i < sprites.size(); i++) {
+ for (unsigned i = 0; i < sprites.size(); i++) {
if (lasttype != sprites[i]->type) {
switch (sprites[i]->type) {
case cloudsprite:
glPopMatrix();
}
tempmult = multiplier;
- for (i = sprites.size() - 1; i >= 0; i--) {
+ for (unsigned i = sprites.size() - 1; i >= 0; i--) {
multiplier = tempmult;
if (sprites[i]->type != snowsprite) {
sprites[i]->position += sprites[i]->velocity * multiplier;
float rotationpoint;
int whichtri;
- for (j = 0; j < numplayers; j++) {
- if (!spritehit && player[j].dead && sprites[i]->alivetime > .1) {
+ for (unsigned j = 0; j < Person::players.size(); j++) {
+ if (!spritehit && Person::players[j]->dead && sprites[i]->alivetime > .1) {
where = sprites[i]->oldposition;
- where -= player[j].coords;
- if (!player[j].skeleton.free)
- where = DoRotation(where, 0, -player[j].yaw, 0);
+ where -= Person::players[j]->coords;
+ if (!Person::players[j]->skeleton.free)
+ where = DoRotation(where, 0, -Person::players[j]->yaw, 0);
startpoint = where;
where = sprites[i]->position;
- where -= player[j].coords;
- if (!player[j].skeleton.free)
- where = DoRotation(where, 0, -player[j].yaw, 0);
+ where -= Person::players[j]->coords;
+ if (!Person::players[j]->skeleton.free)
+ where = DoRotation(where, 0, -Person::players[j]->yaw, 0);
endpoint = where;
movepoint = 0;
rotationpoint = 0;
- whichtri = player[j].skeleton.drawmodel.LineCheck(&startpoint, &endpoint, &footpoint, &movepoint, &rotationpoint);
+ whichtri = Person::players[j]->skeleton.drawmodel.LineCheck(&startpoint, &endpoint, &footpoint, &movepoint, &rotationpoint);
if (whichtri != -1) {
spritehit = 1;
- player[j].DoBloodBigWhere(0, 160, sprites[i]->oldposition);
+ Person::players[j]->DoBloodBigWhere(0, 160, sprites[i]->oldposition);
DeleteSprite(i);
}
}
if (whichpatchx > 0 && whichpatchz > 0 && whichpatchx < subdivision && whichpatchz < subdivision)
if (terrain.patchobjectnum[whichpatchx][whichpatchz]) {
if (!spritehit)
- for (j = 0; j < terrain.patchobjectnum[whichpatchx][whichpatchz]; j++) {
+ for (int j = 0; j < terrain.patchobjectnum[whichpatchx][whichpatchz]; j++) {
k = terrain.patchobjects[whichpatchx][whichpatchz][j];
start = sprites[i]->oldposition;
end = sprites[i]->position;
DeleteSprite(i);
}
if (check)
- for (i = sprites.size() - 1; i >= 0; i--) {
+ for (unsigned i = sprites.size() - 1; i >= 0; i--) {
sprites[i]->oldposition = sprites[i]->position;
}
glAlphaFunc(GL_GREATER, 0.0001);