yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::DungeonRenderingHelpers Class Reference

#include <dungeon_rendering_helpers.h>

Classes

struct  CollisionOverlayCache
 
struct  CollisionOverlayEntry
 
struct  TrackCollisionConfig
 

Static Public Member Functions

static TrackDirectionMasks GetTrackDirectionMasksForTrackIndex (size_t index)
 
static TrackDirectionMasks GetTrackDirectionMasksForSwitchIndex (size_t index)
 
static TrackDirectionMasks GetTrackDirectionMasksFromConfig (uint8_t tile, const std::vector< uint16_t > &track_tiles, const std::vector< uint16_t > &track_switches)
 
static void DrawTrackArrowHead (ImDrawList *draw_list, const ImVec2 &tip, TrackDir dir, float size, ImU32 color)
 
static void DrawTrackDirectionMask (ImDrawList *draw_list, const ImVec2 &min, float tile_size, uint8_t mask, ImU32 color)
 
static std::pair< int, int > RoomToCanvasCoordinates (int room_x, int room_y)
 
static bool DrawSpritePreview (ImDrawList *draw_list, const std::vector< uint8_t > &preview, const SDL_Rect &bounds, const ImVec2 &box_min, const ImVec2 &box_max, const std::array< SDL_Color, 256 > &color_table, uint8_t transparent_index=kSpritePreviewTransparentIndex)
 
static const zelda3::SpriteOamLayout * GetPotItemSpriteLayout (uint8_t item_id, uint8_t *out_sprite_id=nullptr)
 
static bool BuildPotItemPreview (uint8_t item_id, const zelda3::Room &room, std::vector< uint8_t > &out_pixels, SDL_Rect &out_bounds)
 
static void DrawTrackCollisionOverlay (ImDrawList *draw_list, const ImVec2 &canvas_pos, float scale, const CollisionOverlayCache &cache, const TrackCollisionConfig &config, bool direction_map_enabled, const std::vector< uint16_t > &track_tile_order, const std::vector< uint16_t > &switch_tile_order, bool show_legend)
 
static void DrawCustomCollisionOverlay (ImDrawList *draw_list, const ImVec2 &canvas_pos, float scale, const zelda3::Room &room)
 
static void DrawWaterFillOverlay (ImDrawList *draw_list, const ImVec2 &canvas_pos, float scale, const zelda3::Room &room)
 
static void DrawCameraQuadrantOverlay (ImDrawList *draw_list, const ImVec2 &canvas_pos, float scale, const zelda3::Room &room)
 
static void DrawMinecartSpriteOverlay (ImDrawList *draw_list, const ImVec2 &canvas_pos, float scale, const zelda3::Room &room, const std::bitset< 256 > &minecart_sprite_ids, const TrackCollisionConfig &config)
 
static void DrawTrackGapOverlay (ImDrawList *draw_list, const ImVec2 &canvas_pos, float scale, const zelda3::Room &room, const CollisionOverlayCache &cache)
 
static void DrawTrackRouteOverlay (ImDrawList *draw_list, const ImVec2 &canvas_pos, float scale, const CollisionOverlayCache &cache)
 

Static Public Attributes

static constexpr uint8_t kSpritePreviewTransparentIndex = 0
 
static constexpr uint8_t kBackgroundBufferTransparentIndex = 255
 

Detailed Description

Definition at line 34 of file dungeon_rendering_helpers.h.

Member Function Documentation

◆ GetTrackDirectionMasksForTrackIndex()

TrackDirectionMasks yaze::editor::DungeonRenderingHelpers::GetTrackDirectionMasksForTrackIndex ( size_t index)
static

◆ GetTrackDirectionMasksForSwitchIndex()

TrackDirectionMasks yaze::editor::DungeonRenderingHelpers::GetTrackDirectionMasksForSwitchIndex ( size_t index)
static

◆ GetTrackDirectionMasksFromConfig()

TrackDirectionMasks yaze::editor::DungeonRenderingHelpers::GetTrackDirectionMasksFromConfig ( uint8_t tile,
const std::vector< uint16_t > & track_tiles,
const std::vector< uint16_t > & track_switches )
static

Definition at line 81 of file dungeon_rendering_helpers.cc.

References GetTrackDirectionMasksForSwitchIndex(), and GetTrackDirectionMasksForTrackIndex().

Referenced by DrawTrackCollisionOverlay().

Here is the call graph for this function:

◆ DrawTrackArrowHead()

void yaze::editor::DungeonRenderingHelpers::DrawTrackArrowHead ( ImDrawList * draw_list,
const ImVec2 & tip,
TrackDir dir,
float size,
ImU32 color )
static

◆ DrawTrackDirectionMask()

void yaze::editor::DungeonRenderingHelpers::DrawTrackDirectionMask ( ImDrawList * draw_list,
const ImVec2 & min,
float tile_size,
uint8_t mask,
ImU32 color )
static

◆ RoomToCanvasCoordinates()

std::pair< int, int > yaze::editor::DungeonRenderingHelpers::RoomToCanvasCoordinates ( int room_x,
int room_y )
static

◆ DrawSpritePreview()

bool yaze::editor::DungeonRenderingHelpers::DrawSpritePreview ( ImDrawList * draw_list,
const std::vector< uint8_t > & preview,
const SDL_Rect & bounds,
const ImVec2 & box_min,
const ImVec2 & box_max,
const std::array< SDL_Color, 256 > & color_table,
uint8_t transparent_index = kSpritePreviewTransparentIndex )
static

◆ GetPotItemSpriteLayout()

◆ BuildPotItemPreview()

bool yaze::editor::DungeonRenderingHelpers::BuildPotItemPreview ( uint8_t item_id,
const zelda3::Room & room,
std::vector< uint8_t > & out_pixels,
SDL_Rect & out_bounds )
static

◆ DrawTrackCollisionOverlay()

void yaze::editor::DungeonRenderingHelpers::DrawTrackCollisionOverlay ( ImDrawList * draw_list,
const ImVec2 & canvas_pos,
float scale,
const CollisionOverlayCache & cache,
const TrackCollisionConfig & config,
bool direction_map_enabled,
const std::vector< uint16_t > & track_tile_order,
const std::vector< uint16_t > & switch_tile_order,
bool show_legend )
static

◆ DrawCustomCollisionOverlay()

void yaze::editor::DungeonRenderingHelpers::DrawCustomCollisionOverlay ( ImDrawList * draw_list,
const ImVec2 & canvas_pos,
float scale,
const zelda3::Room & room )
static

◆ DrawWaterFillOverlay()

void yaze::editor::DungeonRenderingHelpers::DrawWaterFillOverlay ( ImDrawList * draw_list,
const ImVec2 & canvas_pos,
float scale,
const zelda3::Room & room )
static

Definition at line 473 of file dungeon_rendering_helpers.cc.

References yaze::editor::AgentUI::GetTheme(), and yaze::zelda3::Room::water_fill_zone().

Referenced by yaze::editor::DungeonCanvasViewer::DrawRoomCanvasOverlays().

Here is the call graph for this function:

◆ DrawCameraQuadrantOverlay()

void yaze::editor::DungeonRenderingHelpers::DrawCameraQuadrantOverlay ( ImDrawList * draw_list,
const ImVec2 & canvas_pos,
float scale,
const zelda3::Room & room )
static

Definition at line 506 of file dungeon_rendering_helpers.cc.

References yaze::editor::AgentUI::GetTheme(), and yaze::zelda3::Room::layout_id().

Referenced by yaze::editor::DungeonCanvasViewer::DrawRoomCanvasOverlays().

Here is the call graph for this function:

◆ DrawMinecartSpriteOverlay()

void yaze::editor::DungeonRenderingHelpers::DrawMinecartSpriteOverlay ( ImDrawList * draw_list,
const ImVec2 & canvas_pos,
float scale,
const zelda3::Room & room,
const std::bitset< 256 > & minecart_sprite_ids,
const TrackCollisionConfig & config )
static

◆ DrawTrackGapOverlay()

void yaze::editor::DungeonRenderingHelpers::DrawTrackGapOverlay ( ImDrawList * draw_list,
const ImVec2 & canvas_pos,
float scale,
const zelda3::Room & room,
const CollisionOverlayCache & cache )
static

◆ DrawTrackRouteOverlay()

void yaze::editor::DungeonRenderingHelpers::DrawTrackRouteOverlay ( ImDrawList * draw_list,
const ImVec2 & canvas_pos,
float scale,
const CollisionOverlayCache & cache )
static

Member Data Documentation

◆ kSpritePreviewTransparentIndex

constexpr uint8_t yaze::editor::DungeonRenderingHelpers::kSpritePreviewTransparentIndex = 0
staticconstexpr

Definition at line 52 of file dungeon_rendering_helpers.h.

◆ kBackgroundBufferTransparentIndex

constexpr uint8_t yaze::editor::DungeonRenderingHelpers::kBackgroundBufferTransparentIndex = 255
staticconstexpr

The documentation for this class was generated from the following files: