Commit bc47c7c2 authored by pickle136's avatar pickle136

Duplicate int count declaration removed

parent f1bbcd3a
......@@ -34,9 +34,9 @@
#include "io/gfx/video.h"
#include "io/sound.h"
#include "player/levelplayer.h"
#include "util.h"
#include <stdlib.h>
#include "util.h"
#include <stdlib.h>
signed char* Event::prepareStep (unsigned int ticks, int msps) {
......@@ -82,7 +82,7 @@ signed char* Event::prepareStep (unsigned int ticks, int msps) {
Event* Event::step (unsigned int ticks, int msps) {
LevelPlayer* levelPlayer;
fixed width, height;
signed char* set;
......@@ -95,9 +95,9 @@ Event* Event::step (unsigned int ticks, int msps) {
if (!set) return remove();
levelPlayer = localPlayer->getLevelPlayer();
// Find dimensions
width = getWidth();
height = getHeight();
......@@ -161,7 +161,7 @@ Event* Event::step (unsigned int ticks, int msps) {
case 6:
int count = level->path[set[E_MULTIPURPOSE]].node;
count = level->path[set[E_MULTIPURPOSE]].node;
// Use the path from the level file
dx = TTOF(gridX) + ITOF(level->path[set[E_MULTIPURPOSE]].x[count]) - x;
......@@ -873,15 +873,15 @@ Event* Event::step (unsigned int ticks, int msps) {
if (level->getStage() == LS_END) return this;
if ((animType == E_LFINISHANIM) || (animType == E_RFINISHANIM)) return this;
if ((animType == E_LFINISHANIM) || (animType == E_RFINISHANIM)) return this;
// Handle contact with player
for (count = 0; count < nPlayers; count++) {
levelPlayer = players[count].getLevelPlayer();
// Check if the player is touching the event
fixed offset = 0;
......@@ -932,9 +932,9 @@ void Event::draw (unsigned int ticks, int change) {
bool drawExplosion;
if (next) next->draw(ticks, change);
if (next) next->draw(ticks, change);
// Uncomment the following to see the area of the event
/*drawRect(FTOI(getDrawX(change) - viewX),
FTOI(getDrawY(change) - (viewY + getHeight())), FTOI(getWidth()),
......@@ -1029,8 +1029,8 @@ void Event::draw (unsigned int ticks, int change) {
// In case an event can be drawn normally
if (ticks < flashTime) anim->flashPalette(0);
if (ticks < flashTime) anim->flashPalette(0);
anim->draw(changeX, changeY);
}
......@@ -1049,51 +1049,51 @@ void Event::draw (unsigned int ticks, int change) {
}
return;
}
void Event::drawEnergy (unsigned int ticks) {
Anim* anim;
signed char* set;
int hits;
// Get the event properties
set = level->getEvent(gridX, gridY);
if (set[E_MODIFIER] != 8) {
if (next) next->drawEnergy(ticks);
} else if (set[E_HITSTOKILL]) {
// Draw boss energy bar
hits = level->getEventHits(gridX, gridY) * 100 / set[E_HITSTOKILL];
// Devan head
anim = level->getMiscAnim(1);
anim->setFrame(0, true);
if (ticks < flashTime) anim->flashPalette(0);
anim->draw(ITOF(viewW - 44), ITOF(hits + 48));
if (ticks < flashTime) anim->restorePalette();
// Bar
drawRect(viewW - 40, hits + 40, 12, 100 - hits, (ticks < flashTime)? 0: 32);
}
return;
void Event::drawEnergy (unsigned int ticks) {
Anim* anim;
signed char* set;
int hits;
// Get the event properties
set = level->getEvent(gridX, gridY);
if (set[E_MODIFIER] != 8) {
if (next) next->drawEnergy(ticks);
} else if (set[E_HITSTOKILL]) {
// Draw boss energy bar
hits = level->getEventHits(gridX, gridY) * 100 / set[E_HITSTOKILL];
// Devan head
anim = level->getMiscAnim(1);
anim->setFrame(0, true);
if (ticks < flashTime) anim->flashPalette(0);
anim->draw(ITOF(viewW - 44), ITOF(hits + 48));
if (ticks < flashTime) anim->restorePalette();
// Bar
drawRect(viewW - 40, hits + 40, 12, 100 - hits, (ticks < flashTime)? 0: 32);
}
return;
}
......@@ -1121,4 +1121,4 @@ void Event::dontUseAnimOffset() {
return;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment