NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches
render.hpp
Go to the documentation of this file.
1
12#pragma once
13
15#include "NNL/common/io.hpp"
16namespace nnl {
24
29namespace render {
60
72bool IsOfType(BufferView buffer);
73
74bool IsOfType(const std::filesystem::path& path);
75
76bool IsOfType(Reader& f);
77
92
93RenderConfig Import(const std::filesystem::path& path);
94
105[[nodiscard]] Buffer Export(const RenderConfig& render_config);
106
107void Export(const RenderConfig& render_config, const std::filesystem::path& path);
108
109void Export(const RenderConfig& render_config, Writer& f);
111
112namespace raw {
118constexpr u32 kMagicBytes = 1;
119
120NNL_PACK(struct RRenderConfig {
121 u32 magic_bytes = kMagicBytes; // 0x0 not very reliable
122 u32 unknown4 = 0; // 0x4
123 u32 unknown8 = 0; // 0x8
124 u32 unknownC = 0; // 0xC
125 u32 enable_buffer_effects = 1; // 0x10 bloom+distance effect: always active!
126 u32 bloom_translucency = 0; // 0x14
127 f32 mipmap_bias = 0.0f; // 0x18
128 f32 mipmap_slope = 0.0f; // 0x1C
129 f32 draw_distance_near = 0.0f; // 0x20
130 f32 draw_distance_far = 0.0f; // 0x24
131 u32 distance_fog_red = 0; // 0x28
132 u32 distance_fog_green = 0; // 0x2C
133 u32 distance_fog_blue = 0; // 0x30
134 u32 distance_transition_translucency = 0; // 0x34
135 u32 padding0 = 0; // 0x38
136 u32 padding1 = 0; // 0x3C
137});
138
139static_assert(sizeof(RRenderConfig) == 0x40);
140
141RenderConfig Convert(const RRenderConfig& rdistance);
142
143RRenderConfig Parse(Reader& f);
145} // namespace raw
146
147} // namespace render
148
149} // namespace nnl
Contains macros and definitions for fixed-width types.
float f32
32-bit floating point
Definition fixed_type.hpp:59
std::uint32_t u32
32-bit unsigned integer
Definition fixed_type.hpp:60
std::uint8_t u8
8-bit unsigned integer
Definition fixed_type.hpp:64
#define NNL_PACK(...)
A structure packing directive.
Definition fixed_type.hpp:41
Reader implementation for read-only memory buffers.
Definition io.hpp:598
Abstract class for writing data.
Definition io.hpp:136
Abstract class for reading data.
Definition io.hpp:78
std::vector< u8 > Buffer
A type alias for std::vector<u8> that denotes a raw, contiguous memory region that may be interpreted...
Definition io.hpp:40
f32 fog_draw_distance_far
Definition render.hpp:50
u8 bloom_translucency
Definition render.hpp:41
f32 mipmap_bias
Definition render.hpp:43
f32 mipmap_slope
Definition render.hpp:45
f32 fog_near
Definition render.hpp:47
u8 distance_transition_translucency
Definition render.hpp:55
u32 fog_color
Definition render.hpp:53
Represents settings for rendering.
Definition render.hpp:40
bool IsOfType(BufferView buffer)
Tests if the provided file is a render config.
Buffer Export(const RenderConfig &render_config)
Converts a render config to a binary file representation.
RenderConfig Import(BufferView buffer)
Parses a binary file and converts it to a RenderConfig struct.
constexpr u32 kMagicBytes
The magic bytes.
Definition render.hpp:118
Provides classes for reading and writing binary data to and from various sources.
Contains functions for working with render configs used by NSUNI.
Definition render.hpp:29
Definition exception.hpp:56