NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches

Classes

struct  nnl::minimap::MinimapConfig
 Defines settings for a minimap. More...

Functions

bool nnl::minimap::IsOfType (BufferView buffer)
 Tests if the provided file is a minimap config.
MinimapConfig nnl::minimap::Import (BufferView buffer)
 Parses a binary file and converts it to a MinimapConfig struct.
Buffer nnl::minimap::Export (const MinimapConfig &minimap)
 Converts a minimap config to a binary file representation.
std::vector< SPositionnnl::minimap::Convert (const MinimapConfig &minimap, unsigned int texture_width)
 Converts a minimap config to a simplified representation.
MinimapConfig nnl::minimap::Convert (const std::vector< SPosition > &minimap_pos, unsigned int texture_width)
 Converts a list of positions to the in-game minimap config format.

Detailed Description


Class Documentation

◆ nnl::minimap::MinimapConfig

struct nnl::minimap::MinimapConfig

Defines settings for a minimap.

Public Attributes

f32 anchor_x = 0.0f
f32 anchor_z = 0.0f
f32 pixels_per_unit = 0.0f
 Ratio of texture pixels to world units (Texture Width / World Width)
std::vector< glm::vec3 > markers

Member Data Documentation

◆ anchor_x

f32 nnl::minimap::MinimapConfig::anchor_x = 0.0f

The world-space X anchor, offset by the PSP's half-screen width scaled by the pixel ratio. ((world_x + (240.0f / pixels_per_unit)))

◆ anchor_z

f32 nnl::minimap::MinimapConfig::anchor_z = 0.0f

The world-space Z anchor, offset by the PSP's half-screen height scaled by the pixel ratio. ((world_z + (136.0f / pixels_per_unit)))

◆ markers

std::vector<glm::vec3> nnl::minimap::MinimapConfig::markers

Used only in NSUNI, mostly to mark closed areas. X/Y are pixel coordinates, Z is rotation in degrees.

◆ pixels_per_unit

f32 nnl::minimap::MinimapConfig::pixels_per_unit = 0.0f

Ratio of texture pixels to world units (Texture Width / World Width)

Function Documentation

◆ Convert() [1/2]

std::vector< SPosition > nnl::minimap::Convert ( const MinimapConfig & minimap,
unsigned int texture_width )

Converts a minimap config to a simplified representation.

This function converts an in-game minimap config to a list of world-space positions.

The first SPosition object in the resulting vector represents the world-space origin aligned with the top-left corner of the minimap image. The second SPosition object marks the world-space boundary aligned with the top-right corner of the image. The remaining objects (if present) represent various map markers in the world space.

Parameters
minimapThe input config to be converted.
texture_widthThe width of the minimap texture (e.g., 128 or 480).
Returns
A vector of SPosition objects.
See also
nnl::SPosition

◆ Convert() [2/2]

MinimapConfig nnl::minimap::Convert ( const std::vector< SPosition > & minimap_pos,
unsigned int texture_width )

Converts a list of positions to the in-game minimap config format.

The first SPosition object is assumed to be the world-space origin aligned with the top-left corner of a minimap image. The second SPosition object is assumed to be the world-space boundary aligned with the top-right corner of the same image. The remaining objects, if present, are converted to 2D map markers.

Parameters
minimap_posThe input positions to be converted.
texture_widthThe width of the minimap texture.
Returns
A vector of SPosition objects.
Note
Square Power of Two textures are preferred since the same pixel-to-unit ratio is used for both axes.
See also
nnl::SPosition

◆ Export()

Buffer nnl::minimap::Export ( const MinimapConfig & minimap)
nodiscard

Converts a minimap config to a binary file representation.

This function takes a MinimapConfig object and converts it into a Buffer, which represents the binary format of the minimap config.

Parameters
minimapThe MinimapConfig object to be converted into a binary format.
Returns
A Buffer containing the binary representation of the config.

◆ Import()

MinimapConfig nnl::minimap::Import ( BufferView buffer)

Parses a binary file and converts it to a MinimapConfig struct.

This function takes a binary representation of a minimap config, parses its contents, and converts them into a MinimapConfig struct for easier access and manipulation.

Parameters
bufferThe binary data to be processed.
Returns
A MinimapConfig object representing the converted data.
See also
nnl::minimap::IsOfType
nnl::minimap::Export

◆ IsOfType()

bool nnl::minimap::IsOfType ( BufferView buffer)

Tests if the provided file is a minimap config.

This function takes data representing a file and checks whether it corresponds to the in-game minimap config format.

Parameters
bufferThe data to be tested.
Returns
Returns true if the file is identified as a minimap config;
See also
nnl::minimap::Import