diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index bd7ef6f3..4c18175f 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -91,6 +91,15 @@ std::vector>BULLET_LIST; safemapGFX; utils::datafile DATA; AiL*game; +#undef KEY_LEFT //Stupid Linux +#undef KEY_RIGHT //Stupid Linux +#undef KEY_UP //Stupid Linux +#undef KEY_DOWN //Stupid Linux +#undef KEY_MENU //Stupid Linux +#undef KEY_SCROLLUP //Stupid Linux +#undef KEY_SCROLLDOWN //Stupid Linux +#undef KEY_BACK //Stupid Linux +#undef KEY_SELECT //Stupid Linux InputGroup AiL::KEY_LEFT; InputGroup AiL::KEY_RIGHT; InputGroup AiL::KEY_UP; @@ -2925,4 +2934,4 @@ std::string operator ""_FS(const char*key,std::size_t len){ void AiL::DisableFadeIn(const bool disable){ disableFadeIn=disable; -} \ No newline at end of file +} diff --git a/Adventures in Lestoria/DamageNumber.cpp b/Adventures in Lestoria/DamageNumber.cpp index aaf22b9d..b294b11f 100644 --- a/Adventures in Lestoria/DamageNumber.cpp +++ b/Adventures in Lestoria/DamageNumber.cpp @@ -57,7 +57,7 @@ void DamageNumber::RecalculateSize(){ float damageMultRatio=damage/game->GetPlayer()->GetBaseStat("Attack")/2.f; riseSpd=originalRiseSpd; if(!friendly){ - float newSize=std::clamp(round(damageMultRatio),1.0f,4.0f); + float newSize=std::clamp(roundf(damageMultRatio),1.0f,4.0f); if(type==HEALTH_LOSS||type==CRIT)riseSpd*=newSize; diff --git a/CMakeLists.txt b/CMakeLists.txt index b93890b4..d59b8343 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,9 @@ cmake_minimum_required(VERSION 3.10) # project("Adventures in Lestoria") -add_compile_options("-s" "USE_FREETYPE=1") +if (EMSCRIPTEN) + add_compile_options("-s" "USE_FREETYPE=1") +endif() add_compile_options("-O2") # Options you can set via command-line @@ -84,6 +86,12 @@ file( GLOB SOURCE_CXX_FILES "${SOURCE_CXX_SRC_DIR}/*.cpp" ) +file( + GLOB SOURCE_CXX_FILES2 + "${SOURCE_CXX_SRC_DIR}/discord-files/*.cpp" +) + +list(APPEND SOURCE_CXX_FILES ${SOURCE_CXX_FILES2}) # Search in the "cmake" directory for additional CMake modules. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) @@ -244,6 +252,13 @@ if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN) target_link_libraries(${OutputExecutable} Threads::Threads) include_directories(${Threads_INCLUDE_DIRS}) + find_package(Freetype REQUIRED) + target_link_libraries(${OutputExecutable} ${FREETYPE_LIBRARIES}) + target_include_directories(${OutputExecutable} PRIVATE ${FREETYPE_INCLUDE_DIRS}) + + target_include_directories(${OutputExecutable} PRIVATE "${C_CXX_SOURCES_DIR}/discord-files") + link_directories("Adventures in Lestoria") + # TODO: sanity checks if(USE_ALSA) @@ -276,7 +291,12 @@ if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN) include_directories(${PNG_INCLUDE_DIRS}) # stdc++fs - target_link_libraries(${OutputExecutable} stdc++fs) + target_link_libraries(${OutputExecutable} stdc++fs) + target_link_options( + ${OutputExecutable} + PRIVATE + -g + "Adventures in Lestoria/discord_game_sdk.so") endif() # Linux @@ -284,7 +304,6 @@ endif() # Linux # Emscripten ###################################################################### if (EMSCRIPTEN) - # Generate an HTML file set(CMAKE_EXECUTABLE_SUFFIX .html)