1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-26 18:21:04 +00:00

Irrlicht cleanups (mostly getting rid of core::array)

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
This commit is contained in:
sfan5 2024-08-17 19:49:11 +02:00 committed by GitHub
parent 5acc2736db
commit 5d226268df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 308 additions and 1227 deletions

View file

@ -4,6 +4,7 @@
#pragma once
#include <vector>
#include "SMaterial.h"
namespace irr
@ -57,7 +58,7 @@ struct SOverrideMaterial
};
//! To overwrite SMaterial::MaterialType
core::array<SMaterialTypeReplacement> MaterialTypes;
std::vector<SMaterialTypeReplacement> MaterialTypes;
//! Default constructor
SOverrideMaterial() :
@ -83,9 +84,8 @@ struct SOverrideMaterial
void apply(SMaterial &material)
{
if (Enabled) {
for (u32 i = 0; i < MaterialTypes.size(); ++i) {
const SMaterialTypeReplacement &mtr = MaterialTypes[i];
if (mtr.Original < 0 || (s32)mtr.Original == material.MaterialType)
for (const auto &mtr : MaterialTypes) {
if (mtr.Original < 0 || mtr.Original == (s32)material.MaterialType)
material.MaterialType = (E_MATERIAL_TYPE)mtr.Replacement;
}
for (u32 f = 0; f < 32; ++f) {