Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
AreaMap Class Reference

Identity, size, pointers, and edge connections of the current map. More...

#include <areamap.h>

Inheritance diagram for AreaMap:
Collaboration diagram for AreaMap:

Public Member Functions

 AreaMap (SaveFile *saveFile=nullptr)
 < Current map id.
virtual ~AreaMap ()
void load (SaveFile *saveFile=nullptr)
 Expand the map block from the save.
void save (SaveFile *saveFile)
 Flatten the map block to the save.
int coordsToPtr (int x, int y, int width)
 Converts X & Y values to a pointer for currentTileBlockMapViewPointer.
int connCount ()
 Number of edge connections.
MapConnDataconnAt (int dir)
 Connection in direction dir (GC-protected return).
void connRemove (int dir)
 Remove the connection in dir.
void connNew (int dir)
 Add a connection in dir.
MapDBEntrytoCurMap ()
 The current map's DB entry.
protected::void curMapChanged ()
void outOfBoundsBlockChanged ()
void heightChanged ()
void widthChanged ()
void height2x2Changed ()
void width2x2Changed ()
void dataPtrChanged ()
void txtPtrChanged ()
void scriptPtrChanged ()
void currentTileBlockMapViewPointerChanged ()
void mapViewVRAMPointerChanged ()
void curMapScriptChanged ()
void cardKeyDoorXChanged ()
void cardKeyDoorYChanged ()
void forceBikeRideChanged ()
void blackoutDestChanged ()
void curMapNextFrameChanged ()
void connectionsChanged ()
void reset ()
 Blank the map block.
void randomize (MapDBEntry *map, int x, int y)
 Randomize to map with the player at (x,y).
void setTo (MapDBEntry *map, int x, int y)
 Configure to map with the player at (x,y).

Public Attributes

int curMap
 Current Map ID.
int outOfBoundsBlock
 This is not a tile, it's a block.
int height
 Map Size including it's double size.
int width
int height2x2
int width2x2
int dataPtr
 Map basic pointers.
int txtPtr
int scriptPtr
int currentTileBlockMapViewPointer
 <- Player coords converted to a ptr
int mapViewVRAMPointer
 <- Unused, reset at start of gameplay
int curMapScript
 Current map script index.
int cardKeyDoorX
 Unknown ???
int cardKeyDoorY
bool forceBikeRide
 Flags that may not be used, unknown.
bool blackoutDest
bool curMapNextFrame
QHash< var8, MapConnData * > connections
 Edge connections by direction (see the IDE note above).

Detailed Description

Identity, size, pointers, and edge connections of the current map.

The structural core of an Area: which map you're on, its dimensions, the various data/text/script pointers the game tracks, and the set of connections to neighbouring maps. Many fields are raw GB memory pointers mirrored from the save; the field comments below describe each. setTo()/randomize() reconfigure the map (with the player at x,y) as part of the "place on any map" feature.

See also
Area (container), MapConnData (a connection), MapDBEntry (map definitions).

Definition at line 43 of file areamap.h.

Constructor & Destructor Documentation

◆ AreaMap()

AreaMap::AreaMap ( SaveFile * saveFile = nullptr)

< Current map id.

The map's invalid/edge block. Map height (blocks). Map width (blocks). Map height in 2x2 units. Map width in 2x2 units. Map data pointer. Map text pointer. Map script pointer. Player coords as a pointer. Unused; reset at gameplay start. Current map script index. Card-key door X (purpose unclear). Card-key door Y (purpose unclear). Flag (may be unused). Flag (may be unused). Flag (may be unused).

Definition at line 34 of file areamap.cpp.

References load().

◆ ~AreaMap()

AreaMap::~AreaMap ( )
virtual

Definition at line 39 of file areamap.cpp.

References connections.

Member Function Documentation

◆ blackoutDestChanged()

void AreaMap::blackoutDestChanged ( )

Referenced by load(), and reset().

◆ cardKeyDoorXChanged()

void AreaMap::cardKeyDoorXChanged ( )

Referenced by load(), and reset().

◆ cardKeyDoorYChanged()

void AreaMap::cardKeyDoorYChanged ( )

Referenced by load(), and reset().

◆ connAt()

MapConnData * AreaMap::connAt ( int dir)

Connection in direction dir (GC-protected return).

Definition at line 50 of file areamap.cpp.

References connections, and qmlCppOwned().

◆ connCount()

int AreaMap::connCount ( )

Number of edge connections.

Definition at line 45 of file areamap.cpp.

References connections.

◆ connectionsChanged()

void AreaMap::connectionsChanged ( )

References randomize(), reset(), and setTo().

Referenced by connNew(), connRemove(), load(), randomize(), and reset().

◆ connNew()

void AreaMap::connNew ( int dir)

Add a connection in dir.

Definition at line 65 of file areamap.cpp.

References connections, connectionsChanged(), and connRemove().

◆ connRemove()

void AreaMap::connRemove ( int dir)

Remove the connection in dir.

Definition at line 55 of file areamap.cpp.

References connections, and connectionsChanged().

Referenced by connNew().

◆ coordsToPtr()

int AreaMap::coordsToPtr ( int x,
int y,
int width )

Converts X & Y values to a pointer for currentTileBlockMapViewPointer.

Definition at line 353 of file areamap.cpp.

References width, and MapDBEntryConnect::worldMapPtr.

Referenced by randomize().

◆ curMapChanged()

protected::void AreaMap::curMapChanged ( )

◆ curMapNextFrameChanged()

void AreaMap::curMapNextFrameChanged ( )

Referenced by load(), and reset().

◆ curMapScriptChanged()

void AreaMap::curMapScriptChanged ( )

Referenced by load(), and reset().

◆ currentTileBlockMapViewPointerChanged()

void AreaMap::currentTileBlockMapViewPointerChanged ( )

Referenced by load(), randomize(), and reset().

◆ dataPtrChanged()

void AreaMap::dataPtrChanged ( )

Referenced by load(), randomize(), and reset().

◆ forceBikeRideChanged()

void AreaMap::forceBikeRideChanged ( )

Referenced by load(), and reset().

◆ height2x2Changed()

void AreaMap::height2x2Changed ( )

Referenced by load(), randomize(), and reset().

◆ heightChanged()

void AreaMap::heightChanged ( )

Referenced by load(), randomize(), and reset().

◆ load()

◆ mapViewVRAMPointerChanged()

void AreaMap::mapViewVRAMPointerChanged ( )

Referenced by load(), randomize(), and reset().

◆ outOfBoundsBlockChanged()

void AreaMap::outOfBoundsBlockChanged ( )

Referenced by load(), randomize(), and reset().

◆ randomize()

◆ reset()

◆ save()

◆ scriptPtrChanged()

void AreaMap::scriptPtrChanged ( )

Referenced by load(), randomize(), and reset().

◆ setTo()

void AreaMap::setTo ( MapDBEntry * map,
int x,
int y )

Configure to map with the player at (x,y).

Definition at line 346 of file areamap.cpp.

References randomize().

Referenced by connectionsChanged().

◆ toCurMap()

MapDBEntry * AreaMap::toCurMap ( )

The current map's DB entry.

Definition at line 72 of file areamap.cpp.

References curMap, MapsDB::getIndAt(), and MapsDB::inst().

◆ txtPtrChanged()

void AreaMap::txtPtrChanged ( )

Referenced by load(), randomize(), and reset().

◆ width2x2Changed()

void AreaMap::width2x2Changed ( )

Referenced by load(), randomize(), and reset().

◆ widthChanged()

void AreaMap::widthChanged ( )

Referenced by load(), randomize(), and reset().

Member Data Documentation

◆ blackoutDest

bool AreaMap::blackoutDest

Definition at line 140 of file areamap.h.

Referenced by load(), reset(), and save().

◆ cardKeyDoorX

int AreaMap::cardKeyDoorX

Unknown ???

Definition at line 135 of file areamap.h.

Referenced by load(), reset(), and save().

◆ cardKeyDoorY

int AreaMap::cardKeyDoorY

Definition at line 136 of file areamap.h.

Referenced by load(), reset(), and save().

◆ connections

QHash<var8, MapConnData*> AreaMap::connections

Edge connections by direction (see the IDE note above).

Definition at line 147 of file areamap.h.

Referenced by connAt(), connCount(), connNew(), connRemove(), load(), randomize(), reset(), save(), and ~AreaMap().

◆ curMap

int AreaMap::curMap

Current Map ID.

Definition at line 109 of file areamap.h.

Referenced by load(), randomize(), reset(), save(), and toCurMap().

◆ curMapNextFrame

bool AreaMap::curMapNextFrame

Definition at line 141 of file areamap.h.

Referenced by load(), reset(), and save().

◆ curMapScript

int AreaMap::curMapScript

Current map script index.

Definition at line 132 of file areamap.h.

Referenced by load(), reset(), and save().

◆ currentTileBlockMapViewPointer

int AreaMap::currentTileBlockMapViewPointer

<- Player coords converted to a ptr

Definition at line 128 of file areamap.h.

Referenced by load(), randomize(), reset(), and save().

◆ dataPtr

int AreaMap::dataPtr

Map basic pointers.

Definition at line 123 of file areamap.h.

Referenced by load(), randomize(), reset(), and save().

◆ forceBikeRide

bool AreaMap::forceBikeRide

Flags that may not be used, unknown.

Definition at line 139 of file areamap.h.

Referenced by load(), reset(), and save().

◆ height

int AreaMap::height

Map Size including it's double size.

Definition at line 117 of file areamap.h.

Referenced by load(), randomize(), reset(), and save().

◆ height2x2

int AreaMap::height2x2

Definition at line 119 of file areamap.h.

Referenced by load(), randomize(), reset(), and save().

◆ mapViewVRAMPointer

int AreaMap::mapViewVRAMPointer

<- Unused, reset at start of gameplay

Definition at line 129 of file areamap.h.

Referenced by load(), randomize(), reset(), and save().

◆ outOfBoundsBlock

int AreaMap::outOfBoundsBlock

This is not a tile, it's a block.

A block consists of multiple tiles Maps are made from pre-created blocks, not individual tiles Every map has a block that's invalid, this is that block

Definition at line 114 of file areamap.h.

Referenced by load(), randomize(), reset(), and save().

◆ scriptPtr

int AreaMap::scriptPtr

Definition at line 125 of file areamap.h.

Referenced by load(), randomize(), reset(), and save().

◆ txtPtr

int AreaMap::txtPtr

Definition at line 124 of file areamap.h.

Referenced by load(), randomize(), reset(), and save().

◆ width

int AreaMap::width

Definition at line 118 of file areamap.h.

Referenced by coordsToPtr(), load(), randomize(), reset(), and save().

◆ width2x2

int AreaMap::width2x2

Definition at line 120 of file areamap.h.

Referenced by load(), randomize(), reset(), and save().


The documentation for this class was generated from the following files:
  • projects/savefile/src/pse-savefile/expanded/area/areamap.h
  • projects/savefile/src/pse-savefile/expanded/area/areamap.cpp