diff --git a/contrib/sunplug/sunplug.cpp b/contrib/sunplug/sunplug.cpp index d91420a8..d506662d 100644 --- a/contrib/sunplug/sunplug.cpp +++ b/contrib/sunplug/sunplug.cpp @@ -225,7 +225,7 @@ void MapCoordinator(){ { auto button = new QPushButton( "Get optimal mapcoords" ); form->addWidget( button ); - QObject::connect( button, &QPushButton::clicked, [&](){ + QObject::connect( button, &QPushButton::clicked, [&, calc_min = calc_min, calc_max = calc_max](){ spin_minX->setValue( calc_min.x() ); spin_minY->setValue( calc_max.y() ); spin_maxX->setValue( calc_max.x() ); diff --git a/plugins/shaders/shaders.cpp b/plugins/shaders/shaders.cpp index 2e804a03..0ce5f456 100644 --- a/plugins/shaders/shaders.cpp +++ b/plugins/shaders/shaders.cpp @@ -876,10 +876,10 @@ public: } // IShaders implementation ----------------- - void IncRef(){ + void IncRef() override { ++m_refcount; } - void DecRef(){ + void DecRef() override { ASSERT_MESSAGE( m_refcount != 0, "shader reference-count going below zero" ); if ( --m_refcount == 0 ) { delete this; @@ -891,7 +891,7 @@ public: } // get/set the qtexture_t* Radiant uses to represent this shader object - qtexture_t* getTexture() const { + qtexture_t* getTexture() const override { return m_pTexture; } qtexture_t* getSkyBox() override { @@ -901,52 +901,52 @@ public: return m_pSkyBox; } - qtexture_t* getDiffuse() const { + qtexture_t* getDiffuse() const override { return m_pDiffuse; } - qtexture_t* getBump() const { + qtexture_t* getBump() const override { return m_pBump; } - qtexture_t* getSpecular() const { + qtexture_t* getSpecular() const override { return m_pSpecular; } // get shader name - const char* getName() const { + const char* getName() const override { return m_Name.c_str(); } - bool IsInUse() const { + bool IsInUse() const override { return m_bInUse; } - void SetInUse( bool bInUse ){ + void SetInUse( bool bInUse ) override { m_bInUse = bInUse; g_ActiveShadersChangedNotify(); } // get the shader flags - int getFlags() const { + int getFlags() const override { return m_template.m_nFlags; } // get the transparency value - float getTrans() const { + float getTrans() const override { return m_template.m_fTrans; } // test if it's a true shader, or a default shader created to wrap around a texture - bool IsDefault() const { + bool IsDefault() const override { return string_empty( m_filename ); } // get the alphaFunc - void getAlphaFunc( EAlphaFunc *func, float *ref ) { + void getAlphaFunc( EAlphaFunc *func, float *ref ) override { *func = m_template.m_AlphaFunc; *ref = m_template.m_AlphaRef; }; - BlendFunc getBlendFunc() const { + BlendFunc getBlendFunc() const override { return m_blendFunc; } // get the cull type - ECull getCull(){ + ECull getCull() override { return m_template.m_Cull; }; // get shader file name (ie the file where this one is defined) - const char* getShaderFileName() const { + const char* getShaderFileName() const override { return m_filename; } // ----------------------------------------- @@ -1090,20 +1090,20 @@ public: typedef std::vector MapLayers; MapLayers m_layers; - const ShaderLayer* firstLayer() const { + const ShaderLayer* firstLayer() const override { if ( m_layers.empty() ) { return 0; } return &m_layers.front(); } - void forEachLayer( const ShaderLayerCallback& callback ) const { + void forEachLayer( const ShaderLayerCallback& callback ) const override { for ( MapLayers::const_iterator i = m_layers.begin(); i != m_layers.end(); ++i ) { callback( *i ); } } - qtexture_t* lightFalloffImage() const { + qtexture_t* lightFalloffImage() const override { if ( !m_template.m_lightFalloffImage.empty() ) { return m_pLightFalloffImage; } diff --git a/radiant/entitylist.cpp b/radiant/entitylist.cpp index 050371f5..1b124147 100644 --- a/radiant/entitylist.cpp +++ b/radiant/entitylist.cpp @@ -116,7 +116,7 @@ void item_model_foreach( Functor f, QAbstractItemModel* model, QModelIndex paren } void EntityList_UpdateSelection( QAbstractItemModel* model, QTreeView* view ){ - item_model_foreach( [model, view]( QModelIndex &index ){ + item_model_foreach( [view]( QModelIndex &index ){ scene::Instance* instance = static_cast( index.data( c_ItemDataRole_Instance ).value() ); if ( Selectable* selectable = Instance_getSelectable( *instance ) ) { view->selectionModel()->select( index, selectable->isSelected() diff --git a/radiant/selection.cpp b/radiant/selection.cpp index e61ba278..22afe7c4 100644 --- a/radiant/selection.cpp +++ b/radiant/selection.cpp @@ -1799,10 +1799,10 @@ public: } bool isSelected() const { return m_selectable_x.isSelected() - | m_selectable_y.isSelected() - | m_selectable_z.isSelected() - | m_selectable_screen.isSelected() - | m_selectable_sphere.isSelected(); + || m_selectable_y.isSelected() + || m_selectable_z.isSelected() + || m_selectable_screen.isSelected() + || m_selectable_sphere.isSelected(); } }; diff --git a/tools/quake3/common/vfs.cpp b/tools/quake3/common/vfs.cpp index d1e7f948..bfe6e6c5 100644 --- a/tools/quake3/common/vfs.cpp +++ b/tools/quake3/common/vfs.cpp @@ -87,7 +87,7 @@ struct VFS_PAKFILE const CopiedString name; const unz_s zipinfo; VFS_PAK& pak; - const guint32 size; + const unsigned long size; }; // ============================================================================= diff --git a/tools/quake3/q3map2/light.cpp b/tools/quake3/q3map2/light.cpp index 3b8fc9ee..2724a50a 100644 --- a/tools/quake3/q3map2/light.cpp +++ b/tools/quake3/q3map2/light.cpp @@ -861,7 +861,7 @@ int LightContributionToSample( trace_t *trace ){ } /* clamp the distance to prevent super hot spots */ - dist = std::max( 16.0, sqrt( dist * dist + light->extraDist * light->extraDist ) ); + dist = std::max( 16.f, std::sqrt( dist * dist + light->extraDist * light->extraDist ) ); add = light->photons / ( dist * dist ) * angle; @@ -926,7 +926,7 @@ int LightContributionToSample( trace_t *trace ){ } /* clamp the distance to prevent super hot spots */ - dist = std::max( 16.0, sqrt( dist * dist + light->extraDist * light->extraDist ) ); + dist = std::max( 16.f, std::sqrt( dist * dist + light->extraDist * light->extraDist ) ); /* angle attenuation */ if ( light->flags & LightFlags::AttenAngle ) { @@ -1294,7 +1294,7 @@ static bool LightContributionToPoint( trace_t *trace ){ /* ptpff approximation */ if ( light->type == ELightType::Area && faster ) { /* clamp the distance to prevent super hot spots */ - dist = std::max( 16.0, sqrt( dist * dist + light->extraDist * light->extraDist ) ); + dist = std::max( 16.f, std::sqrt( dist * dist + light->extraDist * light->extraDist ) ); /* attenuate */ add = light->photons / ( dist * dist ); @@ -1342,7 +1342,7 @@ static bool LightContributionToPoint( trace_t *trace ){ /* point/spot lights */ else if ( light->type == ELightType::Point || light->type == ELightType::Spot ) { /* clamp the distance to prevent super hot spots */ - dist = std::max( 16.0, sqrt( dist * dist + light->extraDist * light->extraDist ) ); + dist = std::max( 16.f, std::sqrt( dist * dist + light->extraDist * light->extraDist ) ); /* attenuate */ if ( light->flags & LightFlags::AttenLinear ) { @@ -1720,7 +1720,7 @@ static void SetupGrid(){ /* quantize it */ const Vector3 oldGridSize = gridSize; for ( int i = 0; i < 3; i++ ) - gridSize[ i ] = std::max( 8.0, floor( gridSize[ i ] ) ); + gridSize[ i ] = std::max( 8.f, std::floor( gridSize[ i ] ) ); /* ydnar: increase gridSize until grid count is smaller than max allowed */ size_t numGridPoints; diff --git a/tools/quake3/q3map2/light_ydnar.cpp b/tools/quake3/q3map2/light_ydnar.cpp index c842d9e4..f21c4138 100644 --- a/tools/quake3/q3map2/light_ydnar.cpp +++ b/tools/quake3/q3map2/light_ydnar.cpp @@ -1701,7 +1701,7 @@ static float DirtForSample( trace_t *trace ){ } /* apply gain (does this even do much? heh) */ - outDirt = std::min( 1.0, pow( gatherDirt / ( numDirtVectors + 1 ), dirtGain ) ); + outDirt = std::min( 1.f, std::pow( gatherDirt / ( numDirtVectors + 1 ), dirtGain ) ); /* apply scale */ outDirt *= dirtScale; diff --git a/tools/quake3/q3map2/shaders.cpp b/tools/quake3/q3map2/shaders.cpp index 7e7adc24..0ada4d03 100644 --- a/tools/quake3/q3map2/shaders.cpp +++ b/tools/quake3/q3map2/shaders.cpp @@ -623,7 +623,7 @@ static void FinishShader( shaderInfo_t *si ){ } /* find pixel coordinates best matching the average color of the image */ - float bestDist = 99999999; + float bestDist = 99999999.f; const Vector2 o( 1.0f / si->shaderImage->width, 1.0f / si->shaderImage->height ); for ( y = 0, st[ 1 ] = 0.0f; y < si->shaderImage->height; y++, st[ 1 ] += o[ 1 ] ) {