Changeset - r27659:efb2f4024b6e
[Not reviewed]
master
0 2 0
Johannes E. Krause - 12 months ago 2023-06-27 10:46:14
j.k@eclipso.de
Add: show fallback sprites with debuglevel sprite=4
2 files changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/gfxinit.cpp
Show inline comments
 
@@ -213,6 +213,7 @@ static void LoadSpriteTables()
 
	LoadNewGRF(SPR_NEWGRFS_BASE, 2);
 

	
 
	uint total_extra_graphics = SPR_NEWGRFS_BASE - SPR_OPENTTD_BASE;
 
	Debug(sprite, 4, "Checking sprites from fallback grf");
 
	_missing_extra_graphics = GetSpriteCountForFile(master_filename, SPR_OPENTTD_BASE, SPR_NEWGRFS_BASE);
 
	Debug(sprite, 1, "{} extra sprites, {} from baseset, {} from fallback", total_extra_graphics, total_extra_graphics - _missing_extra_graphics, _missing_extra_graphics);
 

	
src/spritecache.cpp
Show inline comments
 
@@ -205,7 +205,10 @@ uint GetSpriteCountForFile(const std::st
 
	for (SpriteID i = begin; i != end; i++) {
 
		if (SpriteExists(i)) {
 
			SpriteCache *sc = GetSpriteCache(i);
 
			if (sc->file == file) count++;
 
			if (sc->file == file) {
 
				count++;
 
				Debug(sprite, 4, "Sprite: {}", i);
 
			}
 
		}
 
	}
 
	return count;
 
@@ -731,7 +734,7 @@ void IncreaseSpriteLRU()
 
	if (_sprite_lru_counter > 16384) {
 
		SpriteID i;
 

	
 
		Debug(sprite, 3, "Fixing lru {}, inuse={}", _sprite_lru_counter, GetSpriteCacheUsage());
 
		Debug(sprite, 5, "Fixing lru {}, inuse={}", _sprite_lru_counter, GetSpriteCacheUsage());
 

	
 
		for (i = 0; i != _spritecache_items; i++) {
 
			SpriteCache *sc = GetSpriteCache(i);
0 comments (0 inline, 0 general)