# SpriteLoaderGrf Class Reference

Sprite loader for graphics coming from a (New)GRF. More...

`#include <grf.hpp>`

Inheritance diagram for SpriteLoaderGrf:

## Public Member Functions
bool | LoadSprite (SpriteLoader::Sprite *sprite, uint8 file_slot, size_t file_pos, SpriteType sprite_type, ZoomLevel zoom)
| Load a sprite from the disk and return a sprite struct which is the same for all loaders.

## Detailed Description

Sprite loader for graphics coming from a (New)GRF.

Definition at line 18 of file grf.hpp.

## Member Function Documentation

bool SpriteLoaderGrf::LoadSprite | ( | SpriteLoader::Sprite * | sprite,
|  | uint8 | file_slot,
|  | size_t | file_pos,
|  | SpriteType | sprite_type,
|  | ZoomLevel | zoom |
| ) |  |  | `[virtual]`

Load a sprite from the disk and return a sprite struct which is the same for all loaders.

Parameters:

  | sprite | The sprite to fill with data.
  | file_slot | The file "descriptor" of the file we read from.
  | file_pos | The position within the file the image begins.
  | sprite_type | The type of sprite we're trying to load.

Returns:
  true iff loading went okay.

Implements SpriteLoader.

Definition at line 42 of file grf.cpp.

References _palette_remap, _palette_remap_grf, SpriteLoader::CommonPixel::a, AllocaM, SpriteLoader::Sprite::AllocateData(), SpriteLoader::Sprite::data, DEBUG, SpriteLoader::Sprite::height, SpriteLoader::CommonPixel::m, min(), ST_FONT, ST_NORMAL, WarnCorruptSprite(), SpriteLoader::Sprite::width, SpriteLoader::Sprite::x_offs, and SpriteLoader::Sprite::y_offs.

Referenced by ReadSprite().

The documentation for this class was generated from the following files:

- src/spriteloader/grf.hpp
- src/spriteloader/grf.cpp