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

Represents an overworld exit that transitions from dungeon to overworld. More...

#include <overworld_exit.h>

Inheritance diagram for yaze::zelda3::OverworldExit:
Collaboration diagram for yaze::zelda3::OverworldExit:

Public Member Functions

 OverworldExit ()=default
 
 OverworldExit (uint16_t room_id, uint8_t map_id, uint16_t vram_location, uint16_t y_scroll, uint16_t x_scroll, uint16_t player_y, uint16_t player_x, uint16_t camera_y, uint16_t camera_x, uint8_t scroll_mod_y, uint8_t scroll_mod_x, uint16_t door_type_1, uint16_t door_type_2, bool deleted=false)
 Constructor for loading exits from ROM.
 
void UpdateMapProperties (uint16_t map_id, const void *context) override
 Update exit properties when moved or map changes.
 
- Public Member Functions inherited from yaze::zelda3::GameEntity
auto set_x (int x)
 
auto set_y (int y)
 
 GameEntity ()=default
 
virtual ~GameEntity ()
 

Public Attributes

uint16_t y_scroll_
 
uint16_t x_scroll_
 
uint16_t y_player_
 
uint16_t x_player_
 
uint16_t y_camera_
 
uint16_t x_camera_
 
uint8_t scroll_mod_y_
 
uint8_t scroll_mod_x_
 
uint16_t door_type_1_
 
uint16_t door_type_2_
 
uint16_t room_id_
 
uint16_t map_pos_
 
bool is_hole_ = false
 
bool deleted_ = false
 
bool is_automatic_
 
- Public Attributes inherited from yaze::zelda3::GameEntity
enum yaze::zelda3::GameEntity::EntityType entity_type_
 
int x_ = 0
 
int y_ = 0
 
int game_x_ = 0
 
int game_y_ = 0
 
int entity_id_ = 0
 
uint16_t map_id_ = 0
 

Additional Inherited Members

- Public Types inherited from yaze::zelda3::GameEntity
enum  EntityType {
  kEntrance = 0 , kExit = 1 , kItem = 2 , kSprite = 3 ,
  kTransport = 4 , kMusic = 5 , kTilemap = 6 , kProperties = 7 ,
  kDungeonSprite = 8
}
 

Detailed Description

Represents an overworld exit that transitions from dungeon to overworld.

Coordinate System (inherited from GameEntity):

  • x_, y_: World pixel coordinates (ZScream: PlayerX/PlayerY)
  • game_x_, game_y_: Map-local tile coordinates (ZScream: AreaX/AreaY)
  • map_id_: Parent map ID (ZScream: MapID)

Exit-Specific Properties:

  • x_player_, y_player_: Player spawn position in world (saved to ROM)
  • x_scroll_, y_scroll_: Camera scroll position
  • x_camera_, y_camera_: Camera center position
  • room_id_: Target dungeon room ID (ZScream: RoomID)
  • is_automatic_: If true, scroll/camera auto-calculated from player position (ZScream: IsAutomatic)

ZScream Reference: ExitOW.cs, ExitMode.cs

Definition at line 69 of file overworld_exit.h.

Constructor & Destructor Documentation

◆ OverworldExit() [1/2]

yaze::zelda3::OverworldExit::OverworldExit ( )
default

◆ OverworldExit() [2/2]

yaze::zelda3::OverworldExit::OverworldExit ( uint16_t room_id,
uint8_t map_id,
uint16_t vram_location,
uint16_t y_scroll,
uint16_t x_scroll,
uint16_t player_y,
uint16_t player_x,
uint16_t camera_y,
uint16_t camera_x,
uint8_t scroll_mod_y,
uint8_t scroll_mod_x,
uint16_t door_type_1,
uint16_t door_type_2,
bool deleted = false )
inline

Constructor for loading exits from ROM.

Matches ZScream ExitOW.cs constructor (lines 129-167)

CRITICAL: Does NOT modify map_id parameter (Bug 1 fix) Uses temporary normalized_map_id for calculations only.

Definition at line 98 of file overworld_exit.h.

References yaze::zelda3::GameEntity::entity_type_, yaze::zelda3::GameEntity::game_x_, yaze::zelda3::GameEntity::game_y_, yaze::zelda3::GameEntity::kExit, yaze::zelda3::GameEntity::map_id_, yaze::zelda3::GameEntity::x_, and yaze::zelda3::GameEntity::y_.

Member Function Documentation

◆ UpdateMapProperties()

void yaze::zelda3::OverworldExit::UpdateMapProperties ( uint16_t map_id,
const void * context )
overridevirtual

Update exit properties when moved or map changes.

Parameters
map_idParent map ID to update to
contextPointer to const Overworld for area size queries (can be nullptr for vanilla)

Recalculates:

  • game_x_/game_y_ (map-local tile coords)
  • x_scroll_/y_scroll_ (if is_automatic_ = true)
  • x_camera_/y_camera_ (if is_automatic_ = true)
  • map_pos_ (VRAM location)

ZScream equivalent: ExitOW.cs:206-318 (UpdateMapStuff)

Implements yaze::zelda3::GameEntity.

Definition at line 64 of file overworld_exit.cc.

References yaze::zelda3::GameEntity::game_x_, yaze::zelda3::GameEntity::game_y_, is_automatic_, yaze::zelda3::LargeArea, yaze::zelda3::GameEntity::map_id_, map_pos_, yaze::zelda3::Overworld::overworld_map(), yaze::zelda3::TallArea, yaze::zelda3::WideArea, yaze::zelda3::GameEntity::x_, x_camera_, x_player_, x_scroll_, yaze::zelda3::GameEntity::y_, y_camera_, y_player_, and y_scroll_.

Here is the call graph for this function:

Member Data Documentation

◆ y_scroll_

uint16_t yaze::zelda3::OverworldExit::y_scroll_

Definition at line 71 of file overworld_exit.h.

Referenced by yaze::editor::DrawExitEditorPopup(), and UpdateMapProperties().

◆ x_scroll_

uint16_t yaze::zelda3::OverworldExit::x_scroll_

Definition at line 72 of file overworld_exit.h.

Referenced by yaze::editor::DrawExitEditorPopup(), and UpdateMapProperties().

◆ y_player_

uint16_t yaze::zelda3::OverworldExit::y_player_

Definition at line 73 of file overworld_exit.h.

Referenced by UpdateMapProperties().

◆ x_player_

uint16_t yaze::zelda3::OverworldExit::x_player_

Definition at line 74 of file overworld_exit.h.

Referenced by UpdateMapProperties().

◆ y_camera_

uint16_t yaze::zelda3::OverworldExit::y_camera_

Definition at line 75 of file overworld_exit.h.

Referenced by yaze::editor::DrawExitEditorPopup(), and UpdateMapProperties().

◆ x_camera_

uint16_t yaze::zelda3::OverworldExit::x_camera_

Definition at line 76 of file overworld_exit.h.

Referenced by yaze::editor::DrawExitEditorPopup(), and UpdateMapProperties().

◆ scroll_mod_y_

uint8_t yaze::zelda3::OverworldExit::scroll_mod_y_

Definition at line 77 of file overworld_exit.h.

◆ scroll_mod_x_

uint8_t yaze::zelda3::OverworldExit::scroll_mod_x_

Definition at line 78 of file overworld_exit.h.

◆ door_type_1_

uint16_t yaze::zelda3::OverworldExit::door_type_1_

Definition at line 79 of file overworld_exit.h.

Referenced by yaze::editor::DrawExitEditorPopup().

◆ door_type_2_

uint16_t yaze::zelda3::OverworldExit::door_type_2_

Definition at line 80 of file overworld_exit.h.

Referenced by yaze::editor::DrawExitEditorPopup().

◆ room_id_

uint16_t yaze::zelda3::OverworldExit::room_id_

Definition at line 81 of file overworld_exit.h.

Referenced by yaze::editor::DrawExitEditorPopup().

◆ map_pos_

uint16_t yaze::zelda3::OverworldExit::map_pos_

Definition at line 82 of file overworld_exit.h.

Referenced by UpdateMapProperties().

◆ is_hole_

bool yaze::zelda3::OverworldExit::is_hole_ = false

Definition at line 83 of file overworld_exit.h.

Referenced by yaze::editor::DrawExitEditorPopup().

◆ deleted_

bool yaze::zelda3::OverworldExit::deleted_ = false

Definition at line 84 of file overworld_exit.h.

Referenced by yaze::editor::DrawExitEditorPopup().

◆ is_automatic_

bool yaze::zelda3::OverworldExit::is_automatic_
Initial value:
=
true

Definition at line 85 of file overworld_exit.h.

Referenced by yaze::editor::DrawExitEditorPopup(), and UpdateMapProperties().


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