|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
Identity, size, pointers, and edge connections of the current map. More...
#include <areamap.h>
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. | |
| MapConnData * | connAt (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. | |
| MapDBEntry * | toCurMap () |
| 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). | |
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.
| 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().
|
virtual |
Definition at line 39 of file areamap.cpp.
References connections.
| MapConnData * AreaMap::connAt | ( | int | dir | ) |
Connection in direction dir (GC-protected return).
Definition at line 50 of file areamap.cpp.
References connections, and qmlCppOwned().
| int AreaMap::connCount | ( | ) |
| void AreaMap::connectionsChanged | ( | ) |
References randomize(), reset(), and setTo().
Referenced by connNew(), connRemove(), load(), randomize(), and reset().
| void AreaMap::connNew | ( | int | dir | ) |
Add a connection in dir.
Definition at line 65 of file areamap.cpp.
References connections, connectionsChanged(), and 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().
| 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().
| protected::void AreaMap::curMapChanged | ( | ) |
Referenced by load(), MapSelectModel::MapSelectModel(), randomize(), and reset().
| void AreaMap::currentTileBlockMapViewPointerChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| void AreaMap::dataPtrChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| void AreaMap::height2x2Changed | ( | ) |
Referenced by load(), randomize(), and reset().
| void AreaMap::heightChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| void AreaMap::load | ( | SaveFile * | saveFile = nullptr | ) |
Expand the map block from the save.
Definition at line 77 of file areamap.cpp.
References blackoutDest, blackoutDestChanged(), cardKeyDoorX, cardKeyDoorXChanged(), cardKeyDoorY, cardKeyDoorYChanged(), connections, connectionsChanged(), curMap, curMapChanged(), curMapNextFrame, curMapNextFrameChanged(), curMapScript, curMapScriptChanged(), currentTileBlockMapViewPointer, currentTileBlockMapViewPointerChanged(), dataPtr, dataPtrChanged(), MapDBEntryConnect::EAST, forceBikeRide, forceBikeRideChanged(), height, height2x2, height2x2Changed(), heightChanged(), mapViewVRAMPointer, mapViewVRAMPointerChanged(), MapDBEntryConnect::NORTH, outOfBoundsBlock, outOfBoundsBlockChanged(), reset(), scriptPtr, scriptPtrChanged(), MapDBEntryConnect::SOUTH, SaveFile::toolset, txtPtr, txtPtrChanged(), MapDBEntryConnect::WEST, width, width2x2, width2x2Changed(), and widthChanged().
Referenced by AreaMap().
| void AreaMap::mapViewVRAMPointerChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| void AreaMap::outOfBoundsBlockChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| void AreaMap::randomize | ( | MapDBEntry * | map, |
| int | x, | ||
| int | y ) |
Randomize to map with the player at (x,y).
Definition at line 270 of file areamap.cpp.
References connections, connectionsChanged(), coordsToPtr(), curMap, curMapChanged(), currentTileBlockMapViewPointer, currentTileBlockMapViewPointerChanged(), dataPtr, dataPtrChanged(), MapDBEntryConnect::EAST, MapDBEntry::getBorder(), MapDBEntry::getConnect(), MapDBEntry::getDataPtr(), MapDBEntry::getHeight(), MapDBEntry::getInd(), MapDBEntry::getScriptPtr(), MapDBEntry::getTextPtr(), MapDBEntry::getWidth(), height, MapDBEntry::height2X2(), height2x2, height2x2Changed(), heightChanged(), MapConnData::loadFromData(), mapViewVRAMPointer, mapViewVRAMPointerChanged(), MapDBEntryConnect::NORTH, outOfBoundsBlock, outOfBoundsBlockChanged(), reset(), scriptPtr, scriptPtrChanged(), MapDBEntryConnect::SOUTH, txtPtr, txtPtrChanged(), VramBGPtr, MapDBEntryConnect::WEST, width, MapDBEntry::width2X2(), width2x2, width2x2Changed(), and widthChanged().
Referenced by connectionsChanged(), and setTo().
| void AreaMap::reset | ( | ) |
Blank the map block.
Definition at line 203 of file areamap.cpp.
References blackoutDest, blackoutDestChanged(), cardKeyDoorX, cardKeyDoorXChanged(), cardKeyDoorY, cardKeyDoorYChanged(), connections, connectionsChanged(), curMap, curMapChanged(), curMapNextFrame, curMapNextFrameChanged(), curMapScript, curMapScriptChanged(), currentTileBlockMapViewPointer, currentTileBlockMapViewPointerChanged(), dataPtr, dataPtrChanged(), forceBikeRide, forceBikeRideChanged(), height, height2x2, height2x2Changed(), heightChanged(), mapViewVRAMPointer, mapViewVRAMPointerChanged(), outOfBoundsBlock, outOfBoundsBlockChanged(), scriptPtr, scriptPtrChanged(), txtPtr, txtPtrChanged(), width, width2x2, width2x2Changed(), and widthChanged().
Referenced by connectionsChanged(), load(), and randomize().
| void AreaMap::save | ( | SaveFile * | saveFile | ) |
Flatten the map block to the save.
Definition at line 162 of file areamap.cpp.
References blackoutDest, cardKeyDoorX, cardKeyDoorY, connections, curMap, curMapNextFrame, curMapScript, currentTileBlockMapViewPointer, dataPtr, MapDBEntryConnect::EAST, forceBikeRide, height, height2x2, mapViewVRAMPointer, MapDBEntryConnect::NORTH, outOfBoundsBlock, scriptPtr, SaveFileToolset::setByte(), MapDBEntryConnect::SOUTH, SaveFile::toolset, txtPtr, MapDBEntryConnect::WEST, width, and width2x2.
| void AreaMap::scriptPtrChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| 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().
| MapDBEntry * AreaMap::toCurMap | ( | ) |
The current map's DB entry.
Definition at line 72 of file areamap.cpp.
References curMap, MapsDB::getIndAt(), and MapsDB::inst().
| void AreaMap::txtPtrChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| void AreaMap::width2x2Changed | ( | ) |
Referenced by load(), randomize(), and reset().
| void AreaMap::widthChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| bool AreaMap::blackoutDest |
| int AreaMap::cardKeyDoorX |
| int AreaMap::cardKeyDoorY |
| 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().
| int AreaMap::curMap |
Current Map ID.
Definition at line 109 of file areamap.h.
Referenced by load(), randomize(), reset(), save(), and toCurMap().
| bool AreaMap::curMapNextFrame |
| int AreaMap::curMapScript |
| int AreaMap::currentTileBlockMapViewPointer |
| int AreaMap::dataPtr |
| bool AreaMap::forceBikeRide |
| int AreaMap::height |
| int AreaMap::height2x2 |
| int AreaMap::mapViewVRAMPointer |
| int AreaMap::outOfBoundsBlock |
| int AreaMap::scriptPtr |
| int AreaMap::txtPtr |
| int AreaMap::width |
Definition at line 118 of file areamap.h.
Referenced by coordsToPtr(), load(), randomize(), reset(), and save().
| int AreaMap::width2x2 |