Skip to content

Commit

Permalink
client: let us know when RE_RegisterModel is called with empty name
Browse files Browse the repository at this point in the history
(the mod should catch that), RE_RegisterModel fail message extended refs
#5
  • Loading branch information
IR4T4 committed Jan 30, 2013
1 parent 4794724 commit 78379b6
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/renderer/tr_model.c
Expand Up @@ -169,6 +169,7 @@ qhandle_t RE_RegisterModel(const char *name)

if (!name || !name[0])
{
ri.Printf(PRINT_DEVELOPER, "RE_RegisterModel: NULL name\n");
return 0;
}

Expand Down Expand Up @@ -366,7 +367,21 @@ qhandle_t RE_RegisterModel(const char *name)
fail:
// we still keep the model_t around, so if the model name is asked for
// again, we won't bother scanning the filesystem
ri.Printf(PRINT_DEVELOPER, "^6RE_RegisterModel: model not loaded %s\n", name);

// if the name contains no extension it might be a shader ...
if (!strstr(name, "."))
{
// FIXME: catch shader case earlier and avoid i/o (mod code?)
// - does this function add anything which is required for the shaders? see cacheGathering etc (on top)
// -- an early return for shader case shows it does ...
// - check mod->type = MOD_BAD for this case (see below)
ri.Printf(PRINT_DEVELOPER, "^6RE_RegisterModel: model not loaded %s - this is probably a shader\n", name);
}
else
{
ri.Printf(PRINT_DEVELOPER, "RE_RegisterModel: model not loaded %s\n", name);
}

mod->type = MOD_BAD;
return 0;
}
Expand Down

0 comments on commit 78379b6

Please sign in to comment.