Skip to content

Commit

Permalink
EMI: Only substitute missing materials in demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Botje committed Sep 9, 2012
1 parent 8369bcc commit 89d0874
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions engines/grim/resource.cpp
Expand Up @@ -400,9 +400,13 @@ Material *ResourceLoader::loadMaterial(const Common::String &filename, CMap *c)

stream = openNewStreamFile(fname.c_str(), true);
if(!stream) {
const Common::String replacement("fx/candle.sprb");
warning("Could not find material %s, using %s instead", filename.c_str(), replacement.c_str());
return loadMaterial(replacement, NULL);
// FIXME: EMI demo references files that aren't included. Return a known material.
// This should be fixed in the data files instead.
if (g_grim->getGameType() == GType_MONKEY4 && g_grim->getGameFlags() & ADGF_DEMO) {
const Common::String replacement("fx/candle.sprb");
warning("Could not find material %s, using %s instead", filename.c_str(), replacement.c_str());
return loadMaterial(replacement, NULL);
}
}

Material *result = new Material(fname, stream, c);
Expand Down

0 comments on commit 89d0874

Please sign in to comment.