diff --git a/src/app/editor/overworld/entity.cc b/src/app/editor/overworld/entity.cc index 3459dc33..30ddba97 100644 --- a/src/app/editor/overworld/entity.cc +++ b/src/app/editor/overworld/entity.cc @@ -15,6 +15,8 @@ using ImGui::SameLine; using ImGui::Selectable; using ImGui::Text; +constexpr float kInputFieldSize = 30.f; + bool IsMouseHoveringOverEntity(const zelda3::GameEntity &entity, ImVec2 canvas_p0, ImVec2 scrolling) { // Get the mouse position relative to the canvas diff --git a/src/app/editor/overworld/entity.h b/src/app/editor/overworld/entity.h index 168058bd..7a2904a3 100644 --- a/src/app/editor/overworld/entity.h +++ b/src/app/editor/overworld/entity.h @@ -3,7 +3,6 @@ #include "imgui/imgui.h" -#include "app/editor/overworld/overworld_editor.h" #include "app/zelda3/common.h" #include "app/zelda3/overworld/overworld.h" @@ -85,4 +84,4 @@ bool DrawSpriteEditorPopup(zelda3::Sprite &sprite); } // namespace app } // namespace yaze -#endif // YAZE_APP_EDITOR_OVERWORLD_ENTITY_H \ No newline at end of file +#endif // YAZE_APP_EDITOR_OVERWORLD_ENTITY_H diff --git a/src/app/editor/overworld/overworld_editor.cc b/src/app/editor/overworld/overworld_editor.cc index 864010c2..fdc7a64e 100644 --- a/src/app/editor/overworld/overworld_editor.cc +++ b/src/app/editor/overworld/overworld_editor.cc @@ -997,6 +997,11 @@ void OverworldEditor::DrawOverworldSprites() { current_sprite_ = sprite; } } + if (sprite_previews_[sprite.id()].is_active()) { + ow_map_canvas_.DrawBitmap(sprite_previews_[sprite.id()], map_x, map_y, + 2.0f); + } + ow_map_canvas_.DrawText(absl::StrFormat("%s", sprite.name()), map_x, map_y); } @@ -1108,8 +1113,11 @@ absl::Status OverworldEditor::LoadSpriteGraphics() { for (auto const &sprite : overworld_.sprites(i)) { int width = sprite.width(); int height = sprite.height(); - int depth = 0x40; + int depth = 0x10; auto spr_gfx = sprite.PreviewGraphics(); + if (spr_gfx.empty() || width == 0 || height == 0) { + continue; + } sprite_previews_[sprite.id()].Create(width, height, depth, spr_gfx); RETURN_IF_ERROR(sprite_previews_[sprite.id()].ApplyPalette(palette_)); Renderer::GetInstance().RenderBitmap(&(sprite_previews_[sprite.id()]));