Skip to main content

rpfm_lib/files/rigidmodel/materials/
alpha_blend.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
17impl Material {
18    pub fn read_alpha_blend<R: ReadBytes>(data: &mut R) -> Result<Self> {
19        Ok(Self {
20            name: data.read_string_u8_0padded(PADDED_SIZE_256)?,
21            ..Default::default()
22        })
23    }
24
25    pub fn write_alpha_blend<W: WriteBytes>(&self, data: &mut W) -> Result<()> {
26        data.write_string_u8_0padded(self.name(), PADDED_SIZE_256, true)?;
27
28        Ok(())
29    }
30}