NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches
minimap.hpp
Go to the documentation of this file.
1
12#pragma once
13
15#include "NNL/common/io.hpp"
17namespace nnl {
28namespace minimap {
38
40 f32 anchor_x = 0.0f;
42 f32 anchor_z = 0.0f;
45 std::vector<glm::vec3> markers;
47};
48
60bool IsOfType(BufferView buffer);
61
62bool IsOfType(const std::filesystem::path& path);
63
64bool IsOfType(Reader& f);
65
80
81MinimapConfig Import(const std::filesystem::path& path);
82
84
94[[nodiscard]] Buffer Export(const MinimapConfig& minimap);
95
96void Export(const MinimapConfig& minimap, const std::filesystem::path& path);
97
98void Export(const MinimapConfig& minimap, Writer& f);
118std::vector<SPosition> Convert(const MinimapConfig& minimap, unsigned int texture_width);
140MinimapConfig Convert(const std::vector<SPosition>& minimap_pos, unsigned int texture_width);
142namespace raw {
148
149struct RMinimapConfig {
150 u32 num_markers = 0;
151 u32 reserved_0 = 0;
152 u32 reserved_1 = 0;
153 u32 reserved_2 = 0;
154 std::vector<Vec4<f32>> markers;
155};
156
157MinimapConfig Convert(const RMinimapConfig& rminimap);
158
159RMinimapConfig Parse(Reader& f);
161} // namespace raw
162
163} // namespace minimap
164
165} // 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
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 pixels_per_unit
Ratio of texture pixels to world units (Texture Width / World Width)
Definition minimap.hpp:44
f32 anchor_z
Definition minimap.hpp:42
f32 anchor_x
Definition minimap.hpp:40
std::vector< glm::vec3 > markers
Definition minimap.hpp:45
Defines settings for a minimap.
Definition minimap.hpp:39
Buffer Export(const MinimapConfig &minimap)
Converts a minimap config to a binary file representation.
MinimapConfig Import(BufferView buffer)
Parses a binary file and converts it to a MinimapConfig struct.
std::vector< SPosition > Convert(const MinimapConfig &minimap, unsigned int texture_width)
Converts a minimap config to a simplified representation.
bool IsOfType(BufferView buffer)
Tests if the provided file is a minimap config.
Provides classes for reading and writing binary data to and from various sources.
Contains functions and structures for working with minimap configs.
Definition minimap.hpp:28
Definition exception.hpp:56
Provides data structures for representing essential components of a 3D asset.