File diff r9469:c669ca0efed3 → r9470:75edf93b1c69
src/spritecache.cpp
Show inline comments
 
@@ -166,13 +166,13 @@ static void* ReadSprite(SpriteCache *sc,
 
	/* Type 0xFF indicates either a colormap or some other non-sprite info */
 
	if (type == 0xFF) {
 
		if (real_sprite) {
 
			static byte warning_level = 0;
 
			DEBUG(sprite, warning_level, "Tried to load non sprite #%d as a real sprite. Probable cause: NewGRF interference", id);
 
			warning_level = 6;
 
			if (id == SPR_IMG_QUERY) error("Uhm, would you be so kind not to load a NewGRF that makes the 'query' sprite a non- sprite?");
 
			if (id == SPR_IMG_QUERY) usererror("Uhm, would you be so kind not to load a NewGRF that makes the 'query' sprite a non- sprite?");
 
			return (void*)GetSprite(SPR_IMG_QUERY);
 
		}
 

	
 
		byte *dest = (byte *)AllocSprite(num);
 

	
 
		sc->ptr = dest;
 
@@ -243,13 +243,13 @@ bool LoadNextSprite(int load_index, byte
 
	SpriteCache *sc;
 
	size_t file_pos = FioGetPos();
 

	
 
	if (!ReadSpriteHeaderSkipData()) return false;
 

	
 
	if (load_index >= MAX_SPRITES) {
 
		error("Tried to load too many sprites (#%d; max %d)", load_index, MAX_SPRITES);
 
		usererror("Tried to load too many sprites (#%d; max %d)", load_index, MAX_SPRITES);
 
	}
 

	
 
	sc = AllocateSpriteCache(load_index);
 
	sc->file_slot = file_slot;
 
	sc->file_pos = file_pos;
 
	sc->ptr = NULL;