canviat Options de struct a namespace
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
#include <fstream> // Para basic_ostream, operator<<, basic_ofstream
|
||||
#include <iostream> // Para cout, cerr
|
||||
|
||||
#include "game/gameplay/options.hpp" // Para Options, options
|
||||
#include "game/ui/notifier.hpp" // Para Notifier
|
||||
#include "game/gameplay/options.hpp" // Para Options, options
|
||||
#include "game/ui/notifier.hpp" // Para Notifier
|
||||
|
||||
// [SINGLETON]
|
||||
Cheevos* Cheevos::cheevos_ = nullptr;
|
||||
@@ -102,7 +102,7 @@ void Cheevos::loadFromFile() {
|
||||
|
||||
// El fichero no existe
|
||||
if (!file) {
|
||||
if (options.console) {
|
||||
if (Options::console) {
|
||||
std::cout << "Warning: Unable to open " << file_ << "! Creating new file..." << std::endl;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ void Cheevos::loadFromFile() {
|
||||
std::ofstream newFile(file_, std::ios::binary);
|
||||
|
||||
if (newFile) {
|
||||
if (options.console) {
|
||||
if (Options::console) {
|
||||
std::cout << "New " << file_ << " created!" << std::endl;
|
||||
}
|
||||
|
||||
@@ -119,14 +119,14 @@ void Cheevos::loadFromFile() {
|
||||
newFile.write(reinterpret_cast<const char*>(&cheevo.completed), sizeof(bool));
|
||||
}
|
||||
} else {
|
||||
if (options.console) {
|
||||
if (Options::console) {
|
||||
std::cerr << "Error: Unable to create " << file_ << "!" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
// El fichero existe
|
||||
else {
|
||||
if (options.console) {
|
||||
if (Options::console) {
|
||||
std::cout << "Reading " << file_ << std::endl;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ void Cheevos::saveToFile() {
|
||||
// Cierra el fichero
|
||||
SDL_CloseIO(file);
|
||||
} else {
|
||||
if (options.console) {
|
||||
if (Options::console) {
|
||||
std::cout << "Error: Unable to save file! " << SDL_GetError() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user