More Edits

This commit is contained in:
2025-04-07 14:30:30 -04:00
parent b7b06cd48b
commit ab0fd9455c
9 changed files with 25 additions and 10 deletions

View File

@@ -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<JGL::Texture> bg = nullptr; // TODO: RAII on this
Vector2 mpos {0,0};
Vector2 goal {0,0};

View File

@@ -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<Texture>(request.path);
auto texture = std::make_shared<Texture>(request.path, FilteringMode::NEAREST);
textures[request.name] = texture;
}
default: {

View File

@@ -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);

View File

@@ -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);

View File

@@ -1,3 +1,9 @@
{
"veins": {
"clay": {
"hi-pass-scale-x": 200,
"hi-pass-scale-y": 205,
"hi-pass-offset": 0
}
}
}

View File

@@ -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": [

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

View File

@@ -162,7 +162,6 @@ namespace CaveGame::Core
unsigned int ColorMap(int range, int wx, int wy);
// TODO: Implement SecondPass, the catch is, it **may** need to load an arbitrary amount of adjacent chunks to correctly place structures.
// TODO: Expert Mode: How do we keep it threaded separately while still accomplishing the above?
@@ -183,7 +182,7 @@ namespace CaveGame::Core
float GetPrecomputedWhiteNoise2D(int x, int y) const;
protected:
int seed = 0;
int seed = 42069;
SimplexNoise simplex;
PerlinNoise perlin;

View File

@@ -108,6 +108,8 @@ namespace CaveGame::Logs {
SetIncludeTimestampAll(false);
}
// TODO: This is duplicated here and in ReCaveGame::Loggers.cpp
// Bring into jlog as utility functions.
std::string format_timestamp(Timestamp ts) {
return std::format(
"{}-{}-{} {}:{}:{}.{}",
@@ -120,6 +122,8 @@ namespace CaveGame::Logs {
ts.Millisecond().count());
}
// TODO: This is duplicated here and in ReCaveGame::Loggers.cpp
// Bring into jlog as utility functions.
std::string format_source_location(const std::source_location &location) {
return std::format("{} @ {}:{}", location.function_name(), location.file_name(), location.line());
}