Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
TilesetEngine Class Reference

Static helpers that build Game Boy tileset graphics (tiles, flowers, waves). More...

#include <tilesetengine.h>

Inheritance diagram for TilesetEngine:
Collaboration diagram for TilesetEngine:

Static Public Member Functions

static QImage getTileset (QString name)
 Load a tileset image by name (case-insensitive; spaces -> underscores).
static QImage getFlower (int frame)
 The animated flower overlay for frame (see note).
static QImage getFont ()
 The font overlay image.
static QPixmap buildTilesetFullDebug (QString id)
static QVector< QPixmap > buildTileset (QString id)
 Build the per-tile pixmaps for id (format above).
static QVector< QPixmap > getTiles (QImage tilemap)
 Slice a tilemap image into per-tile pixmaps.
static QImage blankImage ()
 A blank transparent tile-sized image.
static QImage postProcessWaveOnce (QImage tile)
 One increment of the water-wave shift.
static QImage postProcessWave (QImage tile, int frame)
 Apply the wave effect for frame (see note).

Static Public Attributes

static constexpr int width = 128
 Tileset image width (px).
static constexpr int height = 128
 Tileset image height (px).
static constexpr int tileWidth = 8
 Tile width (px).
static constexpr int tileHeight = 8
 Tile height (px).
static constexpr int tileWater = 0x14
 Tile id of the animated water tile.
static constexpr int fullFrameCount = 8
 Frames for a full animation cycle.

Detailed Description

Static helpers that build Game Boy tileset graphics (tiles, flowers, waves).

The rendering workhorse behind TilesetProvider and the font previews: it loads a named tileset image, slices it into per-tile pixmaps, overlays animated flowers and the font, and applies the animated water "wave" post-process. All static; the constexpr values are the GB tile geometry. The id-string format for buildTileset() is documented inline.

See also
TilesetProvider (the QML image provider that uses this), AreaTileset.

Definition at line 35 of file tilesetengine.h.

Member Function Documentation

◆ blankImage()

QImage TilesetEngine::blankImage ( )
static

A blank transparent tile-sized image.

Definition at line 151 of file tilesetengine.cpp.

References height, and width.

Referenced by buildTilesetFullDebug().

◆ buildTileset()

QVector< QPixmap > TilesetEngine::buildTileset ( QString id)
static

Build the per-tile pixmaps for id (format above).

Definition at line 119 of file tilesetengine.cpp.

References buildTilesetFullDebug(), and getTiles().

Referenced by FontPreviewInstance::getTiles(), and TilesetProvider::requestPixmap().

◆ buildTilesetFullDebug()

QPixmap TilesetEngine::buildTilesetFullDebug ( QString id)
static

◆ getFlower()

QImage TilesetEngine::getFlower ( int frame)
static

The animated flower overlay for frame (see note).

Definition at line 37 of file tilesetengine.cpp.

Referenced by buildTilesetFullDebug().

◆ getFont()

QImage TilesetEngine::getFont ( )
static

The font overlay image.

Definition at line 59 of file tilesetengine.cpp.

Referenced by buildTilesetFullDebug().

◆ getTiles()

QVector< QPixmap > TilesetEngine::getTiles ( QImage tilemap)
static

Slice a tilemap image into per-tile pixmaps.

Definition at line 131 of file tilesetengine.cpp.

References height, and width.

Referenced by buildTileset().

◆ getTileset()

QImage TilesetEngine::getTileset ( QString name)
static

Load a tileset image by name (case-insensitive; spaces -> underscores).

Definition at line 29 of file tilesetengine.cpp.

Referenced by buildTilesetFullDebug().

◆ postProcessWave()

QImage TilesetEngine::postProcessWave ( QImage tile,
int frame )
static

Apply the wave effect for frame (see note).

Definition at line 200 of file tilesetengine.cpp.

References postProcessWaveOnce().

Referenced by buildTilesetFullDebug().

◆ postProcessWaveOnce()

QImage TilesetEngine::postProcessWaveOnce ( QImage tile)
static

One increment of the water-wave shift.

Definition at line 158 of file tilesetengine.cpp.

References tileHeight, and tileWidth.

Referenced by postProcessWave().

Member Data Documentation

◆ fullFrameCount

int TilesetEngine::fullFrameCount = 8
staticconstexpr

Frames for a full animation cycle.

Definition at line 87 of file tilesetengine.h.

◆ height

int TilesetEngine::height = 128
staticconstexpr

Tileset image height (px).

Definition at line 80 of file tilesetengine.h.

Referenced by blankImage(), TilesetProvider::blankImage(), and getTiles().

◆ tileHeight

int TilesetEngine::tileHeight = 8
staticconstexpr

Tile height (px).

Definition at line 82 of file tilesetengine.h.

Referenced by buildTilesetFullDebug(), and postProcessWaveOnce().

◆ tileWater

int TilesetEngine::tileWater = 0x14
staticconstexpr

Tile id of the animated water tile.

Definition at line 83 of file tilesetengine.h.

◆ tileWidth

int TilesetEngine::tileWidth = 8
staticconstexpr

Tile width (px).

Definition at line 81 of file tilesetengine.h.

Referenced by buildTilesetFullDebug(), and postProcessWaveOnce().

◆ width

int TilesetEngine::width = 128
staticconstexpr

Tileset image width (px).

Definition at line 79 of file tilesetengine.h.

Referenced by blankImage(), TilesetProvider::blankImage(), and getTiles().


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