@@ -8,26 +8,16 @@ const logger = new Logger("Loader");
88export const loadGameFiles = async (
99 manifest : IExtendedManifest ,
1010) : Promise < [ IGameOptions [ "files" ] , any ] > => {
11- const files = {
12- assets : new Map < string , string > ( ) ,
13- wasm : new Map < string , string > ( ) ,
14- wgsl : new Map < string , string > ( ) ,
15- } ;
11+ const files = new Map < string , string > ( ) ;
1612 let mainModule = undefined ;
1713 logger . info ( "Starting load game files from cache" ) ;
1814 for ( const file of manifest . files ) {
19- if ( file . path . endsWith ( " .js") ) {
15+ if ( file . path === "index .js") {
2016 const resModule = await loadScript ( file ) ;
2117 if ( resModule ) mainModule = resModule ;
2218 continue ;
2319 }
24- if ( file . path . endsWith ( ".wasm" ) ) {
25- files . wasm . set ( file . path , file . localPath ) ;
26- } else if ( file . path . endsWith ( ".wgsl" ) ) {
27- files . wgsl . set ( file . path , file . localPath ) ;
28- } else {
29- files . assets . set ( file . path , file . localPath ) ;
30- }
20+ files . set ( file . path , file . localPath ) ;
3121 }
3222 if ( ! mainModule ) throw new Error ( "Could not find main function" ) ;
3323 logger . info ( "Game files loaded" ) ;
0 commit comments