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

Method GetFilenum

neo/d3xp/script/Script_Program.cpp:2174–2192  ·  view source on GitHub ↗

================ idProgram::GetFilenum ================ */

Source from the content-addressed store, hash-verified

2172================
2173*/
2174int idProgram::GetFilenum( const char *name ) {
2175 if ( filename == name ) {
2176 return filenum;
2177 }
2178
2179 idStr strippedName;
2180 strippedName = fileSystem->OSPathToRelativePath( name );
2181 if ( !strippedName.Length() ) {
2182 // not off the base path so just use the full path
2183 filenum = fileList.AddUnique( name );
2184 } else {
2185 filenum = fileList.AddUnique( strippedName );
2186 }
2187
2188 // save the unstripped name so that we don't have to strip the incoming name every time we call GetFilenum
2189 filename = name;
2190
2191 return filenum;
2192}
2193
2194/*
2195================

Callers 1

NextTokenMethod · 0.45

Calls 3

OSPathToRelativePathMethod · 0.45
LengthMethod · 0.45
AddUniqueMethod · 0.45

Tested by

no test coverage detected