MCPcopy Create free account
hub / github.com/carbonengine/trinity / OnListModified

Method OnListModified

trinity/Tr2MeshBase.cpp:76–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void Tr2MeshBase::OnListModified(
77 long event,
78 ssize_t key,
79 ssize_t key2,
80 IRoot* value,
81 const IList* list )
82{
83 switch( event & BELIST_EVENTMASK )
84 {
85 case BELIST_INSERTED:
86 if( Tr2MeshAreaPtr area = BlueCastPtr( value ) )
87 {
88 area->AddOwnerMesh( this );
89 if( area->IsReversed() )
90 {
91 ReverseIndexBuffers();
92 }
93 }
94 break;
95 case BELIST_REMOVED:
96 if( Tr2MeshAreaPtr area = BlueCastPtr( value ) )
97 {
98 area->RemoveOwnerMesh( this );
99 }
100 break;
101 case BELIST_LOADFINISHED:
102 for( ssize_t i = 0; i < list->GetSize(); ++i )
103 {
104 if( Tr2MeshAreaPtr entity = BlueCastPtr( list->GetAt( i ) ) )
105 {
106 entity->AddOwnerMesh( this );
107 }
108 }
109 if( HasReversedAreas() )
110 {
111 ReverseIndexBuffers();
112 }
113 break;
114 case BELIST_UNLOADSTART:
115 for( ssize_t i = 0; i < list->GetSize(); ++i )
116 {
117 if( Tr2MeshAreaPtr entity = BlueCastPtr( list->GetAt( i ) ) )
118 {
119 entity->RemoveOwnerMesh( this );
120 }
121 }
122 break;
123 default:
124 break;
125 }
126}
127
128bool Tr2MeshBase::HasReversedAreas() const
129{

Callers

nothing calls this directly

Calls 4

AddOwnerMeshMethod · 0.80
IsReversedMethod · 0.80
RemoveOwnerMeshMethod · 0.80
GetSizeMethod · 0.45

Tested by

no test coverage detected