tidy-fix automàtic (sense naming)
This commit is contained in:
+7
-5
@@ -26,7 +26,7 @@
|
||||
#include "core/system/director.hpp"
|
||||
#include "game/options.hpp"
|
||||
|
||||
SDL_AppResult SDL_AppInit(void** /*appstate*/, int /*argc*/, char* /*argv*/[]) {
|
||||
auto SDL_AppInit(void** /*appstate*/, int /*argc*/, char* /*argv*/[]) -> SDL_AppResult {
|
||||
srand(unsigned(time(nullptr)));
|
||||
|
||||
// Crea la carpeta de configuració i carrega les opcions
|
||||
@@ -37,7 +37,7 @@ SDL_AppResult SDL_AppInit(void** /*appstate*/, int /*argc*/, char* /*argv*/[]) {
|
||||
// (retorna Contents/Resources/) o en un executable normal (carpeta del binari).
|
||||
const char* base_path = SDL_GetBasePath();
|
||||
std::string resource_pack_path;
|
||||
if (base_path) {
|
||||
if (base_path != nullptr) {
|
||||
const std::string data_path = std::string(base_path) + "data/";
|
||||
file_setresourcefolder(data_path.c_str());
|
||||
resource_pack_path = std::string(base_path) + "resources.pack";
|
||||
@@ -109,7 +109,7 @@ SDL_AppResult SDL_AppInit(void** /*appstate*/, int /*argc*/, char* /*argv*/[]) {
|
||||
return SDL_APP_CONTINUE;
|
||||
}
|
||||
|
||||
SDL_AppResult SDL_AppIterate(void* /*appstate*/) {
|
||||
auto SDL_AppIterate(void* /*appstate*/) -> SDL_AppResult {
|
||||
// Una iteració del bucle del Director. Abans els events es drenaven
|
||||
// amb SDL_PollEvent dins d'aquesta funció; ara SDL ens els lliura
|
||||
// d'un en un via SDL_AppEvent, així que iterate() no els toca.
|
||||
@@ -119,8 +119,10 @@ SDL_AppResult SDL_AppIterate(void* /*appstate*/) {
|
||||
return SDL_APP_CONTINUE;
|
||||
}
|
||||
|
||||
SDL_AppResult SDL_AppEvent(void* /*appstate*/, SDL_Event* event) {
|
||||
if (!event) return SDL_APP_CONTINUE;
|
||||
auto SDL_AppEvent(void* /*appstate*/, SDL_Event* event) -> SDL_AppResult {
|
||||
if (event == nullptr) {
|
||||
return SDL_APP_CONTINUE;
|
||||
}
|
||||
Director::get()->handleEvent(*event);
|
||||
if (Director::get()->isQuitRequested()) {
|
||||
return SDL_APP_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user