Jazz2::Formats::TexturedLayerParams struct

Parameters of a textured layer that the color of its record has no room for.

Taken by a tunnel (Tiles::LayerRendererType::Tunnel), a wave (Tiles::LayerRendererType::Wave), a cylinder (Tiles::LayerRendererType::Cylinder) and a reflection (Tiles::LayerRendererType::Reflection), as the same fields of a layer of JJ2+ (jjLAYER.tunnel, jjLAYER.wave, jjLAYER.cylinder and jjLAYER.reflection), which share them there too. They aren't a part of LayerRecord in the file, they're stored in LayerPropertiesChunk — a layer without them has the defaults.

Public static variables

static std::uint8_t Spiral constexpr
The circles of a tunnel spiral inwards into the distance.
static std::uint8_t HalfSize constexpr
A cylinder is drawn at half size, four times across the view instead of once and more curved (jjLAYER.cylinder.halfSize of JJ2+).
static std::uint8_t DistortionAngle constexpr
The vertical waves of a wave move the other way, so both move up and right, or down and left (jjLAYER.wave.distortionAngle of JJ2+).
static std::uint8_t InnerWindow constexpr
A reflection or a textured background (but a wave) is drawn only where the layer is, as a window into one of the whole view (SURFACE::INNERWINDOW of JJ2+).
static std::uint8_t InnerLayer constexpr
A reflection or a textured background (but a wave) is drawn only where the layer is, the horizon and the vanishing point a fraction of the layer (SURFACE::INNERLAYER of JJ2+).
static std::uint8_t Fullscreen constexpr
A sky, a tunnel or a cylinder is drawn as SURFACE::FULLSCREEN of JJ2+.
static std::uint8_t FloorOnly constexpr
Only the ground of a sky is drawn, below its horizon, and only in the tiles of layer 8.
static std::uint8_t DefaultFade constexpr
Default of Fade, a tunnel fades out into its center and a cylinder into its horizon, a reflection is tinted with the middle of the gradient of the textures of the original game.

Public functions

auto IsDefault() const -> bool
Returns true if all the parameters are the defaults.
auto HasDefaultInnerSpeeds() const -> bool
Returns true if all the inner speeds are zero.

Public variables

float FadeX
Horizontal position of the vanishing point of a sky, of the center of a tunnel or of the horizon of a cylinder, of the pivot of a tile menu, or of the vanishing point of a reflection, as a fraction of the view (or of the layer, see InnerLayer).
float FadeY
Vertical position of the horizon of a sky, of the center of a tunnel or of the horizon of a cylinder, of the pivot of a tile menu, or of the horizon of a reflection, as a fraction of the view (or of the layer, see InnerLayer).
std::uint8_t Fade
Non-zero if a sky fades out into its horizon (since 4.0.0), a tunnel into its center or a cylinder into its horizon, the palette entry a reflection is tinted with.
std::uint8_t Flags
Combination of Spiral, HalfSize, DistortionAngle, InnerWindow, InnerLayer and Fullscreen.
float InnerSpeedX
Horizontal speed of the texture of a reflection drawn only where the layer is, against the view (jjLAYER.xInnerSpeed of JJ2+).
float InnerSpeedY
Vertical speed of the texture of a reflection drawn only where the layer is, against the view (jjLAYER.yInnerSpeed of JJ2+).
float InnerAutoSpeedX
Horizontal speed the texture of a reflection drawn only where the layer is moves at by itself (jjLAYER.xInnerAutoSpeed of JJ2+, but in pixels each frame, see LayerRecord::AutoSpeedX).
float InnerAutoSpeedY
Vertical speed the texture of a reflection drawn only where the layer is moves at by itself (jjLAYER.yInnerAutoSpeed of JJ2+).
std::uint8_t Mapping
One more than the index of the additional palette of the level the texture is drawn through, 0 for the palette of the level.

Variable documentation

static std::uint8_t Jazz2::Formats::TexturedLayerParams::DistortionAngle constexpr

The vertical waves of a wave move the other way, so both move up and right, or down and left (jjLAYER.wave.distortionAngle of JJ2+).

Without it, a positive speed moves the horizontal waves up and the vertical ones left.

static std::uint8_t Jazz2::Formats::TexturedLayerParams::InnerWindow constexpr

A reflection or a textured background (but a wave) is drawn only where the layer is, as a window into one of the whole view (SURFACE::INNERWINDOW of JJ2+).

The layer is placed as an ordinary one, the horizon and the vanishing point are still a fraction of the view. Since 4.0.0 also a textured background, 3.9.0 draws one over the whole view.

static std::uint8_t Jazz2::Formats::TexturedLayerParams::InnerLayer constexpr

A reflection or a textured background (but a wave) is drawn only where the layer is, the horizon and the vanishing point a fraction of the layer (SURFACE::INNERLAYER of JJ2+).

A dimension in which the layer repeats is that of the view. Takes precedence over InnerWindow. Since 4.0.0 also a textured background, 3.9.0 draws one over the whole view.

static std::uint8_t Jazz2::Formats::TexturedLayerParams::Fullscreen constexpr

A sky, a tunnel or a cylinder is drawn as SURFACE::FULLSCREEN of JJ2+.

In the perspective of JJ2+, its texture placed by the speeds and the offsets of the layer as an ordinary layer would be (see Tiles::LayerSpeedModel::AlwaysOnTop for the sky layer of the original game). JJ2+ draws SURFACE::LEGACY of the sky layer so too. Without it, as the sky layers have always been drawn here, the speeds of the layer aside. The inner surfaces (InnerWindow, InnerLayer) and a cylinder are always drawn in the perspective of JJ2+. Since 4.0.0.

static std::uint8_t Jazz2::Formats::TexturedLayerParams::FloorOnly constexpr

Only the ground of a sky is drawn, below its horizon, and only in the tiles of layer 8.

As JJ2+ draws a textured layer other than the sky layer of a level without extended layer data (SURFACE::LEGACY), measured: it shows only where layer 8 (see LayerRecord::OriginalNumber) has tiles, layer 8 fixed to the view and repeating as it does. Readers before 4.0.0 draw the sky too.

float Jazz2::Formats::TexturedLayerParams::FadeX

Horizontal position of the vanishing point of a sky, of the center of a tunnel or of the horizon of a cylinder, of the pivot of a tile menu, or of the vanishing point of a reflection, as a fraction of the view (or of the layer, see InnerLayer).

For a wave, how far its horizontal waves move the texture, in units of 128 pixels (jjLAYER.wave.amplitudeX of JJ2+). A sky and a tile menu take it since 4.0.0.

float Jazz2::Formats::TexturedLayerParams::FadeY

Vertical position of the horizon of a sky, of the center of a tunnel or of the horizon of a cylinder, of the pivot of a tile menu, or of the horizon of a reflection, as a fraction of the view (or of the layer, see InnerLayer).

For a wave, how far its vertical waves move the texture, in units of 128 pixels (jjLAYER.wave.amplitudeY of JJ2+). A sky and a tile menu take it since 4.0.0.

float Jazz2::Formats::TexturedLayerParams::InnerSpeedX

Horizontal speed of the texture of a reflection drawn only where the layer is, against the view (jjLAYER.xInnerSpeed of JJ2+).

The speeds of the layer place it as an ordinary one then (see InnerWindow and InnerLayer), the inner speeds move its texture inside it, as the speeds of a reflection over the whole view move its texture.

std::uint8_t Jazz2::Formats::TexturedLayerParams::Mapping

One more than the index of the additional palette of the level the texture is drawn through, 0 for the palette of the level.

As SPRITE::MAPPING of a textured layer of JJ2+, so the texture keeps its colors whatever happens to the palette of the level. Without such a palette, the palette of the level.