/*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2011 Parallel Realities
+Copyright (C) 2011-2015 Perpendicular Dimensions
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
if (!gameData.stagePreviouslyCleared(game.stageName))
{
+ presentPlayerMedal(game.stageName);
game.stagesCleared++;
}
if (mia->health > 0)
miaFound = false;
- sprintf(string, "MIA_%s", mia->name);
+ snprintf(string, sizeof string, "MIA_%s", mia->name);
if (miaFound)
{
}
game.totalUpStats();
+
+ if (game.totalEnemiesDefeated >= 1000)
+ {
+ presentPlayerMedal("1000_Enemies");
+ }
+
+ if (game.totalEnemiesDefeated >= 2500)
+ {
+ presentPlayerMedal("2500_Enemies");
+ }
}
void clearAllMissionData()
{
char levelMIAKey[100];
- sprintf(levelMIAKey, "%s MIAs", game.stageName);
+ snprintf(levelMIAKey, sizeof levelMIAKey, "%s MIAs", game.stageName);
Data *data = (Data*)gameData.dataList.getHead();
Data *previous = data;
graphics.loadBackground("gfx/main/areaClearBackGround.jpg");
SDL_Surface *panel = graphics.alphaRect(550, 420, 0x00, 0x00, 0x00);
- SDL_SetAlpha(panel, SDL_SRCALPHA|SDL_RLEACCEL, 180);
+ SDL_SetAlpha(panel, 180);
graphics.drawRect(1, 1, panel->w - 2, panel->h - 2 , graphics.black, graphics.white, panel);
graphics.blit(panel, (640 - panel->w) / 2, (480 - panel->h) / 2, graphics.background, false);
- audio.loadSound(0, "sound/pop1.wav");
- audio.loadSound(1, "sound/cheer.wav");
+ audio.loadSound(0, "sound/pop1");
+ audio.loadSound(1, "sound/cheer");
SDL_FillRect(graphics.screen, NULL, graphics.black);
graphics.updateScreen();
int y = 520;
int miaY = 335;
int clearY = 520;
- Objective *objective = (Objective*)map.objectiveList.getHead();
Entity *mia = (Entity*)map.miaList.getHead();
Sprite *teleportStar = graphics.getSprite("TeleportStar", true);
- char message[100];
+ char message[256];
int col1 = 360;
int col2 = 380;
int count = 0;
place += 25;
}
- if (count > colCount)
- count = colCount;
-
if (place > (colCount * 25))
place = colCount * 25;
if (map.totalMIAs > 0)
{
graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
- sprintf(message, _("Rescue %d MIAs"), map.requiredMIAs);
+ snprintf(message, sizeof message, _("Rescue %d MIAs"), map.requiredMIAs);
graphics.drawString(message, col1, y, TXT_RIGHT, graphics.background);
if (map.foundMIAs < map.requiredMIAs)
{
graphics.setFontColor(0xff, 0x00, 0x00, 0x00, 0x00, 0x00);
- sprintf(message, "%d / %d", map.foundMIAs, map.requiredMIAs);
+ snprintf(message, sizeof message, "%d / %d", map.foundMIAs, map.requiredMIAs);
graphics.drawString(message, col2, y, TXT_LEFT, graphics.background);
}
else
}
}
- objective = (Objective*)map.objectiveList.getHead();
+ Objective *objective = (Objective*)map.objectiveList.getHead();
engine.setPlayerPosition(0, 0, -1, -1, -1, -1);
else
{
graphics.setFontColor(0xff, 0x00, 0x00, 0x00, 0x00, 0x00);
- sprintf(message, "%d / %d", objective->currentValue, objective->targetValue);
+ snprintf(message, sizeof message, "%d / %d", objective->currentValue, objective->targetValue);
graphics.drawString(message, col2, y, TXT_LEFT, graphics.background);
}
}
}
}
- sprintf(message, "%s - %.2d:%.2d:%.2d", _("Mission Time"), game.currentMissionHours, game.currentMissionMinutes, game.currentMissionSeconds);
- graphics.drawString(message, 320, 420, true, graphics.screen);
+ static Graphics::SurfaceCache cache;
+ snprintf(message, sizeof message, "%s - %.2d:%.2d:%.2d", _("Mission Time"), game.currentMissionHours, game.currentMissionMinutes, game.currentMissionSeconds);
+ graphics.drawString(message, 320, 420, true, graphics.screen, cache);
engine.delay(frameLimit);
frameLimit = SDL_GetTicks() + 16;