1#ifndef YAZE_APP_EDITOR_OVERWORLD_ENTITY_OPERATIONS_H
2#define YAZE_APP_EDITOR_OVERWORLD_ENTITY_OPERATIONS_H
4#include "absl/status/statusor.h"
10#include "imgui/imgui.h"
44 zelda3::Overworld* overworld, ImVec2 mouse_pos,
int current_map,
45 bool is_hole =
false);
61absl::StatusOr<zelda3::OverworldExit*>
InsertExit(
62 zelda3::Overworld* overworld, ImVec2 mouse_pos,
int current_map);
80 zelda3::Overworld* overworld, ImVec2 mouse_pos,
int current_map,
81 int game_state, uint8_t sprite_id = 0);
97absl::StatusOr<zelda3::OverworldItem*>
InsertItem(
98 zelda3::Overworld* overworld, ImVec2 mouse_pos,
int current_map,
108 uint8_t parent = map->
parent();
109 return (parent == 0xFF) ?
static_cast<uint8_t
>(current_map) : parent;
117 static_cast<float>(
static_cast<int>(pos.x / 16) * 16),
118 static_cast<float>(
static_cast<int>(pos.y / 16) * 16)
127 std::clamp(pos.x, 0.0f, 4080.0f),
128 std::clamp(pos.y, 0.0f, 4080.0f)
Represents a single Overworld map screen.
absl::StatusOr< zelda3::OverworldItem * > InsertItem(zelda3::Overworld *overworld, ImVec2 mouse_pos, int current_map, uint8_t item_id)
Insert a new item at the specified position.
absl::StatusOr< zelda3::OverworldEntrance * > InsertEntrance(zelda3::Overworld *overworld, ImVec2 mouse_pos, int current_map, bool is_hole)
Flat helper functions for entity insertion/manipulation.
absl::StatusOr< zelda3::OverworldExit * > InsertExit(zelda3::Overworld *overworld, ImVec2 mouse_pos, int current_map)
Insert a new exit at the specified position.
ImVec2 SnapToEntityGrid(ImVec2 pos)
Snap position to 16x16 grid (standard entity positioning)
absl::StatusOr< zelda3::Sprite * > InsertSprite(zelda3::Overworld *overworld, ImVec2 mouse_pos, int current_map, int game_state, uint8_t sprite_id)
Insert a new sprite at the specified position.
ImVec2 ClampToOverworldBounds(ImVec2 pos)
Clamp position to valid overworld bounds.
uint8_t GetParentMapId(const zelda3::OverworldMap *map, int current_map)
Helper to get parent map ID for multi-area maps.
Main namespace for the application.