/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ #include "stageclearhandler.hpp" #include "SDL.h" #include #include #include //paths std::string stageClearSavePath; std::vector stageCleared(nrOfStageLevels); //vector that tells if a stage is cleared std::vector stageTimes(nrOfStageLevels); //For statistical puposes std::vector stageScores(nrOfStageLevels); //--||-- Uint32 totalScore = 0; Uint32 totalTime = 0; using namespace std; void StageClearSetClear(int Level, int score, int time) { stageCleared[Level] = true; int gameEndedAfter = time; if (stageScores[Level](&tempBool), sizeof(bool)); } for (int i=0; i(&tempUInt32), sizeof(Uint32)); } for (int i=0; i(&tempUInt32), sizeof(Uint32)); } outfile.close(); } } void LoadStageClearStages() { bool tempBool; Uint32 tempUInt32; ifstream stageFile(stageClearSavePath.c_str(),ios::binary); if (stageFile) { for (int i = 0; i(&tempBool),sizeof(bool)); stageCleared[i]=tempBool; } if (!stageFile.eof()) { for (int i=0; i(&tempUInt32),sizeof(Uint32)); } stageScores[i]=tempUInt32; totalScore+=tempUInt32; } for (int i=0; i(&tempUInt32),sizeof(Uint32)); } stageTimes[i]=tempUInt32; totalTime += tempUInt32; } } else { for (int i=0; i