renombrades extensions .h a .hpp
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
#include "demo.h"
|
||||
#include "demo.hpp"
|
||||
|
||||
#include <SDL3/SDL.h> // Para SDL_IOStream, SDL_IOFromConstMem, SDL_IOFromFile, SDL_ReadIO, SDL_WriteIO, SDL_CloseIO
|
||||
#include <stdexcept> // Para runtime_error
|
||||
#include <SDL3/SDL.h> // Para SDL_IOStream, SDL_IOFromConstMem, SDL_IOFromFile, SDL_ReadIO, SDL_WriteIO, SDL_CloseIO
|
||||
|
||||
#include "resource_helper.h" // Para ResourceHelper
|
||||
#include "utils.h" // Para printWithDots, getFileName
|
||||
#include <stdexcept> // Para runtime_error
|
||||
|
||||
#include "resource_helper.hpp" // Para ResourceHelper
|
||||
#include "utils.hpp" // Para printWithDots, getFileName
|
||||
|
||||
// Carga el fichero de datos para la demo
|
||||
auto loadDemoDataFromFile(const std::string &file_path) -> DemoData {
|
||||
auto loadDemoDataFromFile(const std::string& file_path) -> DemoData {
|
||||
DemoData dd;
|
||||
|
||||
SDL_IOStream *file = nullptr;
|
||||
SDL_IOStream* file = nullptr;
|
||||
|
||||
// Intentar cargar desde ResourceHelper primero
|
||||
auto resource_data = ResourceHelper::loadFile(file_path);
|
||||
@@ -42,13 +43,13 @@ auto loadDemoDataFromFile(const std::string &file_path) -> DemoData {
|
||||
|
||||
#ifdef RECORDING
|
||||
// Guarda el fichero de datos para la demo
|
||||
bool saveDemoFile(const std::string &file_path, const DemoData &dd) {
|
||||
bool saveDemoFile(const std::string& file_path, const DemoData& dd) {
|
||||
auto success = true;
|
||||
auto file = SDL_IOFromFile(file_path.c_str(), "w+b");
|
||||
|
||||
if (file) {
|
||||
// Guarda los datos
|
||||
for (const auto &data : dd) {
|
||||
for (const auto& data : dd) {
|
||||
if (SDL_WriteIO(file, &data, sizeof(DemoKeys)) != sizeof(DemoKeys)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error al escribir el fichero %s", getFileName(file_path).c_str());
|
||||
success = false;
|
||||
|
||||
Reference in New Issue
Block a user