WoWs Model Exported
World of Warships 3D model Exporter
Loading...
Searching...
No Matches
Parse and export functions

Functions

int wows_parse_geometry (char *input, wows_geometry **geometry_content)
 Parse a .geometry file from a memory-mapped path.
 
int wows_parse_geometry_fp (FILE *input, wows_geometry **geometry_content)
 Parse a .geometry file from an already-open FILE stream.
 
int wows_geometry_print (wows_geometry *geometry_content, bool verbose)
 Print a human-readable summary of a parsed geometry to stdout.
 
int wows_geometry_free (wows_geometry *geometry_content)
 Free all memory associated with a parsed geometry.
 
int wows_geometry_to_glb (wows_geometry *geometry, const char *output_path)
 Export a full geometry as a binary glTF (GLB) file.
 
int wows_geometry_to_glb_sections (wows_geometry *geometry, const char *output_path, const uint32_t *sections, uint32_t n_sections)
 Export a subset of draw-call sections as a GLB file.
 
int wows_parse_geometry_buffer (char *contents, size_t length, wows_geometry **geometry_content)
 Parse a .geometry file from a raw memory buffer.
 

Detailed Description

Function Documentation

◆ wows_geometry_free()

int wows_geometry_free ( wows_geometry geometry_content)

Free all memory associated with a parsed geometry.

Releases all buffers allocated during wows_parse_geometry or wows_parse_geometry_fp and sets the pointer to NULL conceptually.

Parameters
geometry_contentGeometry to free.
Returns
0 on success.

◆ wows_geometry_print()

int wows_geometry_print ( wows_geometry geometry_content,
bool  verbose 
)

Print a human-readable summary of a parsed geometry to stdout.

Parameters
geometry_contentGeometry to inspect.
verboseIf true, print per-vertex data in addition to header fields.
Returns
0 on success.

◆ wows_geometry_to_glb()

int wows_geometry_to_glb ( wows_geometry geometry,
const char *  output_path 
)

Export a full geometry as a binary glTF (GLB) file.

All vertex and index sections are merged into a single GLB scene.

Parameters
geometryParsed geometry to export.
output_pathDestination path for the .glb file.
Returns
0 on success, non-zero on failure.

◆ wows_geometry_to_glb_sections()

int wows_geometry_to_glb_sections ( wows_geometry geometry,
const char *  output_path,
const uint32_t *  sections,
uint32_t  n_sections 
)

Export a subset of draw-call sections as a GLB file.

Only the draw calls whose mapping_id appears in sections are written. Useful for isolating a specific LOD level or ship part.

Parameters
geometryParsed geometry to export.
output_pathDestination path for the .glb file.
sectionsArray of mapping_id values to include.
n_sectionsLength of the sections array.
Returns
0 on success, non-zero on failure.

◆ wows_parse_geometry()

int wows_parse_geometry ( char *  input,
wows_geometry **  geometry_content 
)

Parse a .geometry file from a memory-mapped path.

Opens, maps, and fully decodes the file at input. On success *geometry_content points to a heap-allocated wows_geometry that must be freed with wows_geometry_free.

Parameters
inputPath to the .geometry file.
geometry_contentOutput pointer; set to the parsed geometry on success.
Returns
0 on success, a non-zero error code on failure.

◆ wows_parse_geometry_buffer()

int wows_parse_geometry_buffer ( char *  contents,
size_t  length,
wows_geometry **  geometry_content 
)

Parse a .geometry file from a raw memory buffer.

Parameters
contentsPointer to the raw geometry file data.
lengthLength of the buffer in bytes.
geometry_contentOutput pointer; set to the parsed geometry on success.
Returns
0 on success, a non-zero error code on failure.

◆ wows_parse_geometry_fp()

int wows_parse_geometry_fp ( FILE *  input,
wows_geometry **  geometry_content 
)

Parse a .geometry file from an already-open FILE stream.

Reads from the current position of input to EOF. Ownership of the FILE handle is not transferred; the caller must close it.

Parameters
inputOpen readable FILE stream positioned at the start of the data.
geometry_contentOutput pointer; set to the parsed geometry on success.
Returns
0 on success, a non-zero error code on failure.