Skip to content

Some warnings correction #7975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/openFrameworks/gl/ofCubeMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ofCubeMap {
void drawPrefilteredCube(float aRoughness);

bool isEnabled() { return data->isEnabled; }
const bool isEnabled() const { return data->isEnabled; }
bool isEnabled() const { return data->isEnabled; }
void setEnabled(bool ab) { data->isEnabled = ab; }

bool hasCubeMap();
Expand Down
2 changes: 1 addition & 1 deletion libs/openFrameworks/gl/ofMaterial.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class ofMaterial : public ofBaseMaterial {

/// \brief is this material pbr. Setting PBR functions or textures will automatically set the material to pbr.\nCan also be set calling setPBR(bool);
/// \return is the material pbr.
const bool isPBR() const { return data.isPbr; }
bool isPBR() const { return data.isPbr; }
/// \brief enable or disable PBR for this material. Default is disabled.
void setPBR(bool ab);

Expand Down
2 changes: 1 addition & 1 deletion libs/openFrameworks/gl/ofShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ string ofShader::parseForIncludes(const string & source, const of::filesystem::p
string ofShader::parseForIncludes(const string & source, vector<string> & included, int level, const of::filesystem::path & sourceDirectoryPath) {

if (level > 32) {
ofLogError("ofShader", "glsl header inclusion depth limit reached, might be caused by cyclic header inclusion");
ofLogError("ofShader") << "glsl header inclusion depth limit reached, might be caused by cyclic header inclusion";
return "";
}

Expand Down
10 changes: 5 additions & 5 deletions libs/openFrameworks/gl/ofShadow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,20 +649,20 @@ void ofShadow::setEnabled( bool ab ) {
}

//--------------------------------------------------------------
const bool ofShadow::isMultiCubeFacePass() const {
bool ofShadow::isMultiCubeFacePass() const {
if( data->lightType == OF_LIGHT_POINT ) {
return !isSingleOmniPass();
}
return false;
}

//--------------------------------------------------------------
const bool ofShadow::isSingleOmniPass() const {
bool ofShadow::isSingleOmniPass() const {
return mBSinglePass;
}

//--------------------------------------------------------------
const int ofShadow::getNumShadowDepthPasses() const {
int ofShadow::getNumShadowDepthPasses() const {
if(isMultiCubeFacePass()) {
return 6;
}
Expand Down Expand Up @@ -1142,11 +1142,11 @@ void ofShadow::_updateNumShadows() {
#include "shaders/shadowDepth.frag"
#include "shaders/shadowDepthCubeGeom.glsl"

const bool ofShadow::setupShadowDepthShader(ofShader& ashader, const std::string aShaderMain) const {
bool ofShadow::setupShadowDepthShader(ofShader& ashader, const std::string aShaderMain) const {
return setupShadowDepthShader( ashader, data->lightType, aShaderMain, isSingleOmniPass() );
}

const bool ofShadow::setupShadowDepthShader(ofShader& ashader, int aLightType, const std::string aShaderMain, bool abSinglePass) const {
bool ofShadow::setupShadowDepthShader(ofShader& ashader, int aLightType, const std::string aShaderMain, bool abSinglePass) const {
std::string gversion = "#version 150\n";

#ifdef TARGET_OPENGLES
Expand Down
16 changes: 8 additions & 8 deletions libs/openFrameworks/gl/ofShadow.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ class ofShadow {
void setNearClip( float anear ) { data->nearClip = anear; }
void setFarClip( float afar ) { data->farClip = afar; }

const bool isMultiCubeFacePass() const;
const bool isSingleOmniPass() const;
const int getNumShadowDepthPasses() const;
bool isMultiCubeFacePass() const;
bool isSingleOmniPass() const;
int getNumShadowDepthPasses() const;
void setSingleOmniPass( bool ab );
int getDepthMapWidth();
int getDepthMapHeight();
Expand All @@ -148,13 +148,13 @@ class ofShadow {
const float& getStrength() { return data->strength; }
void setStrength(float astrength) { data->strength = astrength; }

const float getBias() { return data->bias; }
float getBias() const { return data->bias; }
void setBias( float abias ) { data->bias = abias; }

const float getNormalBias() { return data->normalBias; }
float getNormalBias() const { return data->normalBias; }
void setNormalBias( float abias ) { data->normalBias = abias; }

const float getSampleRadius() { return data->sampleRadius; }
float getSampleRadius() const { return data->sampleRadius; }
void setSampleRadius( float aradius ) { data->sampleRadius = aradius; }

void setAreaLightSize( float awidth, float aheight ) {mAreaLightWidth=awidth;mAreaLightHeight=aheight;};
Expand All @@ -165,8 +165,8 @@ class ofShadow {
std::string getShadowTypeAsString();

const ofShader & getDepthShader(ofGLProgrammableRenderer & renderer) const;
const bool setupShadowDepthShader(ofShader& ashader, const std::string aShaderMain) const;
const bool setupShadowDepthShader(ofShader& ashader, int aLightType, const std::string aShaderMain, bool abSinglePass) const;
bool setupShadowDepthShader(ofShader& ashader, const std::string aShaderMain) const;
bool setupShadowDepthShader(ofShader& ashader, int aLightType, const std::string aShaderMain, bool abSinglePass) const;
void updateDepth(const ofShader & shader,ofGLProgrammableRenderer & renderer) const;
void updateDepth(const ofShader & shader,GLenum aCubeFace,ofGLProgrammableRenderer & renderer) const;

Expand Down
2 changes: 1 addition & 1 deletion libs/openFrameworks/graphics/ofImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ static bool saveImage(const ofPixels_<PixelType> & _pix, ofBuffer & buffer, ofIm
ofInitFreeImage();

if (_pix.isAllocated() == false){
ofLogError("ofImage","saveImage(): couldn't save to ofBuffer, pixels are not allocated");
ofLogError("ofImage") << "saveImage(): couldn't save to ofBuffer, pixels are not allocated";
return false;
}

Expand Down