mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-23 05:19:18 -06:00
Remove warnings
This commit is contained in:
Submodule ext/ghoul updated: eef92b2f8f...5bc318245d
@@ -93,7 +93,7 @@ struct TestResult {
|
||||
|
||||
|
||||
/// Is \c true if the TestResult is positive, \c false otherwise
|
||||
bool success;
|
||||
bool success = false;
|
||||
/// Contains a list of offenses that were found in the test. Is empty if
|
||||
/// TestResult::Success is \c true
|
||||
std::vector<Offense> offenses;
|
||||
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
Relative
|
||||
};
|
||||
|
||||
Type type;
|
||||
Type type = Type::Absolute;
|
||||
std::string value;
|
||||
};
|
||||
struct CameraNavState {
|
||||
|
||||
@@ -47,8 +47,8 @@ struct Keyframe : public KeyframeBase {
|
||||
Keyframe(size_t i, double t, T d);
|
||||
|
||||
Keyframe(Keyframe const&) = default;
|
||||
Keyframe(Keyframe&&) = default;
|
||||
Keyframe& operator=(Keyframe&&) = default;
|
||||
Keyframe(Keyframe&&) noexcept = default;
|
||||
Keyframe& operator=(Keyframe&&) noexcept = default;
|
||||
Keyframe& operator=(Keyframe const&) = default;
|
||||
T data;
|
||||
};
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace openspace {
|
||||
|
||||
struct TimeKeyframeData {
|
||||
Time time;
|
||||
double delta;
|
||||
double delta = 0.0;
|
||||
bool pause = false;
|
||||
bool jump = false;
|
||||
};
|
||||
|
||||
@@ -203,13 +203,13 @@ namespace {
|
||||
std::optional<AnimationMode> animationMode;
|
||||
|
||||
// [[codegen::verbatim(AmbientIntensityInfo.description)]]
|
||||
std::optional<double> ambientIntensity;
|
||||
std::optional<float> ambientIntensity;
|
||||
|
||||
// [[codegen::verbatim(DiffuseIntensityInfo.description)]]
|
||||
std::optional<double> diffuseIntensity;
|
||||
std::optional<float> diffuseIntensity;
|
||||
|
||||
// [[codegen::verbatim(SpecularIntensityInfo.description)]]
|
||||
std::optional<double> specularIntensity;
|
||||
std::optional<float> specularIntensity;
|
||||
|
||||
// [[codegen::verbatim(ShadingInfo.description)]]
|
||||
std::optional<bool> performShading;
|
||||
@@ -385,7 +385,9 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
|
||||
_geometry->setTimeScale(convertTime(1.0, timeUnit, TimeUnit::Second));
|
||||
_geometry->setTimeScale(static_cast<float>(
|
||||
convertTime(1.0, timeUnit, TimeUnit::Second))
|
||||
);
|
||||
}
|
||||
else {
|
||||
throw ghoul::MissingCaseException();
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
namespace {
|
||||
constexpr const char* ProgramName = "Plane";
|
||||
|
||||
enum BlendMode {
|
||||
BlendModeNormal = 0,
|
||||
BlendModeAdditive
|
||||
enum class BlendMode {
|
||||
Normal = 0,
|
||||
Additive
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo BillboardInfo = {
|
||||
@@ -121,15 +121,15 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
|
||||
_billboard = p.billboard.value_or(_billboard);
|
||||
|
||||
_blendMode.addOptions({
|
||||
{ BlendModeNormal, "Normal" },
|
||||
{ BlendModeAdditive, "Additive"}
|
||||
{ static_cast<int>(BlendMode::Normal), "Normal" },
|
||||
{ static_cast<int>(BlendMode::Additive), "Additive"}
|
||||
});
|
||||
_blendMode.onChange([&]() {
|
||||
switch (_blendMode) {
|
||||
case BlendModeNormal:
|
||||
case static_cast<int>(BlendMode::Normal):
|
||||
setRenderBinFromOpacity();
|
||||
break;
|
||||
case BlendModeAdditive:
|
||||
case static_cast<int>(BlendMode::Additive):
|
||||
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
|
||||
break;
|
||||
default:
|
||||
@@ -138,17 +138,17 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
|
||||
});
|
||||
|
||||
_opacity.onChange([&]() {
|
||||
if (_blendMode == BlendModeNormal) {
|
||||
if (_blendMode == static_cast<int>(BlendMode::Normal)) {
|
||||
setRenderBinFromOpacity();
|
||||
}
|
||||
});
|
||||
|
||||
if (p.blendMode.has_value()) {
|
||||
if (*p.blendMode == Parameters::BlendMode::Normal) {
|
||||
_blendMode = BlendModeNormal;
|
||||
_blendMode = static_cast<int>(BlendMode::Normal);
|
||||
}
|
||||
else if (*p.blendMode == Parameters::BlendMode::Additive) {
|
||||
_blendMode = BlendModeAdditive;
|
||||
_blendMode = static_cast<int>(BlendMode::Additive);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,10 +264,14 @@ void RenderablePlane::render(const RenderData& data, RendererTasks&) {
|
||||
RenderEngine::RendererImplementation::ABuffer;
|
||||
|
||||
if (usingABufferRenderer) {
|
||||
_shader->setUniform("additiveBlending", _blendMode == BlendModeAdditive);
|
||||
_shader->setUniform(
|
||||
"additiveBlending",
|
||||
_blendMode == static_cast<int>(BlendMode::Additive)
|
||||
);
|
||||
}
|
||||
|
||||
bool additiveBlending = (_blendMode == BlendModeAdditive) && usingFramebufferRenderer;
|
||||
bool additiveBlending =
|
||||
(_blendMode == static_cast<int>(BlendMode::Additive)) && usingFramebufferRenderer;
|
||||
if (additiveBlending) {
|
||||
glDepthMask(false);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
|
||||
@@ -432,10 +432,10 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
}
|
||||
|
||||
const bool renderLines = (_appearance.renderingModes == RenderingModeLines) |
|
||||
const bool renderLines = (_appearance.renderingModes == RenderingModeLines) ||
|
||||
(_appearance.renderingModes == RenderingModeLinesPoints);
|
||||
|
||||
const bool renderPoints = (_appearance.renderingModes == RenderingModePoints) |
|
||||
const bool renderPoints = (_appearance.renderingModes == RenderingModePoints) ||
|
||||
(_appearance.renderingModes == RenderingModeLinesPoints);
|
||||
|
||||
if (renderLines) {
|
||||
|
||||
@@ -124,12 +124,16 @@ namespace {
|
||||
int iDataset = -1;
|
||||
std::array<char, 256> IdentifierBuffer;
|
||||
std::fill(IdentifierBuffer.begin(), IdentifierBuffer.end(), '\0');
|
||||
sscanf(
|
||||
int ret = sscanf(
|
||||
subDatasets[i],
|
||||
"SUBDATASET_%i_%256[^=]",
|
||||
&iDataset,
|
||||
IdentifierBuffer.data()
|
||||
);
|
||||
if (ret != 2) {
|
||||
LERROR("Error parsing dataset");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (iDataset != currentLayerNumber) {
|
||||
|
||||
@@ -727,7 +727,10 @@ void RenderableGlobe::render(const RenderData& data, RendererTasks& rendererTask
|
||||
// Render from light source point of view
|
||||
renderChunks(lightRenderData, rendererTask, {}, true);
|
||||
if (_hasRings && _ringsComponent.isEnabled()) {
|
||||
_ringsComponent.draw(lightRenderData, RingsComponent::GeometryOnly);
|
||||
_ringsComponent.draw(
|
||||
lightRenderData,
|
||||
RingsComponent::RenderPass::GeometryOnly
|
||||
);
|
||||
}
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
@@ -739,7 +742,7 @@ void RenderableGlobe::render(const RenderData& data, RendererTasks& rendererTask
|
||||
if (_hasRings && _ringsComponent.isEnabled()) {
|
||||
_ringsComponent.draw(
|
||||
data,
|
||||
RingsComponent::GeometryAndShading,
|
||||
RingsComponent::RenderPass::GeometryAndShading,
|
||||
_shadowComponent.shadowMapData()
|
||||
);
|
||||
}
|
||||
@@ -747,7 +750,10 @@ void RenderableGlobe::render(const RenderData& data, RendererTasks& rendererTask
|
||||
else {
|
||||
renderChunks(data, rendererTask);
|
||||
if (_hasRings && _ringsComponent.isEnabled()) {
|
||||
_ringsComponent.draw(data, RingsComponent::GeometryAndShading);
|
||||
_ringsComponent.draw(
|
||||
data,
|
||||
RingsComponent::RenderPass::GeometryAndShading
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,14 +382,13 @@ void RingsComponent::deinitializeGL() {
|
||||
_geometryOnlyShader = nullptr;
|
||||
}
|
||||
|
||||
void RingsComponent::draw(const RenderData& data,
|
||||
const RingsComponent::RenderPass renderPass,
|
||||
void RingsComponent::draw(const RenderData& data, RenderPass renderPass,
|
||||
const ShadowComponent::ShadowMapData& shadowData)
|
||||
{
|
||||
if (renderPass == GeometryAndShading) {
|
||||
if (renderPass == RenderPass::GeometryAndShading) {
|
||||
_shader->activate();
|
||||
}
|
||||
else if (renderPass == GeometryOnly) {
|
||||
else if (renderPass == RenderPass::GeometryOnly) {
|
||||
_geometryOnlyShader->activate();
|
||||
}
|
||||
|
||||
@@ -408,7 +407,7 @@ void RingsComponent::draw(const RenderData& data,
|
||||
ghoul::opengl::TextureUnit ringTextureUnlitUnit;
|
||||
ghoul::opengl::TextureUnit ringTextureColorUnit;
|
||||
ghoul::opengl::TextureUnit ringTextureTransparencyUnit;
|
||||
if (renderPass == GeometryAndShading) {
|
||||
if (renderPass == RenderPass::GeometryAndShading) {
|
||||
if (_isAdvancedTextureEnabled) {
|
||||
_shader->setUniform(
|
||||
_uniformCacheAdvancedRings.modelViewProjectionMatrix,
|
||||
@@ -542,7 +541,7 @@ void RingsComponent::draw(const RenderData& data,
|
||||
glEnablei(GL_BLEND, 0);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
else if (renderPass == GeometryOnly) {
|
||||
else if (renderPass == RenderPass::GeometryOnly) {
|
||||
_geometryOnlyShader->setUniform(
|
||||
_geomUniformCache.modelViewProjectionMatrix,
|
||||
modelViewProjectionTransform
|
||||
@@ -568,12 +567,11 @@ void RingsComponent::draw(const RenderData& data,
|
||||
|
||||
glEnable(GL_CULL_FACE);
|
||||
|
||||
if (renderPass == GeometryAndShading) {
|
||||
if (renderPass == RenderPass::GeometryAndShading) {
|
||||
_shader->deactivate();
|
||||
global::renderEngine->openglStateCache().resetBlendState();
|
||||
//global::renderEngine->openglStateCache().resetDepthState();
|
||||
}
|
||||
else if (renderPass == GeometryOnly) {
|
||||
else if (renderPass == RenderPass::GeometryOnly) {
|
||||
_geometryOnlyShader->deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace documentation { struct Documentation; }
|
||||
|
||||
class RingsComponent : public properties::PropertyOwner {
|
||||
public:
|
||||
enum RenderPass {
|
||||
enum class RenderPass {
|
||||
GeometryOnly,
|
||||
GeometryAndShading
|
||||
};
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
|
||||
bool isReady() const;
|
||||
|
||||
void draw(const RenderData& data, const RingsComponent::RenderPass renderPass,
|
||||
void draw(const RenderData& data, RenderPass renderPass,
|
||||
const ShadowComponent::ShadowMapData& shadowData = {}
|
||||
);
|
||||
void update(const UpdateData& data);
|
||||
|
||||
@@ -192,7 +192,7 @@ TileTextureInitData TileTextureInitData::operator=(const TileTextureInitData& rh
|
||||
return rhs;
|
||||
}
|
||||
|
||||
TileTextureInitData TileTextureInitData::operator=(TileTextureInitData&& rhs) {
|
||||
TileTextureInitData TileTextureInitData::operator=(TileTextureInitData&& rhs) noexcept {
|
||||
if (this == &rhs) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
TileTextureInitData(TileTextureInitData&& original) = default;
|
||||
|
||||
TileTextureInitData operator=(const TileTextureInitData& rhs);
|
||||
TileTextureInitData operator=(TileTextureInitData&& rhs);
|
||||
TileTextureInitData operator=(TileTextureInitData&& rhs) noexcept;
|
||||
|
||||
~TileTextureInitData() = default;
|
||||
|
||||
|
||||
@@ -36,8 +36,9 @@ public:
|
||||
|
||||
void handleJson(const nlohmann::json& json) override;
|
||||
bool isDone() const override;
|
||||
|
||||
private:
|
||||
void runScript(const std::string& script, bool returnValue);
|
||||
void runScript(std::string script, bool returnValue);
|
||||
|
||||
bool _waitingForReturnValue = true;
|
||||
};
|
||||
|
||||
@@ -176,7 +176,7 @@ void LuaScriptTopic::handleJson(const nlohmann::json& json) {
|
||||
}
|
||||
}
|
||||
|
||||
void LuaScriptTopic::runScript(const std::string& script, bool shouldReturn) {
|
||||
void LuaScriptTopic::runScript(std::string script, bool shouldReturn) {
|
||||
scripting::ScriptEngine::ScriptCallback callback;
|
||||
if (shouldReturn) {
|
||||
callback = [this](ghoul::Dictionary data) {
|
||||
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
struct ConstellationBound {
|
||||
std::string constellationAbbreviation; ///< The abbreviation of the constellation
|
||||
std::string constellationFullName;
|
||||
bool isEnabled;
|
||||
bool isEnabled = false;
|
||||
GLsizei startIndex; ///< The index of the first vertex describing the bounds
|
||||
GLsizei nVertices; ///< The number of vertices describing the bounds
|
||||
};
|
||||
|
||||
@@ -38,13 +38,13 @@ BooleanType(SkipAllZeroLines);
|
||||
|
||||
struct Dataset {
|
||||
struct Variable {
|
||||
int index;
|
||||
int index = -1;
|
||||
std::string name;
|
||||
};
|
||||
std::vector<Variable> variables;
|
||||
|
||||
struct Texture {
|
||||
int index;
|
||||
int index = -1;
|
||||
std::string file;
|
||||
};
|
||||
std::vector<Texture> textures;
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace {
|
||||
// mu = G*M_earth
|
||||
double period = std::chrono::seconds(std::chrono::hours(24)).count() / meanMotion;
|
||||
|
||||
const double pisq = glm::pi<double>() * glm::pi<double>();
|
||||
constexpr const double pisq = glm::pi<double>() * glm::pi<double>();
|
||||
double semiMajorAxis = pow((muEarth * period*period) / (4 * pisq), 1.0 / 3.0);
|
||||
|
||||
// We need the semi major axis in km instead of m
|
||||
|
||||
@@ -40,7 +40,7 @@ int bindKey(lua_State* L) {
|
||||
int nArguments = ghoul::lua::checkArgumentsAndThrow(L, { 2, 5 }, "lua::bindKey");
|
||||
|
||||
const std::string& key = ghoul::lua::value<std::string>(L, 1);
|
||||
const std::string& command = ghoul::lua::value<std::string>(L, 2);
|
||||
std::string command = ghoul::lua::value<std::string>(L, 2);
|
||||
|
||||
if (command.empty()) {
|
||||
lua_settop(L, 0);
|
||||
@@ -85,7 +85,7 @@ int bindKeyLocal(lua_State* L) {
|
||||
int nArguments = ghoul::lua::checkArgumentsAndThrow(L, { 2, 5 }, "lua::bindKeyLocal");
|
||||
|
||||
const std::string& key = ghoul::lua::value<std::string>(L, 1);
|
||||
const std::string& command = ghoul::lua::value<std::string>(L, 2);
|
||||
std::string command = ghoul::lua::value<std::string>(L, 2);
|
||||
|
||||
if (command.empty()) {
|
||||
return ghoul::lua::luaError(L, "Command string is empty");
|
||||
|
||||
@@ -228,8 +228,15 @@ int joystickAxis(lua_State* L) {
|
||||
const bool invert = info.invert;
|
||||
const bool normalize = info.normalize;
|
||||
const bool isSticky = info.isSticky;
|
||||
const float sensitivity = info.sensitivity;
|
||||
ghoul::lua::push(L, ghoul::to_string(info.type), invert, normalize, isSticky, sensitivity);
|
||||
const double sensitivity = info.sensitivity;
|
||||
ghoul::lua::push(
|
||||
L,
|
||||
ghoul::to_string(info.type),
|
||||
invert,
|
||||
normalize,
|
||||
isSticky,
|
||||
sensitivity
|
||||
);
|
||||
|
||||
ghoul_assert(lua_gettop(L) == 5, "Incorrect number of items left on stack");
|
||||
return 5;
|
||||
@@ -268,8 +275,8 @@ int bindJoystickButton(lua_State* L) {
|
||||
);
|
||||
|
||||
const int button = ghoul::lua::value<int>(L, 1);
|
||||
const std::string& command = ghoul::lua::value<std::string>(L, 2);
|
||||
const std::string& documentation = ghoul::lua::value<std::string>(L, 3);
|
||||
std::string command = ghoul::lua::value<std::string>(L, 2);
|
||||
std::string documentation = ghoul::lua::value<std::string>(L, 3);
|
||||
|
||||
interaction::JoystickAction action = interaction::JoystickAction::Press;
|
||||
if (n >= 4) {
|
||||
@@ -282,10 +289,10 @@ int bindJoystickButton(lua_State* L) {
|
||||
|
||||
global::navigationHandler->bindJoystickButtonCommand(
|
||||
button,
|
||||
std::move(command),
|
||||
command,
|
||||
action,
|
||||
interaction::JoystickCameraStates::ButtonCommandRemote(isRemote),
|
||||
std::move(documentation)
|
||||
documentation
|
||||
);
|
||||
|
||||
ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack");
|
||||
|
||||
@@ -43,9 +43,10 @@ void VersionChecker::requestLatestVersion(const std::string& url) {
|
||||
HttpRequest::RequestOptions opt;
|
||||
opt.requestTimeoutSeconds = 0;
|
||||
|
||||
const std::string fullUrl = url +
|
||||
"?client_version=" + OPENSPACE_VERSION_NUMBER +
|
||||
"&commit_hash=" + OPENSPACE_GIT_COMMIT;
|
||||
std::string fullUrl = fmt::format(
|
||||
"{}?client_version={}&commit_hash={}",
|
||||
url, OPENSPACE_VERSION_NUMBER, OPENSPACE_GIT_COMMIT
|
||||
);
|
||||
|
||||
if (_request) {
|
||||
_request->cancel();
|
||||
|
||||
Reference in New Issue
Block a user