File diff r15609:02b794721f9c → r15610:623a23fb6560
src/newgrf.cpp
Show inline comments
 
@@ -219,13 +219,14 @@ struct GRFLocation {
 
};
 

	
 
static std::map<GRFLocation, SpriteID> _grm_sprites;
 
typedef std::map<GRFLocation, byte*> GRFLineToSpriteOverride;
 
static GRFLineToSpriteOverride _grf_line_to_action6_sprite_override;
 

	
 
/** DEBUG() function dedicated to newGRF debugging messages
 
/**
 
 * DEBUG() function dedicated to newGRF debugging messages
 
 * Function is essentially the same as DEBUG(grf, severity, ...) with the
 
 * addition of file:line information when parsing grf files.
 
 * NOTE: for the above reason(s) grfmsg() should ONLY be used for
 
 * loading/parsing grf files, not for runtime debug messages as there
 
 * is no file information available during that time.
 
 * @param severity debugging severity level, see debug.h
 
@@ -278,13 +279,14 @@ static void ClearTemporaryNewGRFData(GRF
 
}
 

	
 

	
 
typedef std::map<StringID *, uint32> StringIDToGRFIDMapping;
 
static StringIDToGRFIDMapping _string_to_grf_mapping;
 

	
 
/** Used when setting an object's property to map to the GRF's strings
 
/**
 
 * Used when setting an object's property to map to the GRF's strings
 
 * while taking in consideration the "drift" between TTDPatch string system and OpenTTD's one
 
 * @param grfid Id of the grf file
 
 * @param str StringID that we want to have the equivalent in OoenTTD
 
 * @return the properly adjusted StringID
 
 */
 
StringID MapGRFStringID(uint32 grfid, StringID str)
 
@@ -420,13 +422,14 @@ EngineID GetNewEngineID(const GRFFile *f
 
		if (override != 0) scope_grfid = override;
 
	}
 

	
 
	return _engine_mngr.GetID(type, internal_id, scope_grfid);
 
}
 

	
 
/** Map the colour modifiers of TTDPatch to those that Open is using.
 
/**
 
 * Map the colour modifiers of TTDPatch to those that Open is using.
 
 * @param grf_sprite pointer to the structure been modified
 
 */
 
static void MapSpriteMappingRecolour(PalSpriteID *grf_sprite)
 
{
 
	if (HasBit(grf_sprite->pal, 14)) {
 
		ClrBit(grf_sprite->pal, 14);
 
@@ -6789,13 +6792,14 @@ static void InitNewGRFFile(const GRFConf
 
	}
 

	
 
	*_grf_files.Append() = _cur_grffile = newfile;
 
}
 

	
 

	
 
/** List of what cargo labels are refittable for the given the vehicle-type.
 
/**
 
 * List of what cargo labels are refittable for the given the vehicle-type.
 
 * Only currently active labels are applied. */
 
static const CargoLabel _default_refitmasks_rail[] = {
 
	'PASS', 'COAL', 'MAIL', 'LVST', 'GOOD', 'GRAI', 'WHEA', 'MAIZ', 'WOOD',
 
	'IORE', 'STEL', 'VALU', 'GOLD', 'DIAM', 'PAPR', 'FOOD', 'FRUT', 'CORE',
 
	'WATR', 'SUGR', 'TOYS', 'BATT', 'SWET', 'TOFF', 'COLA', 'CTCD', 'BUBL',
 
	'PLST', 'FZDR',
 
@@ -6922,13 +6926,14 @@ static void FinaliseCargoArray()
 
			cs->quantifier = STR_NEWGRF_INVALID_CARGO_QUANTITY;
 
			cs->abbrev = STR_NEWGRF_INVALID_CARGO_ABBREV;
 
		}
 
	}
 
}
 

	
 
/** Add all new houses to the house array. House properties can be set at any
 
/**
 
 * Add all new houses to the house array. House properties can be set at any
 
 * time in the GRF file, so we can only add a house spec to the house array
 
 * after the file has finished loading. We also need to check the dates, due to
 
 * the TTDPatch behaviour described below that we need to emulate. */
 
static void FinaliseHouseArray()
 
{
 
	/* If there are no houses with start dates before 1930, then all houses
 
@@ -6987,13 +6992,14 @@ static void FinaliseHouseArray()
 

	
 
			if (hs->enabled && hs->min_year == min_year) hs->min_year = 0;
 
		}
 
	}
 
}
 

	
 
/** Add all new industries to the industry array. Industry properties can be set at any
 
/**
 
 * Add all new industries to the industry array. Industry properties can be set at any
 
 * time in the GRF file, so we can only add a industry spec to the industry array
 
 * after the file has finished loading. */
 
static void FinaliseIndustriesArray()
 
{
 
	const GRFFile * const *end = _grf_files.End();
 
	for (GRFFile **file = _grf_files.Begin(); file != end; file++) {