Skip to content

Commit

Permalink
Renderer|Particles: Don’t warn needlessly about missing particle text…
Browse files Browse the repository at this point in the history
…ures

Instead of warning, print an INFO-level message about which textures
were successfully loaded.

Warnings are still printed if loading of an image file fails.
  • Loading branch information
skyjake committed Jan 3, 2014
1 parent f93e235 commit 9b2f76e
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions doomsday/client/src/render/rend_particle.cpp
Expand Up @@ -137,24 +137,21 @@ static Path tryFindImage(String name)
}

// Try to load the texture.
static byte loadParticleTexture(uint particleTex, bool silent)
static byte loadParticleTexture(uint particleTex)
{
DENG_ASSERT(particleTex < MAX_PTC_TEXTURES);

String particleImageName = String("Particle%1").arg(particleTex, 2, 10, QChar('0'));
Path foundPath = tryFindImage(particleImageName);
if(foundPath.isEmpty())
{
if(!silent)
{
LOG_WARNING("Failed locating image resource for \"%s\".") << particleImageName;
}
return 0;
}

image_t image;
if(!GL_LoadImage(image, foundPath.toUtf8().constData()))
{
LOG_WARNING("Failed to load \"%s\"") << foundPath;
return 0;
}

// If 8-bit with no alpha, generate alpha automatically.
if(image.pixelSize == 1)
Expand Down Expand Up @@ -206,14 +203,19 @@ void Rend_ParticleLoadExtraTextures()
Rend_ParticleReleaseExtraTextures();
if(!App_GameLoaded()) return;

bool reported = false;
QList<int> loaded;
for(int i = 0; i < MAX_PTC_TEXTURES; ++i)
{
if(!loadParticleTexture(i, reported))
if(loadParticleTexture(i))
{
reported = true;
loaded.append(i);
}
}

if(!loaded.isEmpty())
{
LOG_INFO("Loaded textures for particle IDs: %s") << Rangei::contiguousRangesAsText(loaded);
}
}

void Rend_ParticleReleaseSystemTextures()
Expand Down

0 comments on commit 9b2f76e

Please sign in to comment.