Changeset - r18006:071d51c996ad
[Not reviewed]
master
0 6 0
rubidium - 13 years ago 2011-08-24 13:42:06
rubidium@openttd.org
(svn r22825) -Codechange: pass subdir to FioOpenFile
6 files changed with 10 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/fileio.cpp
Show inline comments
 
@@ -237,15 +237,16 @@ static void FioFreeHandle()
 
 * Open a slotted file.
 
 * @param slot Index to assign.
 
 * @param filename Name of the file at the disk.
 
 */
 
void FioOpenFile(int slot, const char *filename)
 
 * @param subdir The sub directory to search this file in.
 
  */
 
void FioOpenFile(int slot, const char *filename, Subdirectory subdir)
 
{
 
	FILE *f;
 

	
 
#if defined(LIMITED_FDS)
 
	FioFreeHandle();
 
#endif /* LIMITED_FDS */
 
	f = FioFOpenFile(filename);
 
	f = FioFOpenFile(filename, "rb", subdir);
 
	if (f == NULL) usererror("Cannot open file '%s'", filename);
 
	uint32 pos = ftell(f);
 

	
src/fileio_func.h
Show inline comments
 
@@ -22,7 +22,7 @@ byte FioReadByte();
 
uint16 FioReadWord();
 
uint32 FioReadDword();
 
void FioCloseAll();
 
void FioOpenFile(int slot, const char *filename);
 
void FioOpenFile(int slot, const char *filename, Subdirectory subdir);
 
void FioReadBlock(void *ptr, size_t size);
 
void FioSkipBytes(int n);
 

	
src/gfxinit.cpp
Show inline comments
 
@@ -38,7 +38,7 @@ static uint LoadGrfFile(const char *file
 
	uint load_index_org = load_index;
 
	uint sprite_id = 0;
 

	
 
	FioOpenFile(file_index, filename);
 
	FioOpenFile(file_index, filename, NEWGRF_DIR);
 

	
 
	DEBUG(sprite, 2, "Reading grf-file '%s'", filename);
 

	
 
@@ -73,7 +73,7 @@ static void LoadGrfIndexed(const char *f
 
{
 
	uint sprite_id = 0;
 

	
 
	FioOpenFile(file_index, filename);
 
	FioOpenFile(file_index, filename, NEWGRF_DIR);
 

	
 
	DEBUG(sprite, 2, "Reading indexed grf-file '%s'", filename);
 

	
src/newgrf.cpp
Show inline comments
 
@@ -8105,7 +8105,7 @@ void LoadNewGRFFile(GRFConfig *config, u
 
		return;
 
	}
 

	
 
	FioOpenFile(file_index, filename);
 
	FioOpenFile(file_index, filename, NEWGRF_DIR);
 
	_cur.file_index = file_index; // XXX
 
	_palette_remap_grf[_cur.file_index] = (config->palette & GRFP_USE_MASK);
 

	
src/sound.cpp
Show inline comments
 
@@ -30,7 +30,7 @@ static void OpenBankFile(const char *fil
 
	/* If there is no sound file (nosound set), don't load anything */
 
	if (filename == NULL) return;
 

	
 
	FioOpenFile(SOUND_SLOT, filename);
 
	FioOpenFile(SOUND_SLOT, filename, BASESET_DIR);
 
	size_t pos = FioGetPos();
 
	uint count = FioReadDword();
 

	
src/spriteloader/png.cpp
Show inline comments
 
@@ -43,7 +43,7 @@ static bool OpenPNGFile(const char *file
 
	const char *sep = (filename[0] == PATHSEPCHAR) ? "" : PATHSEP;
 
	snprintf(png_file, sizeof(png_file), "sprites%s%s" PATHSEP "%d%s.png", sep, filename, id, mask ? "m" : "");
 
	if (FioCheckFileExists(png_file)) {
 
		FioOpenFile(PNG_SLOT, png_file);
 
		FioOpenFile(PNG_SLOT, png_file, NEWGRF_DIR);
 
		return true;
 
	}
 

	
0 comments (0 inline, 0 general)