Skip to content

Commit

Permalink
KOTOR: Add minimap properties reading in area loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Nostritius authored and DrMcCoy committed May 8, 2018
1 parent 84682e3 commit 30d2a12
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/engines/kotor/area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,30 @@ void Area::playAmbientSound(Common::UString sound) {
_ambientSound = ::Engines::playSound(sound, Sound::kSoundTypeSFX, true, _ambientDayVol);
}

int Area::getNorthAxis() {
return _northAxis;
}

void Area::getMapPoint1(float &x, float &y) {
x = _mapPt1X;
y = _mapPt1Y;
}

void Area::getMapPoint2(float &x, float &y) {
x = _mapPt2X;
y = _mapPt2Y;
}

void Area::getWorldPoint1(float &x, float &y) {
x = _worldPt1X;
y = _worldPt1Y;
}

void Area::getWorldPoint2(float &x, float &y) {
x = _worldPt2X;
y = _worldPt2Y;
}

void Area::show() {
if (_visible)
return;
Expand Down Expand Up @@ -263,6 +287,18 @@ void Area::loadARE(const Aurora::GFF3Struct &are) {
// Name
_name = are.getString("Name");

// Minimap data
const Aurora::GFF3Struct &map = are.getStruct("Map");
_mapPt1X = map.getDouble("MapPt1X");
_mapPt1Y = map.getDouble("MapPt1Y");
_mapPt2X = map.getDouble("MapPt2X");
_mapPt2Y = map.getDouble("MapPt2Y");
_worldPt1X = map.getDouble("WorldPt1X");
_worldPt1Y = map.getDouble("WorldPt1Y");
_worldPt2X = map.getDouble("WorldPt2X");
_worldPt2Y = map.getDouble("WorldPt2Y");
_northAxis = map.getSint("NorthAxis");

// Scripts
readScripts(are);
}
Expand Down
17 changes: 17 additions & 0 deletions src/engines/kotor/area.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ class Area : public KotOR::Object, public Events::Notifyable {
/** Return the area's resref (resource ID). */
const Common::UString &getResRef();

// Minimap

/** Get the north axis id. */
int getNorthAxis();
/** Get the first map point. */
void getMapPoint1(float &x, float &y);
/** Get the second map point. */
void getMapPoint2(float &x, float &y);
/** Get the first world point. */
void getWorldPoint1(float &x, float &y);
/** Get the second world point. */
void getWorldPoint2(float &x, float &y);

// Visibility

void show();
Expand Down Expand Up @@ -145,6 +158,10 @@ class Area : public KotOR::Object, public Events::Notifyable {

bool _visible; ///< Is the area currently visible?

float _worldPt1X, _worldPt1Y, _worldPt2X, _worldPt2Y;
float _mapPt1X, _mapPt1Y, _mapPt2X, _mapPt2Y;
int _northAxis;

Sound::ChannelHandle _ambientSound; ///< Sound handle of the currently playing sound.
Sound::ChannelHandle _ambientMusic; ///< Sound handle of the currently playing music.

Expand Down

0 comments on commit 30d2a12

Please sign in to comment.