Skip to content

Commit

Permalink
KOTOR: Apply arrow rotation depending on north axis
Browse files Browse the repository at this point in the history
  • Loading branch information
Nostritius committed Aug 9, 2018
1 parent ceeeffc commit ca95c86
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/engines/kotor/gui/ingame/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,16 @@ void HUD::setPosition(float x, float y) {
}

void HUD::setRotation(float angle) {
_minimapPointer->setRotation(angle);
switch (_minimap->getNorthAxis()) {
case 0:
_minimapPointer->setRotation(angle);
break;
case 3:
_minimapPointer->setRotation(angle - 90.0f);
break;
default:
warning("Unknown north axis");
}
}

void HUD::showContainer(Inventory &inv) {
Expand Down
4 changes: 4 additions & 0 deletions src/engines/kotor/gui/ingame/minimap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ void Minimap::setPosition(float x, float y) {
setGlobalTransformationMatrix(transformation);
}

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

} // End of namespace KotOR

} // End of namespace Engines
1 change: 1 addition & 0 deletions src/engines/kotor/gui/ingame/minimap.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Minimap : public Graphics::Aurora::SubSceneQuad {
float worldPt1X, float worldPt1Y, float worldPt2X, float worldPt2Y);

void setPosition(float x, float y);
int getNorthAxis();

private:
Graphics::Aurora::GUIQuad _mapQuad;
Expand Down

0 comments on commit ca95c86

Please sign in to comment.