OpenTTD Source: src/spriteloader/makeindexed.cpp File Reference

OpenTTD Source 15.3

Functions
makeindexed.cpp File Reference

Implementation for converting sprites from another source from 32bpp RGBA to indexed 8bpp. More...

`#include "../stdafx.h"`
`#include "../core/math_func.hpp"`
`#include "../gfx_func.h"`
`#include "../palette_func.h"`
`#include "makeindexed.h"`
`#include "../safeguards.h"`

Go to the source code of this file.

## Functions
static void | Convert32bppTo8bpp (SpriteLoader::Sprite &sprite)
| Convert in place a 32bpp sprite to 8bpp.

## Detailed Description

Implementation for converting sprites from another source from 32bpp RGBA to indexed 8bpp.

Definition in file makeindexed.cpp.

## Function Documentation

## ◆ Convert32bppTo8bpp()

static void Convert32bppTo8bpp | ( | SpriteLoader::Sprite & | sprite | ) |
| static

Convert in place a 32bpp sprite to 8bpp.

Parameters

  sprite | Sprite to convert.

Definition at line 22 of file makeindexed.cpp.

References _cur_palette, SpriteLoader::Sprite::data, GetNearestColourIndex(), GetNearestColourReshadeIndex(), SpriteLoader::Sprite::height, IsInsideMM(), Palette::palette, and SpriteLoader::Sprite::width.

Referenced by SpriteLoaderMakeIndexed::LoadSprite().