Updated game speed

This commit is contained in:
2025-08-16 08:24:26 +02:00
parent d161b2c550
commit 71648fbaeb
20 changed files with 690 additions and 334 deletions

View File

@ -33,8 +33,39 @@ add_executable(tetris
# State implementations (new)
src/states/LoadingState.cpp
src/states/MenuState.cpp
src/states/PlayingState.cpp
)
if (WIN32)
# Embed the application icon into the executable
set_source_files_properties(src/app_icon.rc PROPERTIES LANGUAGE RC)
target_sources(tetris PRIVATE src/app_icon.rc)
endif()
if (WIN32)
# Ensure favicon.ico is available in the build directory for the resource compiler
set(FAVICON_SRC "${CMAKE_SOURCE_DIR}/assets/favicon/favicon.ico")
set(FAVICON_DEST "${CMAKE_BINARY_DIR}/favicon.ico")
if(EXISTS ${FAVICON_SRC})
add_custom_command(
OUTPUT ${FAVICON_DEST}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FAVICON_SRC} ${FAVICON_DEST}
DEPENDS ${FAVICON_SRC}
COMMENT "Copy favicon.ico to build dir for resource compilation"
)
add_custom_target(copy_favicon ALL DEPENDS ${FAVICON_DEST})
add_dependencies(tetris copy_favicon)
else()
message(WARNING "Favicon not found at ${FAVICON_SRC}; app icon may not compile")
endif()
# Also copy favicon into the runtime output folder (same dir as exe)
add_custom_command(TARGET tetris POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FAVICON_SRC} $<TARGET_FILE_DIR:tetris>/favicon.ico
COMMENT "Copy favicon.ico next to executable"
)
endif()
target_link_libraries(tetris PRIVATE SDL3::SDL3 SDL3_ttf::SDL3_ttf)
if (WIN32)