mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 01:45:33 +00:00
Allow toggling of cell markers
This commit is contained in:
parent
a34a08c212
commit
61b6806a62
2 changed files with 31 additions and 0 deletions
|
@ -7,6 +7,17 @@
|
|||
#include <osg/Group>
|
||||
#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()
|
||||
{
|
||||
const int characterSize = 20;
|
||||
|
@ -50,6 +61,9 @@ CSVRender::CellMarker::CellMarker(
|
|||
mMarkerNode->setAutoScaleToScreen(true);
|
||||
mMarkerNode->getOrCreateStateSet()->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
|
||||
|
||||
mMarkerNode->setUserData(new CellMarkerTag(this));
|
||||
mMarkerNode->setNodeMask(Mask_CellMarker);
|
||||
|
||||
mCellNode->addChild(mMarkerNode);
|
||||
|
||||
buildMarker();
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef OPENCS_VIEW_CELLMARKER_H
|
||||
#define OPENCS_VIEW_CELLMARKER_H
|
||||
|
||||
#include "tagbase.hpp"
|
||||
|
||||
#include <osg/ref_ptr>
|
||||
|
||||
#include "../../model/world/cellcoordinates.hpp"
|
||||
|
@ -13,6 +15,21 @@ namespace osg
|
|||
|
||||
namespace CSVRender
|
||||
{
|
||||
class CellMarker;
|
||||
|
||||
class CellMarkerTag : public TagBase
|
||||
{
|
||||
private:
|
||||
|
||||
CellMarker *mMarker;
|
||||
|
||||
public:
|
||||
|
||||
CellMarkerTag(CellMarker *marker);
|
||||
|
||||
CellMarker *getCellMarker() const;
|
||||
};
|
||||
|
||||
/// \brief Marker to display cell coordinates.
|
||||
class CellMarker
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue