Remove warnings

This commit is contained in:
Alexander Bock
2021-05-25 22:06:49 +02:00
parent d2f9530885
commit cb17bd7570
22 changed files with 81 additions and 58 deletions
+6 -4
View File
@@ -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();
+16 -12
View File
@@ -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);
+2 -2
View File
@@ -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) {