rpfm_lib/files/rigidmodel/materials/uk_27.rs
1//---------------------------------------------------------------------------//
2// Copyright (c) 2017-2026 Ismael Gutiérrez González. All rights reserved.
3//
4// This file is part of the Rusted PackFile Manager (RPFM) project,
5// which can be found here: https://github.com/Frodo45127/rpfm.
6//
7// This file is licensed under the MIT license, which can be found here:
8// https://github.com/Frodo45127/rpfm/blob/master/LICENSE.
9//---------------------------------------------------------------------------//
10
11use super::*;
12
13//---------------------------------------------------------------------------//
14// Implementation
15//---------------------------------------------------------------------------//
16
17/// Materials of type 27: the strings of the default material.
18impl Material {
19 pub fn read_uk_27<R: ReadBytes>(data: &mut R, version: u32) -> Result<Self> {
20 Ok(Self {
21 name: read_padded_string(data, version, PADDED_SIZE_32)?,
22 texture_directory: read_padded_string(data, version, PADDED_SIZE_256)?,
23 filters: read_padded_string(data, version, PADDED_SIZE_256)?,
24 ..Default::default()
25 })
26 }
27
28 pub fn write_uk_27<W: WriteBytes>(&self, data: &mut W, version: u32) -> Result<()> {
29 write_padded_string(data, version, &self.name, PADDED_SIZE_32)?;
30 write_padded_string(data, version, &self.texture_directory, PADDED_SIZE_256)?;
31 write_padded_string(data, version, &self.filters, PADDED_SIZE_256)
32 }
33}