ScummVM API documentation
Ultima::Ultima1::Data::Map Struct Reference

Public Member Functions

void init ()
 
void loadGraphics ()
 
void load (int mapNum)
 
void synchronize (Common::Serializer &s)
 
void resetMondainMap ()
 
int width () const
 
int height () const
 
const Graphics::ManagedSurface * tiles () const
 
Graphics::ManagedSurface * tiles ()
 
const Graphics::ManagedSurface * spaceShipTiles () const
 
const Graphics::ManagedSurface * enemyFighterTiles () const
 
const Row & operator[] (int y) const
 
int getMapTile (int x, int y) const
 
int getTileAt (int x, int y, int creatureIndex=1) const
 
int getOverworldTileAt (int x, int y) const
 
int wrapOverworldX (int x) const
 
int wrapOverworldY (int y) const
 
void countSurroundingTiles ()
 
int getContinentAt (int x, int y) const
 
int getContinentAt (const Common::Point &pt) const
 
int getLocationAt (int x, int y) const
 
int getLocationAt (const Common::Point &pt) const
 
bool mapRangeCheckX (int xp) const
 
bool mapRangeCheckY (int yp) const
 

Public Attributes

byte _tilePlayerCenter = 0
 
byte _tilePlayerUp = 0
 
byte _tilePlayerDown = 0
 
byte _tilePlayerLeft = 0
 
byte _tilePlayerRight = 0
 
int _woodsCount = 0
 
int _grassCount = 0
 
int _waterCount = 0
 
bool _isLordBritishCastle = false
 
int _mapStyle = 0
 
int _mapType = MAPTYPE_OVERWORLD
 
int _tavernCtr = 0
 
int _castleNum = 0
 
int _castleNum2 = 0
 
Graphics::ManagedSurface * _tiles = nullptr
 

Member Function Documentation

◆ init()

void Ultima::Ultima1::Data::Map::init ( )

Initializes the map, loading necessary data.

◆ loadGraphics()

void Ultima::Ultima1::Data::Map::loadGraphics ( )

Loads the tile graphics for the current graphics mode

◆ load()

void Ultima::Ultima1::Data::Map::load ( int  mapNum)

Loads a specified map.

Parameters
mapNum

◆ synchronize()

void Ultima::Ultima1::Data::Map::synchronize ( Common::Serializer &  s)

Saves or loads the contents of the current location's map, for the locations the player can make changes to. Does nothing for any others

◆ resetMondainMap()

void Ultima::Ultima1::Data::Map::resetMondainMap ( )

Restores the Mondain encounter room to its pristine layout, discarding anything left behind by a previous visit (placed barriers, conjured hazards, the player/position markers). The original re-reads the room from disk each time its executable launches; this is the equivalent

◆ width()

int Ultima::Ultima1::Data::Map::width ( ) const
inline

Returns the map width

◆ height()

int Ultima::Ultima1::Data::Map::height ( ) const
inline

Returns the map height

◆ tiles()

const Graphics::ManagedSurface * Ultima::Ultima1::Data::Map::tiles ( ) const
inline

Get the tiles

◆ spaceShipTiles()

const Graphics::ManagedSurface * Ultima::Ultima1::Data::Map::spaceShipTiles ( ) const
inline

Get the outer-space ship glyph tiles, indexed by shipType*4+facing

◆ enemyFighterTiles()

const Graphics::ManagedSurface * Ultima::Ultima1::Data::Map::enemyFighterTiles ( ) const
inline

Get the cockpit-view enemy fighter glyphs, indexed by approach stage

◆ operator[]()

const Row & Ultima::Ultima1::Data::Map::operator[] ( int  y) const
inline

Access tiles of the current map

◆ getMapTile()

int Ultima::Ultima1::Data::Map::getMapTile ( int  x,
int  y 
) const

Get a tile at a given position.

Parameters
xX position
yY position
Returns
Tile Id

◆ getTileAt()

int Ultima::Ultima1::Data::Map::getTileAt ( int  x,
int  y,
int  creatureIndex = 1 
) const

Returns a tile or creature/entity at a given co-ordinate

◆ getOverworldTileAt()

int Ultima::Ultima1::Data::Map::getOverworldTileAt ( int  x,
int  y 
) const

Returns a tile or creature/entity at a given overworld position, regardless of which map is currently loaded. Used when a location needs to look at the overworld around itself, such as when a purchased vehicle is placed outside a city

◆ wrapOverworldX()

int Ultima::Ultima1::Data::Map::wrapOverworldX ( int  x) const

Wraps an X or Y position around the edges of the overworld. Entities are always stored wrapped, so positions must be wrapped before comparing them

◆ countSurroundingTiles()

void Ultima::Ultima1::Data::Map::countSurroundingTiles ( )

Counts the ocean, grass and woods tiles in the overworld around the player's position, which a location uses to know what vehicles can be bought there

◆ getContinentAt()

int Ultima::Ultima1::Data::Map::getContinentAt ( int  x,
int  y 
) const

Returns the continent number at a given position

◆ getLocationAt()

int Ultima::Ultima1::Data::Map::getLocationAt ( int  x,
int  y 
) const

Get the location at a given position

◆ mapRangeCheckX()

bool Ultima::Ultima1::Data::Map::mapRangeCheckX ( int  xp) const

Returns true if a map X co-ordinate is far enough from a continent boundary to be a valid creature spawn/move position

◆ mapRangeCheckY()

bool Ultima::Ultima1::Data::Map::mapRangeCheckY ( int  yp) const

Returns true if a map Y co-ordinate is far enough from a continent boundary to be a valid creature spawn/move position


The documentation for this struct was generated from the following file: