mirror of https://gitlab.com/nakst/essence
				
				
				
			
		
			
				
	
	
		
			64 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C
		
	
	
	
			
		
		
	
	
			64 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C
		
	
	
	
| //
 | |
| // Copyright(C) 1993-1996 Id Software, Inc.
 | |
| // Copyright(C) 2005-2014 Simon Howard
 | |
| //
 | |
| // This program is free software; you can redistribute it and/or
 | |
| // modify it under the terms of the GNU General Public License
 | |
| // as published by the Free Software Foundation; either version 2
 | |
| // of the License, or (at your option) any later version.
 | |
| //
 | |
| // This program is distributed in the hope that it will be useful,
 | |
| // but WITHOUT ANY WARRANTY; without even the implied warranty of
 | |
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | |
| // GNU General Public License for more details.
 | |
| //
 | |
| // DESCRIPTION:
 | |
| //     Common code to parse command line, identifying WAD files to load.
 | |
| //
 | |
| 
 | |
| #include "config.h"
 | |
| 
 | |
| #include "d_iwad.h"
 | |
| #include "m_argv.h"
 | |
| #include "w_main.h"
 | |
| #include "w_wad.h"
 | |
| #include "z_zone.h"
 | |
| 
 | |
| // Parse the command line, merging WAD files that are sppecified.
 | |
| // Returns true if at least one file was added.
 | |
| 
 | |
| boolean W_ParseCommandLine(void)
 | |
| {
 | |
|     boolean modifiedgame = false;
 | |
|     int p;
 | |
| 
 | |
|     //!
 | |
|     // @arg <files>
 | |
|     // @vanilla
 | |
|     //
 | |
|     // Load the specified PWAD files.
 | |
|     //
 | |
| 
 | |
|     p = M_CheckParmWithArgs ("-file", 1);
 | |
|     if (p)
 | |
|     {
 | |
| 	// the parms after p are wadfile/lump names,
 | |
| 	// until end of parms or another - preceded parm
 | |
| 	modifiedgame = true;            // homebrew levels
 | |
| 	while (++p != myargc && myargv[p][0] != '-')
 | |
|         {
 | |
|             char *filename;
 | |
| 
 | |
|             filename = D_TryFindWADByName(myargv[p]);
 | |
| 
 | |
|             ES_debugf("Adding %s\n", filename);
 | |
| 	    W_AddFile(filename);
 | |
|         }
 | |
|     }
 | |
| 
 | |
| //    W_PrintDirectory();
 | |
| 
 | |
|     return modifiedgame;
 | |
| }
 | |
| 
 |