mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Merge-in all updates from master
This commit is contained in:
@@ -115,7 +115,7 @@ void RenderableConstellationBounds::initialize() {
|
||||
|
||||
if (it == options.end()) {
|
||||
// The user has specified a constellation name that doesn't exist
|
||||
LWARNING(fmt::format(
|
||||
LWARNING(std::format(
|
||||
"Option '{}' not found in list of constellations", s
|
||||
));
|
||||
}
|
||||
@@ -146,11 +146,11 @@ void RenderableConstellationBounds::initializeGL() {
|
||||
glBufferData(
|
||||
GL_ARRAY_BUFFER,
|
||||
_vertexValues.size() * 3 * sizeof(float),
|
||||
&_vertexValues[0],
|
||||
_vertexValues.data(),
|
||||
GL_STATIC_DRAW
|
||||
);
|
||||
|
||||
GLint positionAttrib = _program->attributeLocation("in_position");
|
||||
const GLint positionAttrib = _program->attributeLocation("in_position");
|
||||
glEnableVertexAttribArray(positionAttrib);
|
||||
glVertexAttribPointer(positionAttrib, 3, GL_FLOAT, GL_FALSE, 0, nullptr);
|
||||
|
||||
@@ -209,7 +209,7 @@ void RenderableConstellationBounds::render(const RenderData& data, RendererTasks
|
||||
}
|
||||
|
||||
bool RenderableConstellationBounds::loadData() {
|
||||
bool success = loadVertexFile();
|
||||
const bool success = loadVertexFile();
|
||||
if (!success) {
|
||||
throw ghoul::RuntimeError("Error loading data");
|
||||
}
|
||||
@@ -246,10 +246,10 @@ bool RenderableConstellationBounds::loadVertexFile() {
|
||||
|
||||
// @CHECK: Is this the best way of doing this? ---abock
|
||||
std::stringstream s(currentLine);
|
||||
float ra;
|
||||
float ra = 0.f;
|
||||
s >> ra;
|
||||
|
||||
float dec;
|
||||
float dec = 0.f;
|
||||
s >> dec;
|
||||
|
||||
std::string abbreviation;
|
||||
@@ -258,8 +258,8 @@ bool RenderableConstellationBounds::loadVertexFile() {
|
||||
if (!s.good()) {
|
||||
// If this evaluates to true, the stream was not completely filled, which
|
||||
// means that the line was incomplete, so there was an error
|
||||
LERROR(fmt::format(
|
||||
"Error reading file {} at line #{}", fileName, currentLineNumber
|
||||
LERROR(std::format(
|
||||
"Error reading file '{}' at line #{}", fileName, currentLineNumber
|
||||
));
|
||||
break;
|
||||
}
|
||||
@@ -276,7 +276,8 @@ bool RenderableConstellationBounds::loadVertexFile() {
|
||||
currentBound.isEnabled = true;
|
||||
currentBound.constellationAbbreviation = abbreviation;
|
||||
std::string name = constellationFullName(abbreviation);
|
||||
currentBound.constellationFullName = name.empty() ? abbreviation : name;
|
||||
currentBound.constellationFullName =
|
||||
name.empty() ? abbreviation : std::move(name);
|
||||
currentBound.startIndex = static_cast<GLsizei>(_vertexValues.size());
|
||||
}
|
||||
|
||||
@@ -290,8 +291,8 @@ bool RenderableConstellationBounds::loadVertexFile() {
|
||||
// Convert the (right ascension, declination) to rectangular coordinates)
|
||||
// The 1.0 is the distance of the celestial sphere, we will scale that in the
|
||||
// render function
|
||||
double rectangularValues[3];
|
||||
radrec_c(1.0, ra, dec, rectangularValues);
|
||||
std::array<double, 3> rectangularValues;
|
||||
radrec_c(1.0, ra, dec, rectangularValues.data());
|
||||
|
||||
// Add the new vertex to our list of vertices
|
||||
_vertexValues.push_back({
|
||||
|
||||
Reference in New Issue
Block a user