QcTextureSources Namespace
Where each texture of the atlas comes from (decision E-297): the active packs in priority order, then the content's own definition (the base 16 x 16 textures and those of mods). More...
| Header: | #include <clientcore/texturepacks/QcTextureSources.h> |
Classes
| struct | Resolved |
Functions
| QcTextureAnimation | animationOf(const QcTextureDefinition &definition, const QcTexturePackStack &packs) |
| int | resolutionOf(const QcTexturePackStack &packs, int maxResolution) |
| QcResult<QcTextureSources::Resolved> | resolve(const QcTextureDefinition &definition, const QcTexturePackStack &packs, int resolution) |
| QImage | toResolution(const QImage &image, int resolution) |
Detailed Description
Within one pack a PNG image comes before a procedural spec of the same name, and a pack with "procedural": true finally renders the content's procedural definition at its resolution.
Function Documentation
QcTextureAnimation QcTextureSources::animationOf(const QcTextureDefinition &definition, const QcTexturePackStack &packs)
Returns the animation the texture of definition gets from the same source resolve() takes it from, without drawing it: the frames of a strip of one of packs (timed as the content's definition says, else QcTextureAnimation::defaultFrameTicks), a pack's or the content's procedural definition, the frames of a mod's PNG strip.
int QcTextureSources::resolutionOf(const QcTexturePackStack &packs, int maxResolution)
Returns the highest resolution of packs, at least 16 and at most maxResolution.
QcResult<QcTextureSources::Resolved> QcTextureSources::resolve(const QcTextureDefinition &definition, const QcTexturePackStack &packs, int resolution)
Returns the texture of definition at resolution, from packs or the content; the problem when even the content's own definition cannot be drawn.
QImage QcTextureSources::toResolution(const QImage &image, int resolution)
Returns image scaled to resolution x resolution: pixel-exact when enlarging, averaged when shrinking.