diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a19489..518f9d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,6 @@ find_package(entt CONFIG REQUIRED) find_package(SDL3 CONFIG REQUIRED) find_package(SDL3_ttf CONFIG REQUIRED) -find_package(spdlog CONFIG REQUIRED) add_executable(HansTheGatherer src/main.cpp @@ -42,6 +41,6 @@ add_executable(HansTheGatherer src/render.cpp ) -target_link_libraries(HansTheGatherer SDL3::SDL3 SDL3_ttf::SDL3_ttf EnTT spdlog::spdlog) +target_link_libraries(HansTheGatherer SDL3::SDL3 SDL3_ttf::SDL3_ttf EnTT) set_property(TARGET HansTheGatherer PROPERTY CXX_STANDARD 20) diff --git a/src/assets.cpp b/src/assets.cpp index 6550881..3148517 100644 --- a/src/assets.cpp +++ b/src/assets.cpp @@ -3,7 +3,6 @@ #include "definitions.hpp" #include -#include static constexpr uint8_t BACKGROUND_DATA[] = { #embed "../assets/images/jungle.bmp" @@ -43,13 +42,13 @@ SDL_Texture* load_texture(uint8_t const* data, size_t size, SDL_Renderer* render SDL_Surface* surface = SDL_LoadBMP_IO(iostream, false); if (surface == nullptr) { - spdlog::error("Failed to load SDL surface!\nCause: {}", SDL_GetError()); + // spdlog::error("Failed to load SDL surface!\nCause: {}", SDL_GetError()); } SDL_Texture* texture = SDL_CreateTextureFromSurface(renderer, surface); if (texture == nullptr) { - spdlog::error("Failed to create texture from surface!\nCause: {}", SDL_GetError()); + // spdlog::error("Failed to create texture from surface!\nCause: {}", SDL_GetError()); } return texture; @@ -64,7 +63,7 @@ AudioAsset load_audio(uint8_t const* data, size_t size) iostream, false, &audio_asset.spec, &audio_asset.buffer, &audio_asset.buffer_length); if (!res) { - spdlog::error("Failed to load audio file!\nCause: {}", SDL_GetError()); + // spdlog::error("Failed to load audio file!\nCause: {}", SDL_GetError()); } return audio_asset; } diff --git a/src/level.cpp b/src/level.cpp index edaa096..105a775 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -1,8 +1,6 @@ #include "level.hpp" #include "input.hpp" -#include - void LevelModule::MoveBasket(entt::registry& registry) { auto const& input = registry.ctx().get(); diff --git a/src/level.hpp b/src/level.hpp index a481e70..82951b1 100644 --- a/src/level.hpp +++ b/src/level.hpp @@ -5,7 +5,6 @@ #include "sprite.hpp" #include -#include struct Background { diff --git a/src/main.cpp b/src/main.cpp index e1ff835..464b086 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,7 +8,6 @@ #include #include #include -#include void increment_ticks(entt::registry& registry) { @@ -28,13 +27,13 @@ void increment_ticks(entt::registry& registry) int main() { - spdlog::info("Initialize SDL..."); + // spdlog::info("Initialize SDL..."); SDL_SetHint(SDL_HINT_RENDER_VSYNC, "1"); if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)) { - spdlog::critical("Failed to initialize SDL!\nCause: {}", SDL_GetError()); + // spdlog::critical("Failed to initialize SDL!\nCause: {}", SDL_GetError()); std::terminate(); } @@ -43,13 +42,13 @@ int main() auto* window = SDL_CreateWindow("HansTheGatherer", WINDOW_WIDTH, WINDOW_HEIGHT, 0); if (window == nullptr) { - spdlog::critical("Failed to create SDL window!\nCause: {}", SDL_GetError()); + // spdlog::critical("Failed to create SDL window!\nCause: {}", SDL_GetError()); } auto* renderer = SDL_CreateRenderer(window, nullptr); if (renderer == nullptr) { - spdlog::critical("Failed to create SDL renderer!\nCause: {}", SDL_GetError()); + // spdlog::critical("Failed to create SDL renderer!\nCause: {}", SDL_GetError()); } auto* text_engine = TTF_CreateRendererTextEngine(renderer); @@ -105,13 +104,16 @@ int main() } AudioModule::FeedAudioStreams(registry); - - increment_ticks(registry); - LevelModule::MoveBasket(registry); - LevelModule::SpawnFruits(registry); - LevelModule::CollectFruit(registry); - LevelModule::CollectSpider(registry); - // LevelModule::DespawnItems(registry); + + if (registry.ctx().get().time != 0) + { + increment_ticks(registry); + LevelModule::MoveBasket(registry); + LevelModule::SpawnFruits(registry); + LevelModule::CollectFruit(registry); + LevelModule::CollectSpider(registry); + // LevelModule::DespawnItems(registry); + } PhysicsModule::TranslatePhysicsObject(registry); PhysicsModule::PropagatePosition(registry); diff --git a/src/physics.cpp b/src/physics.cpp index b63b313..fcd4f61 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -1,8 +1,6 @@ #include "physics.hpp" #include "level.hpp" -#include - void PhysicsModule::TranslatePhysicsObject(entt::registry& registry) { auto view = registry.view();