From 5788123ab5c6f69546fa7b4b33e210281dd2c378 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sun, 11 Feb 2024 21:48:03 -0600 Subject: [PATCH] Linux build fixes. Public declaration for game controllers array, properly initialize dynamic counters and their display values, fix story script to have capital I's, renamed images to be uppercase for case-sensitivity in Linux. --- .gitignore | 1 + Adventures in Lestoria/AdventuresInLestoria.cpp | 6 +++--- Adventures in Lestoria/DynamicCounter.cpp | 1 + .../assets/config/story/Chapter 1.txt | 8 ++++---- .../assets/npcs/{greg.png => Greg.png} | Bin .../assets/npcs/{sherman.png => Sherman.png} | Bin Adventures in Lestoria/olcPGEX_Gamepad.h | 6 ++++++ debugGame.sh | 4 ++++ 8 files changed, 19 insertions(+), 7 deletions(-) rename Adventures in Lestoria/assets/npcs/{greg.png => Greg.png} (100%) rename Adventures in Lestoria/assets/npcs/{sherman.png => Sherman.png} (100%) create mode 100755 debugGame.sh diff --git a/.gitignore b/.gitignore index 8f887476..bee7a5a5 100644 --- a/.gitignore +++ b/.gitignore @@ -395,3 +395,4 @@ build/CMakeFiles/3.16.3/CMakeSystem.cmake build/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp test.cpp +/Adventures in Lestoria/Adventures in Lestoria diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 8509d30d..16ac9a2e 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -231,9 +231,6 @@ bool AiL::OnUserCreate(){ InitializeLevels(); - healthCounter.Initialize(&player->hp,"Interface.HUD Health Tick Rate"_F,"Interface.HUD Health Display Color"_Pixel,"Interface.HUD Heal Damage Color"_Pixel,"Interface.HUD Take Damage Color"_Pixel,"Interface.HUD Health Change Time"_F); - manaCounter.Initialize(&player->mana,"Interface.HUD Mana Tick Rate"_F,"Interface.HUD Mana Display Color"_Pixel,"Interface.HUD Restore Mana Color"_Pixel,"Interface.HUD Reduce Mana Color"_Pixel,"Interface.HUD Mana Change Time"_F); - //Initialize Camera. camera=Camera2D{WINDOW_SIZE}; camera.SetMode(olc::utils::Camera2D::Mode::LazyFollow); @@ -247,6 +244,9 @@ bool AiL::OnUserCreate(){ player=std::make_unique(); + healthCounter.Initialize(&player->hp,"Interface.HUD Health Tick Rate"_F,"Interface.HUD Health Display Color"_Pixel,"Interface.HUD Heal Damage Color"_Pixel,"Interface.HUD Take Damage Color"_Pixel,"Interface.HUD Health Change Time"_F); + manaCounter.Initialize(&player->mana,"Interface.HUD Mana Tick Rate"_F,"Interface.HUD Mana Display Color"_Pixel,"Interface.HUD Restore Mana Color"_Pixel,"Interface.HUD Reduce Mana Color"_Pixel,"Interface.HUD Mana Change Time"_F); + InitializePlayerLevelCap(); InitializeGraphics(); diff --git a/Adventures in Lestoria/DynamicCounter.cpp b/Adventures in Lestoria/DynamicCounter.cpp index 1fe46205..54f19341 100644 --- a/Adventures in Lestoria/DynamicCounter.cpp +++ b/Adventures in Lestoria/DynamicCounter.cpp @@ -46,6 +46,7 @@ DynamicCounter::DynamicCounter(){} void DynamicCounter::Initialize(const int*number,float tickRate,Pixel originalCol,Pixel increaseCol,Pixel decreaseCol,float colorChangeTime){ this->targetNumber=number; + this->displayNumber=*number; this->tickRate=tickRate; this->originalCol=originalCol; this->increaseCol=increaseCol; diff --git a/Adventures in Lestoria/assets/config/story/Chapter 1.txt b/Adventures in Lestoria/assets/config/story/Chapter 1.txt index e661a090..5215bd4c 100644 --- a/Adventures in Lestoria/assets/config/story/Chapter 1.txt +++ b/Adventures in Lestoria/assets/config/story/Chapter 1.txt @@ -152,7 +152,7 @@ Since you're doing Slime hunting anyways, might as well search for the Stone in [You] -I am on my way to the Forest anyways. I can check any cave I come across and if I find any #FFBF00Red Stone#FFFFFF i will report back. +I am on my way to the Forest anyways. I can check any cave I come across and if I find any #FFBF00Red Stone#FFFFFF I will report back. No promises though. My main goal is slime hunting, but I will see what I can do to help. @@ -168,7 +168,7 @@ Have your memories returned? [Sherman] -Well, I definitely remember a few things but i still need to sort myself out. I can't really tell you more than what I've said yesterday. +Well, I definitely remember a few things but I still need to sort myself out. I can't really tell you more than what I've said yesterday. [You] @@ -263,7 +263,7 @@ Maybe I'll leave the forest for now and think up a plan before I explore again. {PAUSE} -Hey, If you're looking for me, i will be at #00FFD0Merchant Crossing#FFFFFF. Offering my skills as a #ADADADBlacksmith#FFFFFF to Merchants. +Hey, If you're looking for me, I will be at #00FFD0Merchant Crossing#FFFFFF. Offering my skills as a #ADADADBlacksmith#FFFFFF to Merchants. [You] @@ -275,7 +275,7 @@ You explain to Greg what happened at the crossing. [Greg] -That's not good. You said you built a small camp nearby? Guess i will go there for now then. +That's not good. You said you built a small camp nearby? Guess I will go there for now then. If you need any weapons or armour, you can find me there. diff --git a/Adventures in Lestoria/assets/npcs/greg.png b/Adventures in Lestoria/assets/npcs/Greg.png similarity index 100% rename from Adventures in Lestoria/assets/npcs/greg.png rename to Adventures in Lestoria/assets/npcs/Greg.png diff --git a/Adventures in Lestoria/assets/npcs/sherman.png b/Adventures in Lestoria/assets/npcs/Sherman.png similarity index 100% rename from Adventures in Lestoria/assets/npcs/sherman.png rename to Adventures in Lestoria/assets/npcs/Sherman.png diff --git a/Adventures in Lestoria/olcPGEX_Gamepad.h b/Adventures in Lestoria/olcPGEX_Gamepad.h index 5c7f5b33..389a9cb9 100644 --- a/Adventures in Lestoria/olcPGEX_Gamepad.h +++ b/Adventures in Lestoria/olcPGEX_Gamepad.h @@ -240,11 +240,17 @@ namespace olc { bool ff = false; #ifdef __EMSCRIPTEN__ public: +#endif +#ifdef __linux__ + public: #endif bool availableButtons[GP_BUTTON_COUNT] = {false}; bool availableAxes[GP_AXIS_COUNT] = {false}; #ifdef __EMSCRIPTEN__ private: +#endif +#ifdef __linux__ + private: #endif float deadZone=0.2f; float deadZoneOuter=0.2f; diff --git a/debugGame.sh b/debugGame.sh new file mode 100755 index 00000000..bfbc04cc --- /dev/null +++ b/debugGame.sh @@ -0,0 +1,4 @@ +cd "Adventures in Lestoria" +mkdir "Adventures in Lestoria" +cp "discord_game_sdk.so" "Adventures in Lestoria" +gdb ../bin/AdventuresInLestoria