(svn r11940) -Codechange: Store short filename once per open file instead of once per sprite cache entry. Not all file types need this, but most of the time no sprite cache entry needed it either.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include "../core/alloc_func.hpp"
|
||||
#include "grf.hpp"
|
||||
|
||||
bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos)
|
||||
bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot, uint32 file_pos)
|
||||
{
|
||||
/* Open the right file and go to the correct position */
|
||||
FioSeekToFile(file_slot, file_pos);
|
||||
|
@@ -12,7 +12,7 @@ public:
|
||||
/**
|
||||
* Load a sprite from the disk and return a sprite struct which is the same for all loaders.
|
||||
*/
|
||||
bool LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos);
|
||||
bool LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot, uint32 file_pos);
|
||||
};
|
||||
|
||||
#endif /* SPRITELOADER_GRF_HPP */
|
||||
|
@@ -181,8 +181,9 @@ static bool LoadPNG(SpriteLoader::Sprite *sprite, const char *filename, uint32 i
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SpriteLoaderPNG::LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos)
|
||||
bool SpriteLoaderPNG::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot, uint32 file_pos)
|
||||
{
|
||||
const char *filename = FioGetFilename(file_slot);
|
||||
if (!LoadPNG(sprite, filename, file_pos, false)) return false;
|
||||
if (!LoadPNG(sprite, filename, file_pos, true)) return false;
|
||||
return true;
|
||||
|
@@ -12,7 +12,7 @@ public:
|
||||
/**
|
||||
* Load a sprite from the disk and return a sprite struct which is the same for all loaders.
|
||||
*/
|
||||
bool LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos);
|
||||
bool LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot, uint32 file_pos);
|
||||
};
|
||||
|
||||
#endif /* SPRITELOADER_PNG_HPP */
|
||||
|
@@ -26,7 +26,7 @@ public:
|
||||
/**
|
||||
* Load a sprite from the disk and return a sprite struct which is the same for all loaders.
|
||||
*/
|
||||
virtual bool LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos) = 0;
|
||||
virtual bool LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot, uint32 file_pos) = 0;
|
||||
|
||||
virtual ~SpriteLoader() { }
|
||||
};
|
||||
|
Reference in New Issue
Block a user