MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / InitFromFile

Method InitFromFile

neo/renderer/Model.cpp:280–318  ·  view source on GitHub ↗

================ idRenderModelStatic::InitFromFile ================ */

Source from the content-addressed store, hash-verified

278================
279*/
280void idRenderModelStatic::InitFromFile( const char *fileName ) {
281 bool loaded;
282 idStr extension;
283
284 InitEmpty( fileName );
285
286 // FIXME: load new .proc map format
287
288 name.ExtractFileExtension( extension );
289
290 if ( extension.Icmp( "ase" ) == 0 ) {
291 loaded = LoadASE( name );
292 reloadable = true;
293 } else if ( extension.Icmp( "lwo" ) == 0 ) {
294 loaded = LoadLWO( name );
295 reloadable = true;
296 } else if ( extension.Icmp( "flt" ) == 0 ) {
297 loaded = LoadFLT( name );
298 reloadable = true;
299 } else if ( extension.Icmp( "ma" ) == 0 ) {
300 loaded = LoadMA( name );
301 reloadable = true;
302 } else {
303 common->Warning( "idRenderModelStatic::InitFromFile: unknown type for model: \'%s\'", name.c_str() );
304 loaded = false;
305 }
306
307 if ( !loaded ) {
308 common->Warning( "Couldn't load model: '%s'", name.c_str() );
309 MakeDefaultModel();
310 return;
311 }
312
313 // it is now available for use
314 purged = false;
315
316 // create the bounds for culling and dynamic surface creation
317 FinishSurfaces();
318}
319
320/*
321================

Callers 5

CacheDictionaryMediaMethod · 0.45
R_TestVideo_fFunction · 0.45
GetModelMethod · 0.45
ParseStageMethod · 0.45
CacheDictionaryMediaMethod · 0.45

Calls 4

ExtractFileExtensionMethod · 0.80
IcmpMethod · 0.60
WarningMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected