Initialize marker representations in constructor

pull/366/head
Hleb Valoshka 2019-06-06 21:55:39 +03:00
parent 1125957c83
commit 2090a883d4
1 changed files with 10 additions and 12 deletions

View File

@ -517,6 +517,16 @@ Renderer::Renderer() :
}
shaderManager = new ShaderManager();
mountainRep = MarkerRepresentation(MarkerRepresentation::Triangle, 8.0f, LocationLabelColor);
craterRep = MarkerRepresentation(MarkerRepresentation::Circle, 8.0f, LocationLabelColor);
observatoryRep = MarkerRepresentation(MarkerRepresentation::Plus, 8.0f, LocationLabelColor);
cityRep = MarkerRepresentation(MarkerRepresentation::X, 3.0f, LocationLabelColor);
genericLocationRep = MarkerRepresentation(MarkerRepresentation::Square, 8.0f, LocationLabelColor);
galaxyRep = MarkerRepresentation(MarkerRepresentation::Triangle, 8.0f, GalaxyLabelColor);
nebulaRep = MarkerRepresentation(MarkerRepresentation::Square, 8.0f, NebulaLabelColor);
openClusterRep = MarkerRepresentation(MarkerRepresentation::Circle, 8.0f, OpenClusterLabelColor);
globularRep = MarkerRepresentation(MarkerRepresentation::Circle, 8.0f, OpenClusterLabelColor);
}
@ -5362,13 +5372,6 @@ void Renderer::renderPlanet(Body& body,
if (body.getLocations() != nullptr && (labelMode & LocationLabels) != 0)
{
// Set up location markers for this body
mountainRep = MarkerRepresentation(MarkerRepresentation::Triangle, 8.0f, LocationLabelColor);
craterRep = MarkerRepresentation(MarkerRepresentation::Circle, 8.0f, LocationLabelColor);
observatoryRep = MarkerRepresentation(MarkerRepresentation::Plus, 8.0f, LocationLabelColor);
cityRep = MarkerRepresentation(MarkerRepresentation::X, 3.0f, LocationLabelColor);
genericLocationRep = MarkerRepresentation(MarkerRepresentation::Square, 8.0f, LocationLabelColor);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_FALSE);
glDisable(GL_BLEND);
@ -7031,11 +7034,6 @@ void Renderer::renderDeepSkyObjects(const Universe& universe,
dsoRenderer.labelThresholdMag = 2.0f * max(1.0f, (faintestMag - 4.0f) * (1.0f - 0.5f * (float) log10(effDistanceToScreen)));
galaxyRep = MarkerRepresentation(MarkerRepresentation::Triangle, 8.0f, GalaxyLabelColor);
nebulaRep = MarkerRepresentation(MarkerRepresentation::Square, 8.0f, NebulaLabelColor);
openClusterRep = MarkerRepresentation(MarkerRepresentation::Circle, 8.0f, OpenClusterLabelColor);
globularRep = MarkerRepresentation(MarkerRepresentation::Circle, 8.0f, OpenClusterLabelColor);
// Render any line primitives with smooth lines
// (mostly to make graticules look good.)
enableSmoothLines(renderFlags);