diff --git a/.gitignore b/.gitignore index 87cff5c..639e5c3 100644 --- a/.gitignore +++ b/.gitignore @@ -17,12 +17,17 @@ asteroids *.exe *.out *.app +tools/pack_resources/pack_resources +tools/pack_resources/pack_resources.exe # Releases *.zip *.tar.gz *.dmg +# Generated resources +resources.pack + # Compiled Object files *.o *.obj diff --git a/Makefile b/Makefile index dc0bfc9..3178d09 100644 --- a/Makefile +++ b/Makefile @@ -81,8 +81,8 @@ resources.pack: pack_tool # BUILD TARGETS (delegate to CMake) # ============================================================================== -# Default target: build with CMake -all: $(TARGET_FILE) +# Default target: build with CMake + resources +all: resources.pack $(TARGET_FILE) $(TARGET_FILE): @cmake -B build -DCMAKE_BUILD_TYPE=Release diff --git a/resources.pack b/resources.pack deleted file mode 100644 index 888fd68..0000000 Binary files a/resources.pack and /dev/null differ diff --git a/source/core/rendering/sdl_manager.cpp b/source/core/rendering/sdl_manager.cpp index e3cea8d..d2d72b9 100644 --- a/source/core/rendering/sdl_manager.cpp +++ b/source/core/rendering/sdl_manager.cpp @@ -433,11 +433,13 @@ void SDLManager::updateFPS(float delta_time) { fps_accumulator_ = 0.0f; // Actualitzar títol de la finestra - std::string title = std::format("{} v{} ({}) - {} FPS", + std::string vsync_state = (Options::rendering.vsync == 1) ? "ON" : "OFF"; + std::string title = std::format("{} v{} ({}) - {} FPS - VSync: {}", Project::LONG_NAME, Project::VERSION, Project::COPYRIGHT, - fps_display_); + fps_display_, + vsync_state); if (finestra_) { SDL_SetWindowTitle(finestra_, title.c_str()); @@ -462,6 +464,10 @@ void SDLManager::toggleVSync() { SDL_SetRenderVSync(renderer_, Options::rendering.vsync); } + // Reset FPS counter para evitar valores mixtos entre regímenes + fps_accumulator_ = 0.0f; + fps_frame_count_ = 0; + // Guardar configuració Options::saveToFile(); } diff --git a/tools/pack_resources/pack_resources b/tools/pack_resources/pack_resources deleted file mode 100755 index 2715f9a..0000000 Binary files a/tools/pack_resources/pack_resources and /dev/null differ