src/spritecache.cpp
changeset 6908 6b1324d7a2c9
parent 6903 091fb25052ac
child 6937 40c760fcf1f6
equal deleted inserted replaced
6907:f4409419df57 6908:6b1324d7a2c9
   239 
   239 
   240 	return sc->ptr;
   240 	return sc->ptr;
   241 }
   241 }
   242 
   242 
   243 
   243 
   244 bool LoadNextSprite(int load_index, byte file_index)
   244 bool LoadNextSprite(int load_index, byte file_index, uint file_sprite_id)
   245 {
   245 {
   246 	SpriteCache *sc;
   246 	SpriteCache *sc;
   247 	uint32 file_pos = FioGetPos() | (file_index << 24);
   247 	uint32 file_pos = FioGetPos() | (file_index << 24);
   248 
   248 
   249 	if (!ReadSpriteHeaderSkipData()) return false;
   249 	if (!ReadSpriteHeaderSkipData()) return false;
   254 
   254 
   255 	sc = AllocateSpriteCache(load_index);
   255 	sc = AllocateSpriteCache(load_index);
   256 	sc->file_pos = file_pos;
   256 	sc->file_pos = file_pos;
   257 	sc->ptr = NULL;
   257 	sc->ptr = NULL;
   258 	sc->lru = 0;
   258 	sc->lru = 0;
   259 	sc->id = load_index;
   259 	sc->id = file_sprite_id;
   260 
   260 
   261 	const char *fio_grf_name = FioGetFilename();
   261 	const char *fio_grf_name = FioGetFilename();
   262 	const char *t = strrchr(fio_grf_name, PATHSEPCHAR);
   262 	const char *t = strrchr(fio_grf_name, PATHSEPCHAR);
   263 	char *grf_name;
   263 	char *grf_name;
   264 	if (t == NULL) grf_name = strdup(fio_grf_name);
   264 	if (t == NULL) grf_name = strdup(fio_grf_name);