Sanejar codi

This commit is contained in:
2025-02-21 14:45:41 +01:00
parent ec73c5fa30
commit 6bb877b510
10 changed files with 98 additions and 107 deletions

View File

@@ -41,8 +41,10 @@
#endif
// Constructor
Director::Director(int argc, char *argv[])
Director::Director(int argc, const char *argv[])
{
std::cout << "Game start" << std::endl;
section = new section_t();
section->name = SECTION_LOGO;
section->subsection = SUBSECTION_LOGO_TO_INTRO;
@@ -112,6 +114,8 @@ Director::~Director()
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
std::cout << "\nBye!" << std::endl;
}
// Crea e inicializa las opciones del programa
@@ -165,7 +169,7 @@ void Director::initOptions()
}
// Comprueba los parametros del programa
void Director::checkProgramArguments(int argc, char *argv[])
void Director::checkProgramArguments(int argc, const char *argv[])
{
// Establece la ruta del programa
executablePath = argv[0];
@@ -360,7 +364,7 @@ bool Director::saveConfig()
}
else
{
file << "filter=FILTER_LINEAL\n";
file << "filter=FILTER_LINEAR\n";
}
file << "shaders=" + boolToString(options->shaders) + "\n";
@@ -1081,9 +1085,9 @@ bool Director::setOptions(options_t *options, std::string var, std::string value
else if (var == "filter")
{
if (value == "FILTER_LINEAL")
if (value == "FILTER_LINEAR")
{
options->filter = FILTER_LINEAL;
options->filter = FILTER_LINEAR;
}
else
{
@@ -1843,7 +1847,7 @@ void Director::runGame()
resource->free();
}
void Director::run()
int Director::run()
{
// Bucle principal
while (section->name != SECTION_QUIT)
@@ -1887,4 +1891,6 @@ void Director::run()
break;
}
}
return 0;
}