================ idFileSystemLocal::Startup ================ */
| 2218 | ================ |
| 2219 | */ |
| 2220 | void idFileSystemLocal::Startup( void ) { |
| 2221 | searchpath_t **search; |
| 2222 | int i; |
| 2223 | pack_t *pak; |
| 2224 | int addon_index; |
| 2225 | |
| 2226 | common->Printf( "----- Initializing File System -----\n" ); |
| 2227 | |
| 2228 | if ( restartChecksums.Num() ) { |
| 2229 | common->Printf( "restarting in pure mode with %d pak files\n", restartChecksums.Num() ); |
| 2230 | } |
| 2231 | if ( addonChecksums.Num() ) { |
| 2232 | common->Printf( "restarting filesystem with %d addon pak file(s) to include\n", addonChecksums.Num() ); |
| 2233 | } |
| 2234 | |
| 2235 | SetupGameDirectories( BASE_GAMEDIR ); |
| 2236 | |
| 2237 | // fs_game_base override |
| 2238 | if ( fs_game_base.GetString()[0] && |
| 2239 | idStr::Icmp( fs_game_base.GetString(), BASE_GAMEDIR ) ) { |
| 2240 | SetupGameDirectories( fs_game_base.GetString() ); |
| 2241 | } |
| 2242 | |
| 2243 | // fs_game override |
| 2244 | if ( fs_game.GetString()[0] && |
| 2245 | idStr::Icmp( fs_game.GetString(), BASE_GAMEDIR ) && |
| 2246 | idStr::Icmp( fs_game.GetString(), fs_game_base.GetString() ) ) { |
| 2247 | SetupGameDirectories( fs_game.GetString() ); |
| 2248 | } |
| 2249 | |
| 2250 | // currently all addons are in the search list - deal with filtering out and dependencies now |
| 2251 | // scan through and deal with dependencies |
| 2252 | search = &searchPaths; |
| 2253 | while ( *search ) { |
| 2254 | if ( !( *search )->pack || !( *search )->pack->addon ) { |
| 2255 | search = &( ( *search )->next ); |
| 2256 | continue; |
| 2257 | } |
| 2258 | pak = ( *search )->pack; |
| 2259 | if ( fs_searchAddons.GetBool() ) { |
| 2260 | // when we have fs_searchAddons on we should never have addonChecksums |
| 2261 | assert( !addonChecksums.Num() ); |
| 2262 | pak->addon_search = true; |
| 2263 | search = &( ( *search )->next ); |
| 2264 | continue; |
| 2265 | } |
| 2266 | addon_index = addonChecksums.FindIndex( pak->checksum ); |
| 2267 | if ( addon_index >= 0 ) { |
| 2268 | assert( !pak->addon_search ); // any pak getting flagged as addon_search should also have been removed from addonChecksums already |
| 2269 | pak->addon_search = true; |
| 2270 | addonChecksums.RemoveIndex( addon_index ); |
| 2271 | FollowAddonDependencies( pak ); |
| 2272 | } |
| 2273 | search = &( ( *search )->next ); |
| 2274 | } |
| 2275 | |
| 2276 | // now scan to filter out addons not marked addon_search |
| 2277 | search = &searchPaths; |
nothing calls this directly
no test coverage detected