Arreglos varios al codi
This commit is contained in:
@@ -1,21 +1,15 @@
|
||||
#include "manage_hiscore_table.h"
|
||||
#include <SDL2/SDL_error.h> // for SDL_GetError
|
||||
#include <SDL2/SDL_rwops.h> // for SDL_RWread, SDL_RWwrite, SDL_RWFromFile
|
||||
#include <stdlib.h> // for free, malloc
|
||||
#include <algorithm> // for sort
|
||||
#include <iostream> // for basic_ostream, char_traits, operator<<
|
||||
#include "utils.h" // for hiScoreEntry_t
|
||||
#include <SDL2/SDL_error.h> // for SDL_GetError
|
||||
#include <SDL2/SDL_rwops.h> // for SDL_RWread, SDL_RWwrite, SDL_RWFromFile
|
||||
#include <stdlib.h> // for free, malloc
|
||||
#include <algorithm> // for sort
|
||||
#include <iostream> // for basic_ostream, char_traits, operator<<
|
||||
#include "utils.h" // for hiScoreEntry_t
|
||||
|
||||
// Constructor
|
||||
ManageHiScoreTable::ManageHiScoreTable(std::vector<hiScoreEntry_t> *table)
|
||||
{
|
||||
this->table = table;
|
||||
}
|
||||
: table(table) {}
|
||||
|
||||
// Destructor
|
||||
ManageHiScoreTable::~ManageHiScoreTable()
|
||||
{
|
||||
}
|
||||
|
||||
// Resetea la tabla a los valores por defecto
|
||||
void ManageHiScoreTable::clear()
|
||||
@@ -67,7 +61,7 @@ void ManageHiScoreTable::sort()
|
||||
bool ManageHiScoreTable::loadFromFile(std::string filePath)
|
||||
{
|
||||
clear();
|
||||
|
||||
|
||||
bool success = true;
|
||||
const std::string filename = filePath.substr(filePath.find_last_of("\\/") + 1);
|
||||
SDL_RWops *file = SDL_RWFromFile(filePath.c_str(), "r+b");
|
||||
|
||||
Reference in New Issue
Block a user