17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-08 22:07:20 +01:00

Merge branch 'master' into feat/renderers-cleanup

This commit is contained in:
2026-11-07 16:44:51 +01:00
177 changed files with 11657 additions and 833 deletions

View File

@@ -505,6 +505,8 @@ bool anim_type_shared_by_instances( TAnimType a ) {
// instanced path (one shared submodel tree across all instances) cannot serve.
bool submodel_tree_blocks_instancing( TSubModel const *Sub ) {
if( Sub == nullptr ) { return false; }
// a text display shows the text of its instance, a tree shared by all instances can't do that
if( Sub->eType == TP_TEXT ) { return true; }
if( anim_type_unsafe_for_instancing( Sub->b_Anim ) ) { return true; }
if( ( ( Sub->iFlags & 0x4000 ) != 0 ) && ( false == anim_type_shared_by_instances( Sub->b_Anim ) ) ) { return true; }
if( submodel_tree_blocks_instancing( Sub->Child ) ) { return true; }
@@ -524,6 +526,7 @@ bool submodel_tree_faces_camera( TSubModel const *Sub ) {
} // anonymous namespace
int TAnimModel::s_instanceable_total = 0;
unsigned int TAnimModel::s_instanceable_revoked = 0;
int TAnimModel::s_classified_total = 0;
int TAnimModel::s_rejected_no_pmodel = 0;
int TAnimModel::s_rejected_lights = 0;
@@ -562,6 +565,7 @@ std::shared_ptr<TAnimContainer> TAnimModel::AddContainer(std::string const &Name
m_animlist.push_back(tmp);
// containers are added by events after the instance was loaded and bucketed;
// the instanced path skips RaAnimate(), so this instance has to be drawn on its own
if( m_instanceable ) { ++s_instanceable_revoked; }
m_instanceable = false;
++scene::node_state_version;
return tmp;
@@ -797,6 +801,7 @@ void TAnimModel::SkinSet( int const Index, material_handle const Material ) {
m_materialdata.replacable_skins[ std::clamp( Index, 1, 4 ) ] = Material;
// the instance stays in the bucket of its old skin set, where it would get the textures of the batch
if( m_instanceable ) { ++s_instanceable_revoked; }
m_instanceable = false;
++scene::node_state_version;
}