Add shell
This commit is contained in:
		
							parent
							
								
									920168abe0
								
							
						
					
					
						commit
						b7c8011c52
					
				
					 4 changed files with 116 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -197,6 +197,7 @@ void Config::read(int argc, char *argv[])
 | 
			
		|||
	defScreenW = 640;
 | 
			
		||||
	defScreenH = 480;
 | 
			
		||||
	enableBlitting = false;
 | 
			
		||||
	winResizable = false;
 | 
			
		||||
 | 
			
		||||
#undef PO_DESC
 | 
			
		||||
#undef PO_DESC_ALL
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,6 +4,7 @@
 | 
			
		|||
 | 
			
		||||
EM_JS(void, load_file_async_js, (const char* fullPathC), {
 | 
			
		||||
	Asyncify.handleSleep(function(wakeUp) {
 | 
			
		||||
		// Get argument
 | 
			
		||||
		const fullPath = UTF8ToString(fullPathC);
 | 
			
		||||
 | 
			
		||||
		// Make cache object
 | 
			
		||||
| 
						 | 
				
			
			@ -12,6 +13,9 @@ EM_JS(void, load_file_async_js, (const char* fullPathC), {
 | 
			
		|||
		// Check if already loaded
 | 
			
		||||
		if (window.fileAsyncCache.hasOwnProperty(fullPath)) return wakeUp();
 | 
			
		||||
 | 
			
		||||
		// Show spinner
 | 
			
		||||
		if (window.setBusy) window.setBusy();
 | 
			
		||||
 | 
			
		||||
		// Get full destination
 | 
			
		||||
		const file = "game/" + fullPath;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -28,6 +32,7 @@ EM_JS(void, load_file_async_js, (const char* fullPathC), {
 | 
			
		|||
		// Get the new file
 | 
			
		||||
		FS.createPreloadedFile(path, filename, iurl, true, true, function() {
 | 
			
		||||
			window.fileAsyncCache[fullPath] = 1;
 | 
			
		||||
			if (window.setNotBusy) window.setNotBusy();
 | 
			
		||||
			wakeUp();
 | 
			
		||||
		}, console.error);
 | 
			
		||||
	});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue