(svn r11095) -Codechange: don't abuse 'file_pos' by storing the file_slot in it too, but use a nice seperate variable for it
-Note: on a side-note, this allows files bigger than 16+ MiB, needed for tar-support
This commit is contained in:
@@ -8,10 +8,10 @@
|
||||
#include "../debug.h"
|
||||
#include "grf.hpp"
|
||||
|
||||
bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint32 file_pos)
|
||||
bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos)
|
||||
{
|
||||
/* Open the right file and go to the correct position */
|
||||
FioSeekToFile(file_pos);
|
||||
FioSeekToFile(file_slot, file_pos);
|
||||
|
||||
/* Read the size and type */
|
||||
int num = FioReadWord();
|
||||
|
@@ -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, uint32 file_pos);
|
||||
bool LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos);
|
||||
};
|
||||
|
||||
#endif /* SPRITELOADER_GRF_HPP */
|
||||
|
@@ -180,7 +180,7 @@ static bool LoadPNG(SpriteLoader::Sprite *sprite, const char *filename, uint32 i
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SpriteLoaderPNG::LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint32 file_pos)
|
||||
bool SpriteLoaderPNG::LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos)
|
||||
{
|
||||
if (!LoadPNG(sprite, filename, file_pos, false)) return false;
|
||||
if (!LoadPNG(sprite, filename, file_pos, true)) return false;
|
||||
|
@@ -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, uint32 file_pos);
|
||||
bool LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, 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, uint32 file_pos) = 0;
|
||||
virtual bool LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos) = 0;
|
||||
|
||||
virtual ~SpriteLoader() { }
|
||||
};
|
||||
|
Reference in New Issue
Block a user