From ab0fd9455c468666d04afc1d768e2df433e235e1 Mon Sep 17 00:00:00 2001 From: josh Date: Mon, 7 Apr 2025 14:30:30 -0400 Subject: [PATCH] More Edits --- Client/include/Client/MainMenu.hpp | 2 +- Client/src/Client/AssetService.cpp | 2 +- Client/src/Client/MainMenu.cpp | 5 +++-- Client/src/Client/Player.cpp | 4 ++-- ClientApp/assets/data/generator.json | 8 +++++++- ClientApp/assets/data/manifest.json | 7 ++++++- ClientApp/assets/textures/gill_potion.png | Bin 0 -> 402 bytes Core/include/Core/Generator.hpp | 3 +-- Core/src/Core/Loggers.cpp | 4 ++++ 9 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 ClientApp/assets/textures/gill_potion.png diff --git a/Client/include/Client/MainMenu.hpp b/Client/include/Client/MainMenu.hpp index 613d05c..c32d131 100644 --- a/Client/include/Client/MainMenu.hpp +++ b/Client/include/Client/MainMenu.hpp @@ -46,7 +46,7 @@ namespace CaveGame::Client JUI::Rect* title = nullptr; JUI::Rect* button_group = nullptr; JUI::Rect* changelog = nullptr; - JGL::Texture* bg = nullptr; // TODO: RAII on this + std::shared_ptr bg = nullptr; // TODO: RAII on this Vector2 mpos {0,0}; Vector2 goal {0,0}; diff --git a/Client/src/Client/AssetService.cpp b/Client/src/Client/AssetService.cpp index 5adc11c..19e05a0 100644 --- a/Client/src/Client/AssetService.cpp +++ b/Client/src/Client/AssetService.cpp @@ -62,7 +62,7 @@ bool CaveGame::Client::AssetService::LoadAsset(const CaveGame::Client::AssetRequ if (textures.contains(request.name)) // TODO: Note repeat request. return true; - auto texture =std::make_shared(request.path); + auto texture = std::make_shared(request.path, FilteringMode::NEAREST); textures[request.name] = texture; } default: { diff --git a/Client/src/Client/MainMenu.cpp b/Client/src/Client/MainMenu.cpp index 7320f94..bc31950 100644 --- a/Client/src/Client/MainMenu.cpp +++ b/Client/src/Client/MainMenu.cpp @@ -35,7 +35,7 @@ void CaveGame::Client::MainMenu::Draw() { void CaveGame::Client::MainMenu::Load() { - bg = new JGL::Texture("assets/textures/bg.png"); + bg = AssetService::Get()->GetTexture("bg"); Scene::Load(); @@ -86,7 +86,8 @@ void CaveGame::Client::MainMenu::BuildWidgets() { title->BorderWidth(0); auto* content = new JUI::Image(title); - content->Content(Client::AssetService::Get()->title_img); + // TODO: Unsafe! + content->Content(AssetService::Get()->GetTexture("title").get()); content->FitImageToParent(true); button_group = new Rect(scene); diff --git a/Client/src/Client/Player.cpp b/Client/src/Client/Player.cpp index 9871720..fbcc0dd 100644 --- a/Client/src/Client/Player.cpp +++ b/Client/src/Client/Player.cpp @@ -39,8 +39,8 @@ void CaveGame::Core::Player::Draw() { // TODO: Utilize land quad when falling enough to take fall damage, player can't move for a half second. - auto myAsset = Client::AssetService::Get()->player_sprite; - JGL::J2D::DrawPartialSprite(myAsset, RenderTopLeft(), quad.minPoint, {16, 24}, 0, {0,0}, {1,1}, Colors::White, dir); + auto myAsset = Client::AssetService::Get()->GetTexture("player"); + JGL::J2D::DrawPartialSprite(myAsset.get(), RenderTopLeft(), quad.minPoint, {16, 24}, 0, {0,0}, {1,1}, Colors::White, dir); JGL::J2D::OutlineRect(Colors::Red, RenderTopLeft(), texture_center * 2.f); JGL::J2D::OutlineRect(Colors::Blue, TopLeft(), bounding_box); J2D::DrawString(Colors::White, std::format("vel: {},{}", Math::Round(velocity.x, 2), Math::Round(velocity.y, 2)), position.x, position.y-8, 0.5f, 8); diff --git a/ClientApp/assets/data/generator.json b/ClientApp/assets/data/generator.json index 0e0dcd2..2715b2c 100644 --- a/ClientApp/assets/data/generator.json +++ b/ClientApp/assets/data/generator.json @@ -1,3 +1,9 @@ { - + "veins": { + "clay": { + "hi-pass-scale-x": 200, + "hi-pass-scale-y": 205, + "hi-pass-offset": 0 + } + } } \ No newline at end of file diff --git a/ClientApp/assets/data/manifest.json b/ClientApp/assets/data/manifest.json index e608fc6..35ec48e 100644 --- a/ClientApp/assets/data/manifest.json +++ b/ClientApp/assets/data/manifest.json @@ -5,7 +5,12 @@ ["bg", "assets/textures/bg.png"], ["explosion", "assets/textures/explosion.png"], ["redacted", "assets/textures/redacted.png"], - ["title_1", "assets/textures/title_1.png"] + ["title", "assets/textures/title_1.png"], + ["gill_potion", "assets/textures/gill_potion.png"], + ["honey_jar", "assets/textures/honey_jar.png"], + ["hp_potion", "assets/textures/hp_potion.png"], + ["hp_potion_2x", "assets/textures/hp_potion_2x.png"], + ["hp_potion_3x", "assets/textures/hp_potion_3x.png"] ], "music": [ diff --git a/ClientApp/assets/textures/gill_potion.png b/ClientApp/assets/textures/gill_potion.png new file mode 100644 index 0000000000000000000000000000000000000000..98b2e16a9432fb4a83202b8e1a3a6ad383bd6c84 GIT binary patch literal 402 zcmV;D0d4+?P)4Sm2B!G`x&H~g z??jcpD9A~%i1Bi~xtF%ut7+NCX%fmxf`+RJ8cZSE) zzkn1mGH6$WXa