Jazz2::Resources::GraphicResource struct

Specific graphic resource (from metadata).

One animation entry parsed from an object's metadata. It points at a shared GenericGraphicResource and describes the sub-range of its frames to play — frame offset, frame count, animation duration and loop mode — the AnimState it represents, and the palette offset used when the sprite is indexed. Stored in a Metadata and looked up by animation state at runtime.

Constructors, destructors, conversion operators

GraphicResource() noexcept
Creates a new instance.

Public functions

auto operator<(const GraphicResource& p) const -> bool noexcept
Compares two resources by animation state.

Public variables

GenericGraphicResource* Base
Underlying generic resource.
AnimState State
Animation state.
float AnimDuration
Animation duration (in normalized frames).
std::int32_t FrameCount
Frame count.
std::int32_t FrameOffset
Frame offset.
AnimationLoopMode LoopMode
Animation loop mode.
std::uint16_t PaletteOffset
Flat palette offset for an indexed sprite (from the metadata PaletteOffset).

Variable documentation

std::uint16_t Jazz2::Resources::GraphicResource::PaletteOffset

Flat palette offset for an indexed sprite (from the metadata PaletteOffset).

Selects which palette region the PrecompiledShader::PaletteRemap shader samples at draw time (e.g. the gem gradient rows).