LevelSettingsChunk struct
#include <Jazz2/Formats/LevelFile.h>
Chunk with the settings of a level that its properties have no room for.
The water beyond its level and a few rules of the game, in fields of u8 Field, varuint size and its bytes:
- Field::
WaterColors — 3× u8Settings::WaterColorTop and 3× u8Settings::WaterColorBottom, RGB - Field::
WaterMovement — u8Settings::WaterMovement - Field::
WaterLighting — u8Settings::WaterLighting - Field::
WaterLayer — varuintSettings::WaterLayer plus one, 0 for WaterHidden - Field::
WaterChangeSpeed — f32Settings::WaterChangeSpeed - Field::
Rules — u8bits of Rules
A field of a kind this version doesn't know is skipped, and so are the bytes a newer version adds after a value; a field shorter than its value is ignored. A setting without a field has its default, only those that differ are written.
Public types
- struct Settings
- Settings of a level.
-
enum class Field : std::
uint8_t { WaterColors = 1, WaterMovement, WaterLighting, WaterLayer, WaterChangeSpeed, Rules } - Kind of a field.
-
enum class WaterMovement : std::
uint8_t { Default, Swim, LowGravity } - How players move under water.
-
enum class WaterLighting : std::
uint8_t { None, Global, Depth } - How the ambient lighting goes with the water.
-
enum class Rules : std::
uint8_t { None = 0, NoWarpsTransmuteCoins = 0x01, DelayGeneratedCrateOrigins = 0x02 } - Bits of Field::
Rules.
Public static variables
-
static std::
uint32_t Tag constexpr - Tag of the chunk.
-
static std::
int32_t WaterInFront constexpr - Settings::
WaterLayer of the water drawn in front of all layers -
static std::
int32_t WaterHidden constexpr - Settings::
WaterLayer of the water that isn't drawn, it's still there for the actors
Public static functions
-
static auto Read(ArrayView<const std::
uint8_t> data, Settings& settings) -> bool - Reads the payload, what's missing keeps its default, returns
falseif it's damaged. -
static void Write(const Settings& settings,
SmallVectorImpl<std::
uint8_t>& data) - Writes the payload, nothing if every setting has its default.
Constructors, destructors, conversion operators
- LevelSettingsChunk() deleted
Enum documentation
enum class Jazz2:: Formats:: LevelSettingsChunk:: Field : std:: uint8_t
Kind of a field.
| Enumerators | |
|---|---|
| WaterColors |
Colors of the water |
| WaterMovement |
How players move under water |
| WaterLighting |
How the ambient lighting goes with the water |
| WaterLayer |
Layer the water is drawn in front of |
| WaterChangeSpeed |
Speed the water moves to a new level at |
| Rules |
Rules of the game |
enum class Jazz2:: Formats:: LevelSettingsChunk:: WaterMovement : std:: uint8_t
How players move under water.
| Enumerators | |
|---|---|
| Default |
Swimming or a lower gravity, chosen by how deep the water is |
| Swim |
Swimming |
| LowGravity |
Walking and jumping with a lower gravity, no swimming |
enum class Jazz2:: Formats:: LevelSettingsChunk:: WaterLighting : std:: uint8_t
How the ambient lighting goes with the water.
| Enumerators | |
|---|---|
| None |
Full light while the water is in view, the ambient lighting is ignored, as in the original game |
| Global |
The ambient lighting of the level above and below the water |
| Depth |
Full light above the water, darker the deeper under it the player is |
enum class Jazz2:: Formats:: LevelSettingsChunk:: Rules : std:: uint8_t
Bits of Field::
| Enumerators | |
|---|---|
| None |
|
| NoWarpsTransmuteCoins |
Settings:: |
| DelayGeneratedCrateOrigins |