Commit bc47c7c2 authored by pickle136's avatar pickle136

Duplicate int count declaration removed

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