Arreglos varios al codi

This commit is contained in:
2024-10-08 22:38:58 +02:00
parent 3e3d764b25
commit bd3aa0bb06
30 changed files with 177 additions and 227 deletions
+8 -14
View File
@@ -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");