1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 16:15:31 +00:00

Allow toggling of cell markers

This commit is contained in:
Rob Cutmore 2016-02-09 20:23:00 -05:00
parent a34a08c212
commit 61b6806a62
2 changed files with 31 additions and 0 deletions

View file

@ -7,6 +7,17 @@
#include <osg/Group> #include <osg/Group>
#include <osgText/Text> #include <osgText/Text>
#include "mask.hpp"
CSVRender::CellMarkerTag::CellMarkerTag(CellMarker *marker)
: TagBase(Mask_CellMarker), mMarker(marker)
{}
CSVRender::CellMarker *CSVRender::CellMarkerTag::getCellMarker() const
{
return mMarker;
}
void CSVRender::CellMarker::buildMarker() void CSVRender::CellMarker::buildMarker()
{ {
const int characterSize = 20; const int characterSize = 20;
@ -50,6 +61,9 @@ CSVRender::CellMarker::CellMarker(
mMarkerNode->setAutoScaleToScreen(true); mMarkerNode->setAutoScaleToScreen(true);
mMarkerNode->getOrCreateStateSet()->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); mMarkerNode->getOrCreateStateSet()->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
mMarkerNode->setUserData(new CellMarkerTag(this));
mMarkerNode->setNodeMask(Mask_CellMarker);
mCellNode->addChild(mMarkerNode); mCellNode->addChild(mMarkerNode);
buildMarker(); buildMarker();

View file

@ -1,6 +1,8 @@
#ifndef OPENCS_VIEW_CELLMARKER_H #ifndef OPENCS_VIEW_CELLMARKER_H
#define OPENCS_VIEW_CELLMARKER_H #define OPENCS_VIEW_CELLMARKER_H
#include "tagbase.hpp"
#include <osg/ref_ptr> #include <osg/ref_ptr>
#include "../../model/world/cellcoordinates.hpp" #include "../../model/world/cellcoordinates.hpp"
@ -13,6 +15,21 @@ namespace osg
namespace CSVRender namespace CSVRender
{ {
class CellMarker;
class CellMarkerTag : public TagBase
{
private:
CellMarker *mMarker;
public:
CellMarkerTag(CellMarker *marker);
CellMarker *getCellMarker() const;
};
/// \brief Marker to display cell coordinates. /// \brief Marker to display cell coordinates.
class CellMarker class CellMarker
{ {