5#include "absl/strings/str_format.h"
9#include "imgui/imgui.h"
22 return ImVec4{1.0f, 1.0f, 0.0f, 1.0f};
25 return ImVec4{1.0f, 1.0f, 1.0f, 1.0f};
28 return ImVec4{1.0f, 0.0f, 0.0f, 1.0f};
31 return ImVec4{1.0f, 0.0f, 1.0f, 1.0f};
34 return ImVec4{0.6f, 0.4f, 0.2f, 0.5f};
46 if (each.map_id_ < 0x40 + (current_world * 0x40) &&
47 each.map_id_ >= (current_world * 0x40) && !each.deleted) {
50 entrance_color.w = 0.78f;
69 if (each.map_id_ < 0x40 + (current_world * 0x40) &&
70 each.map_id_ >= (current_world * 0x40) && !each.deleted_) {
86 if (item.room_map_id_ < 0x40 + (current_world * 0x40) &&
87 item.room_map_id_ >= (current_world * 0x40) && !item.deleted) {
92 std::string item_name =
"";
96 item_name = absl::StrFormat(
"0x%02X", item.id_);
104 int current_world,
int game_state) {
106 if (!sprite.deleted() && sprite.map_id() < 0x40 + (current_world * 0x40) &&
107 sprite.map_id() >= (current_world * 0x40)) {
108 int sprite_x = sprite.x_;
109 int sprite_y = sprite.y_;
125 gui::DrawText(rt, absl::StrFormat(
"%s", sprite.name()), sprite_x,
142 if (each.map_id_ < 0x40 + (current_world * 0x40) &&
143 each.map_id_ >= (current_world * 0x40) && !each.deleted) {
148 entrance_color.w = 0.78f;
163 int current_world,
int current_mode) {
171 if (each.map_id_ < 0x40 + (current_world * 0x40) &&
172 each.map_id_ >= (current_world * 0x40) && !each.deleted_) {
192 if (item.room_map_id_ < 0x40 + (current_world * 0x40) &&
193 item.room_map_id_ >= (current_world * 0x40) && !item.deleted) {
201 std::string item_name =
"";
205 item_name = absl::StrFormat(
"0x%02X", item.id_);
219 if (!sprite.deleted() && sprite.map_id() < 0x40 + (current_world * 0x40) &&
220 sprite.map_id() >= (current_world * 0x40)) {
223 int sprite_x = sprite.x_;
224 int sprite_y = sprite.y_;
227 int original_x = sprite.x_;
228 int original_y = sprite.y_;
247 sprite.x_ = original_x;
248 sprite.y_ = original_y;
266 int map_x = (current_map % 8) * 32;
267 int map_y = (current_map / 8) * 32;
270 for (
int ty = 0; ty < 32; ++ty) {
271 for (
int tx = 0; tx < 32; ++tx) {
272 int world_tx = map_x + tx;
273 int world_ty = map_y + ty;
277 if (world_ty >= 256 || world_tx >= 256) {
281 uint16_t tile_id = map_tiles[world_ty][world_tx];
284 if (diggable_tiles.IsDiggable(tile_id)) {
286 int pixel_x = world_tx * 16;
287 int pixel_y = world_ty * 16;
zelda3::GameEntity * hovered_entity_
void DrawDiggableTileHighlights(int current_world, int current_map)
Draw highlights for all diggable tiles on the current map.
zelda3::Overworld * overworld_
void DrawItems(const gui::CanvasRuntime &rt, int current_world)
void DrawExits(const gui::CanvasRuntime &rt, int current_world)
void DrawSprites(const gui::CanvasRuntime &rt, int current_world, int game_state)
void DrawEntrances(const gui::CanvasRuntime &rt, int current_world)
std::vector< gfx::Bitmap > * sprite_previews_
bool show_diggable_tiles_
void DrawBitmap(Bitmap &bitmap, int border_offset, float scale)
auto global_scale() const
void DrawRect(int x, int y, int w, int h, ImVec4 color)
void DrawText(const std::string &text, int x, int y)
auto mutable_sprites(int state)
const DiggableTiles & diggable_tiles() const
const std::vector< OverworldEntrance > & entrances() const
OverworldBlockset & GetMapTiles(int world_type)
ImVec4 GetDiggableTileColor()
bool IsMouseHoveringOverEntity(const zelda3::GameEntity &entity, ImVec2 canvas_p0, ImVec2 scrolling, float scale)
Check if mouse is hovering over an entity.
void DrawRect(const CanvasRuntime &rt, int x, int y, int w, int h, ImVec4 color)
ImVec4 GetEntranceColor()
void DrawText(const CanvasRuntime &rt, const std::string &text, int x, int y)
std::string HexByte(uint8_t byte, HexStringParams params)
const std::vector< std::string > kSecretItemNames
bool kDrawOverworldSprites
struct yaze::core::FeatureFlags::Flags::Overworld overworld