Changeset - r17627:5bbfcefda44f
[Not reviewed]
master
0 2 0
yexo - 13 years ago 2011-05-01 20:46:36
yexo@openttd.org
(svn r22408) -Cleanup: remove unused variable GRFFile::sprite_offset
2 files changed with 2 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/newgrf.cpp
Show inline comments
 
@@ -7331,26 +7331,24 @@ static void BuildCargoTranslationMap()
 
				}
 
			}
 
		}
 
	}
 
}
 

	
 
static void InitNewGRFFile(const GRFConfig *config, int sprite_offset)
 
static void InitNewGRFFile(const GRFConfig *config)
 
{
 
	GRFFile *newfile = GetFileByFilename(config->filename);
 
	if (newfile != NULL) {
 
		/* We already loaded it once. */
 
		newfile->sprite_offset = sprite_offset;
 
		_cur_grffile = newfile;
 
		return;
 
	}
 

	
 
	newfile = CallocT<GRFFile>(1);
 

	
 
	newfile->filename = strdup(config->filename);
 
	newfile->sprite_offset = sprite_offset;
 
	newfile->grfid = config->ident.grfid;
 

	
 
	/* Initialise local settings to defaults */
 
	newfile->traininfo_vehicle_pitch = 0;
 
	newfile->traininfo_vehicle_width = TRAININFO_DEFAULT_VEHICLE_WIDTH;
 

	
 
@@ -8301,13 +8299,13 @@ void LoadNewGRF(uint load_index, uint fi
 
			if (!FioCheckFileExists(c->filename)) {
 
				DEBUG(grf, 0, "NewGRF file is missing '%s'; disabling", c->filename);
 
				c->status = GCS_NOT_FOUND;
 
				continue;
 
			}
 

	
 
			if (stage == GLS_LABELSCAN) InitNewGRFFile(c, _cur_spriteid);
 
			if (stage == GLS_LABELSCAN) InitNewGRFFile(c);
 
			LoadNewGRFFile(c, slot++, stage);
 
			if (stage == GLS_RESERVE) {
 
				SetBit(c->flags, GCF_RESERVED);
 
			} else if (stage == GLS_ACTIVATION) {
 
				ClrBit(c->flags, GCF_RESERVED);
 
				assert(GetFileByGRFID(c->ident.grfid) == _cur_grffile);
src/newgrf.h
Show inline comments
 
@@ -74,13 +74,12 @@ struct GRFLabel {
 

	
 
/** Dynamic data of a loaded NewGRF */
 
struct GRFFile {
 
	char *filename;
 
	bool is_ottdfile;
 
	uint32 grfid;
 
	uint16 sprite_offset;
 
	byte grf_version;
 

	
 
	/* A sprite group contains all sprites of a given vehicle (or multiple
 
	 * vehicles) when carrying given cargo. It consists of several sprite
 
	 * sets.  Group ids are refered as "cargo id"s by TTDPatch
 
	 * documentation, contributing to the global confusion.
0 comments (0 inline, 0 general)