Skip to content

Commit

Permalink
Merge branch 'particles_instanced' of github.com:cpvrlab/SLProject4 i…
Browse files Browse the repository at this point in the history
…nto particles_instanced
  • Loading branch information
luc committed Nov 27, 2023
2 parents 28df38b + 373ea04 commit 5f48dd1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion modules/sl/source/SL.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ SL_sizeOfVector(const T& vector)
//-----------------------------------------------------------------------------
// Some debugging and error handling macros
#define SL_LOG(...) Utils::log("SLProject", __VA_ARGS__)
#define SL_EXIT_MSG(message) Utils::log("SLProject Error", (message))
#define SL_EXIT_MSG(message) Utils::exitMsg("SLProject", (message), __LINE__, __FILE__)
#define SL_WARN_MSG(message) Utils::warnMsg("SLProject", (message), __LINE__, __FILE__)
//-----------------------------------------------------------------------------
#endif
2 changes: 1 addition & 1 deletion modules/sl/source/SLAssetManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ bool SLAssetManager::removeMesh(SLMesh* mesh)
}
return false;
}

//-----------------------------------------------------------------------------
//! Removes the specified program from the meshes resource vector.
bool SLAssetManager::removeProgram(SLGLProgram* program)
{
Expand Down
18 changes: 10 additions & 8 deletions modules/sl/source/SLMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ SLMaterial::SLMaterial(SLAssetManager* am,
SLGLProgram* program) : SLObject(name)
{
_assetManager = am;
_ambient.set(0, 0, 0); // not used in Cook-Torrance
_ambient.set(0, 0, 0); // not used in Cook-Torrance
_diffuse = diffuse;
_specular.set(1, 1, 1); // not used in Cook-Torrance
_emissive.set(0, 0, 0, 0); // not used in Cook-Torrance
Expand Down Expand Up @@ -372,8 +372,7 @@ SLMaterial::~SLMaterial()
_errorTexture = nullptr;
}
}


//------------------------------------------------------------------------------
void SLMaterial::deleteDataGpu()
{
if (_program)
Expand All @@ -384,8 +383,6 @@ void SLMaterial::deleteDataGpu()
_program = nullptr;
}
}


//-----------------------------------------------------------------------------
/*!
If this material has not yet a shader program assigned (SLMaterial::_program)
Expand All @@ -403,7 +400,10 @@ void SLMaterial::generateProgramPS(bool renderInstanced)

// Check first the asset manager if the requested program type already exists
string programNameDraw;
SLGLProgramGenerated::buildProgramNamePS(this, programNameDraw, true, renderInstanced);
SLGLProgramGenerated::buildProgramNamePS(this,
programNameDraw,
true,
renderInstanced);
_program = _assetManager->getProgramByName(programNameDraw);

// If the program was not found by name generate a new one
Expand Down Expand Up @@ -478,7 +478,8 @@ void SLMaterial::generateProgramPS(bool renderInstanced)
for (int i = 0; i < TT_numTextureType; i++)
_textures[i].clear();
if (!_errorTexture && !_compileErrorTexFilePath.empty())
_errorTexture = new SLGLTexture(nullptr, _compileErrorTexFilePath);
_errorTexture = new SLGLTexture(nullptr,
_compileErrorTexFilePath);
_textures[TT_diffuse].push_back(_errorTexture);
}

Expand All @@ -487,7 +488,8 @@ void SLMaterial::generateProgramPS(bool renderInstanced)
for (int i = 0; i < TT_numTextureType; i++)
_textures[i].clear();
if (!_errorTexture && !_compileErrorTexFilePath.empty())
_errorTexture = new SLGLTexture(nullptr, _compileErrorTexFilePath);
_errorTexture = new SLGLTexture(nullptr,
_compileErrorTexFilePath);
_textures[TT_diffuse].push_back(_errorTexture);
}
}
Expand Down
1 change: 1 addition & 0 deletions modules/sl/source/gl/SLGLShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ SLbool SLGLShader::createAndCompile(SLVLight* lights)
SLint lineNum = 1;
for (string& line : lines)
SL_LOG("%4d: %s", lineNum++, line.c_str());
SL_LOG("\n");
return false;
}

Expand Down
6 changes: 3 additions & 3 deletions modules/utils/source/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ vector<string> getStringLines(const string& multiLineString)
{
std::string line;
std::getline(stream, line);
if (!stream.good())
break;
line = Utils::trimString(line, "\r");
res.push_back(line);
if (!stream.good())
break;
}
return res;
}
Expand Down Expand Up @@ -1391,7 +1391,7 @@ std::string ComputerInfos::get()
// model = model;
# endif

#elif defined(ANDROID) //................................................
#elif defined(ANDROID) //................................................

os = "Android";

Expand Down

0 comments on commit 5f48dd1

Please sign in to comment.