Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/editor/GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,10 @@ void GUIMain::drawInformationOnMap(const irr::f32& time, const irr::s32& mapOffs
irr::s32 relPosX = (it->X - ownShipPosX) / metresPerPx + mapOffsetX;
irr::s32 relPosY = (it->Z - ownShipPosZ) / metresPerPx - mapOffsetZ;

irr::core::stringw label(it->name.c_str());

device->getVideoDriver()->draw2DRectangle(irr::video::SColor(255, 128, 255, 128), irr::core::rect<irr::s32>(screenCentreX - dotHalfWidth + relPosX, screenCentreY - dotHalfWidth - relPosY, screenCentreX + dotHalfWidth + relPosX, screenCentreY + dotHalfWidth - relPosY));
guienv->getSkin()->getFont()->draw(label, irr::core::rect<irr::s32>(screenCentreX + relPosX, screenCentreY - relPosY - 0.025 * height, screenCentreX + relPosX, screenCentreY - relPosY), irr::video::SColor(128, 0, 0, 0), true, true);
}

//Draw location of ships
Expand Down
6 changes: 4 additions & 2 deletions src/editor/PositionDataStruct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
#define __POSITIONDATASTRUCT_HPP_INCLUDED__

#include "irrlicht.h"
#include <string>

struct PositionData //To hold information about a position
struct PositionData //To hold information about a position (with optional name)
{
irr::f32 X, Z;
PositionData():X(0), Z(0){}
std::string name;
PositionData():X(0), Z(0), name(""){}
};

#endif // __POSITIONDATASTRUCT_HPP_INCLUDED__
1 change: 1 addition & 0 deletions src/editor/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ int main (int argc, char ** argv)
//Get land object position
thisLandObject.X = controller.longToX(IniFile::iniFileTof32(scenarioLandObjectFilename, IniFile::enumerate1("Long", currentLandObject)));
thisLandObject.Z = controller.latToZ(IniFile::iniFileTof32(scenarioLandObjectFilename, IniFile::enumerate1("Lat", currentLandObject)));
thisLandObject.name = IniFile::iniFileToString(scenarioLandObjectFilename, IniFile::enumerate1("Type", currentLandObject));
landObjectsData.push_back(thisLandObject);
}

Expand Down