mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Adapt to new compile option style and fix warnings (#3773)
This commit is contained in:
@@ -831,7 +831,7 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) {
|
||||
case ColorAddingBlending:
|
||||
glBlendFunc(GL_SRC_COLOR, GL_DST_COLOR);
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
if (!_enableDepthTest) {
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
@@ -449,7 +449,7 @@ void RenderableNodeArrow::updateShapeTransforms(const RenderData& data) {
|
||||
// Create transformation matrices to reshape to size and position
|
||||
_cylinderTranslation = glm::translate(glm::dmat4(1.0), startPos);
|
||||
const glm::dvec3 cylinderScale = glm::dvec3(
|
||||
s * glm::dvec4(_width, _width, cylinderLength, 0.0)
|
||||
s * glm::dvec4(_width.value(), _width.value(), cylinderLength, 0.0)
|
||||
);
|
||||
_cylinderScale = glm::scale(glm::dmat4(1.0), cylinderScale);
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ void RenderablePlaneImageLocal::loadTexture() {
|
||||
|
||||
_texture = BaseModule::TextureManager.request(
|
||||
std::to_string(hash),
|
||||
[path = _texturePath]() -> std::unique_ptr<ghoul::opengl::Texture> {
|
||||
[path = _texturePath.value()]() -> std::unique_ptr<ghoul::opengl::Texture> {
|
||||
std::unique_ptr<ghoul::opengl::Texture> texture =
|
||||
ghoul::io::TextureReader::ref().loadTexture(absPath(path), 2);
|
||||
|
||||
|
||||
@@ -466,7 +466,7 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) {
|
||||
case ColorAddingBlending:
|
||||
glBlendFunc(GL_SRC_COLOR, GL_DST_COLOR);
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
if (_disableDepth) {
|
||||
glDepthMask(GL_FALSE);
|
||||
|
||||
@@ -351,12 +351,12 @@ RenderableTrailOrbit::UpdateReport RenderableTrailOrbit::updateTrails(
|
||||
|
||||
// If we would need to generate more new points than there are total points in the
|
||||
// array, it is faster to regenerate the entire array
|
||||
if (nNewPoints >= _resolution) {
|
||||
if (nNewPoints >= static_cast<uint64_t>(_resolution)) {
|
||||
fullSweep(data.time.j2000Seconds());
|
||||
return { false, true, UpdateReport::All };
|
||||
}
|
||||
|
||||
for (int i = 0; i < nNewPoints; i++) {
|
||||
for (uint64_t i = 0; i < nNewPoints; i++) {
|
||||
_lastPointTime += secondsPerPoint;
|
||||
|
||||
// Get the new permanent point and write it into the (previously) floating
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
namespace {
|
||||
constexpr glm::uvec2 BlackoutTextureSize = glm::uvec2(3840, 2160);
|
||||
|
||||
void checkCornerSpecification(std::vector<glm::vec2> corners) {
|
||||
void checkCornerSpecification(const std::vector<glm::vec2>& corners) {
|
||||
if (corners.size() != 4) {
|
||||
openspace::documentation::TestResult res;
|
||||
res.success = false;
|
||||
@@ -78,13 +78,14 @@ namespace {
|
||||
for (int i = 0; i < numberOfSegments; i++) {
|
||||
for (int s = 0; s < Subdivisions; s++) {
|
||||
float tValue = stepSize * s;
|
||||
splineData.push_back(ghoul::interpolateCatmullRom(
|
||||
glm::vec2 value = ghoul::interpolateCatmullRom(
|
||||
tValue,
|
||||
*(controlPoints.begin() + i + 0),
|
||||
*(controlPoints.begin() + i + 1),
|
||||
*(controlPoints.begin() + i + 2),
|
||||
*(controlPoints.begin() + i + 3)
|
||||
));
|
||||
);
|
||||
splineData.push_back(std::move(value));
|
||||
}
|
||||
}
|
||||
return splineData;
|
||||
@@ -97,14 +98,13 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
std::string formatLine(std::string id, const std::vector<glm::vec2>& data)
|
||||
{
|
||||
std::string formatLine(std::string_view id, const std::vector<glm::vec2>& data) {
|
||||
if (data.empty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string str = std::format("{} = {{ ", id);
|
||||
for (int i = 0; i < data.size(); ++i) {
|
||||
for (size_t i = 0; i < data.size(); ++i) {
|
||||
std::string xVal = std::format("{}", data[i].x);
|
||||
std::string yVal = std::format("{}", data[i].y);
|
||||
xVal += (xVal.find(".") == std::string::npos) ? ".0" : "";
|
||||
@@ -294,7 +294,7 @@ ScreenSpaceInsetBlackout::BlackoutShape::Spline::Spline(std::vector<glm::vec2>&
|
||||
base = baseString;
|
||||
|
||||
// Generate all Point objects and add them to GUI
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
for (size_t i = 0; i < data.size(); i++) {
|
||||
points.push_back(std::make_unique<Point>(
|
||||
data[i],
|
||||
std::format("Point{}Position", i),
|
||||
@@ -317,8 +317,8 @@ ScreenSpaceInsetBlackout::BlackoutShape::Spline::Spline(std::vector<glm::vec2>&
|
||||
addProperty(addButton);
|
||||
|
||||
// Add options used when inserting a new point
|
||||
for (int i = 0; i < points.size() + 1; i++) {
|
||||
addSelector.addOption(i, std::format("At position #{}", i + 1));
|
||||
for (size_t i = 0; i < points.size() + 1; i++) {
|
||||
addSelector.addOption(static_cast<int>(i), std::format("At position #{}", i + 1));
|
||||
}
|
||||
|
||||
// Only add controls for removing a point if there are any points that can be removed
|
||||
@@ -329,8 +329,11 @@ ScreenSpaceInsetBlackout::BlackoutShape::Spline::Spline(std::vector<glm::vec2>&
|
||||
});
|
||||
addProperty(removeSelector);
|
||||
addProperty(removeButton);
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
removeSelector.addOption(i, std::format("Point #{}", i + 1));
|
||||
for (size_t i = 0; i < points.size(); i++) {
|
||||
removeSelector.addOption(
|
||||
static_cast<int>(i),
|
||||
std::format("Point #{}", i + 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -475,7 +478,7 @@ void ScreenSpaceInsetBlackout::BlackoutShape::checkAndUpdateGUI() {
|
||||
// Remove GUI elements so that we can add them in correct order again
|
||||
if (updatePropertyTree) {
|
||||
std::vector<openspace::properties::PropertyOwner*> subs = propertySubOwners();
|
||||
for (int i = 0; i < subs.size(); i++) {
|
||||
for (size_t i = 0; i < subs.size(); i++) {
|
||||
removePropertySubOwner(subs[i]);
|
||||
}
|
||||
addPropertySubOwner(*corners);
|
||||
|
||||
Reference in New Issue
Block a user