@@ -977,8 +977,8 @@ SCA_IObject* KX_Scene::AddReplicaObject(class CValue* originalobject,
977
977
replica->InitComponents ();
978
978
// Initialize components recursively.
979
979
CListValue *childrecursive = replica->GetChildrenRecursive ();
980
- for (CListValue::iterator it = childrecursive->GetBegin (), end = childrecursive->GetEnd (); it != end; ++it) {
981
- KX_GameObject *gameobj = (KX_GameObject *) *it;
980
+ for (CListValue::iterator<KX_GameObject> it = childrecursive->GetBegin (), end = childrecursive->GetEnd (); it != end; ++it) {
981
+ KX_GameObject *gameobj = *it;
982
982
gameobj->InitComponents ();
983
983
}
984
984
childrecursive->Release ();
@@ -1417,8 +1417,8 @@ void KX_Scene::CalculateVisibleMeshes(RAS_IRasterizer* rasty,KX_Camera* cam, int
1417
1417
m_boundingBoxManager->Update (false );
1418
1418
1419
1419
// Update the object boudning volume box if the object had a deformer.
1420
- for (CListValue::iterator it = m_objectlist->GetBegin (), end = m_objectlist->GetEnd (); it != end; ++it) {
1421
- KX_GameObject *gameobj = static_cast <KX_GameObject*>(*it) ;
1420
+ for (CListValue::iterator<KX_GameObject> it = m_objectlist->GetBegin (), end = m_objectlist->GetEnd (); it != end; ++it) {
1421
+ KX_GameObject *gameobj = *it ;
1422
1422
if (gameobj->GetDeformer ()) {
1423
1423
/* * Update all the deformer, not only per material.
1424
1424
* One of the side effect is to clear some flags about AABB calculation.
@@ -1438,8 +1438,8 @@ void KX_Scene::CalculateVisibleMeshes(RAS_IRasterizer* rasty,KX_Camera* cam, int
1438
1438
* since DBVT culling will only set it to false.
1439
1439
* This is similar to what RAS_BucketManager does for RAS_MeshSlot culling.
1440
1440
*/
1441
- for (CListValue::iterator it = m_objectlist->GetBegin (), end = m_objectlist->GetEnd (); it != end; ++it) {
1442
- KX_GameObject *gameobj = static_cast <KX_GameObject*>(*it) ;
1441
+ for (CListValue::iterator<KX_GameObject> it = m_objectlist->GetBegin (), end = m_objectlist->GetEnd (); it != end; ++it) {
1442
+ KX_GameObject *gameobj = *it ;
1443
1443
gameobj->SetCulled (true );
1444
1444
}
1445
1445
@@ -1473,8 +1473,8 @@ void KX_Scene::DrawDebug(RAS_IRasterizer *rasty)
1473
1473
{
1474
1474
const bool showBoundingBox = KX_GetActiveEngine ()->GetShowBoundingBox ();
1475
1475
if (showBoundingBox) {
1476
- for (CListValue::iterator it = m_objectlist->GetBegin (); it ! = m_objectlist->GetEnd (); ++it) {
1477
- KX_GameObject *gameobj = (KX_GameObject *) *it;
1476
+ for (CListValue::iterator<KX_GameObject> it = m_objectlist->GetBegin (), end = m_objectlist->GetEnd (); it != end ; ++it) {
1477
+ KX_GameObject *gameobj = *it;
1478
1478
1479
1479
if (!gameobj->GetCulled () && gameobj->GetMeshCount () != 0 ) {
1480
1480
const MT_Vector3& scale = gameobj->NodeGetWorldScaling ();
@@ -1500,8 +1500,8 @@ void KX_Scene::DrawDebug(RAS_IRasterizer *rasty)
1500
1500
}
1501
1501
}
1502
1502
// The side effect of a armature is that it was added in the animated object list.
1503
- for (CListValue::iterator it = m_animatedlist->GetBegin (), end = m_animatedlist->GetEnd (); it != end; ++it) {
1504
- KX_GameObject *gameobj = (KX_GameObject *) *it;
1503
+ for (CListValue::iterator<KX_GameObject> it = m_animatedlist->GetBegin (), end = m_animatedlist->GetEnd (); it != end; ++it) {
1504
+ KX_GameObject *gameobj = *it;
1505
1505
if (gameobj->GetGameObjectType () == SCA_IObject::OBJ_ARMATURE) {
1506
1506
BL_ArmatureObject *armature = (BL_ArmatureObject *)gameobj;
1507
1507
if (armature->GetDrawDebug () || KX_GetActiveEngine ()->GetShowArmatures ()) {
@@ -1704,10 +1704,10 @@ RAS_MaterialBucket* KX_Scene::FindBucket(class RAS_IPolyMaterial* polymat, bool
1704
1704
void KX_Scene::RenderBuckets (const MT_Transform & cameratransform,
1705
1705
class RAS_IRasterizer * rasty)
1706
1706
{
1707
- for (CListValue::iterator it = m_objectlist->GetBegin (), end = m_objectlist->GetEnd (); it != end; ++it) {
1707
+ for (CListValue::iterator<KX_GameObject> it = m_objectlist->GetBegin (), end = m_objectlist->GetEnd (); it != end; ++it) {
1708
1708
/* This function update all mesh slot info (e.g culling, color, matrix) from the game object.
1709
1709
* It's done just before the render to be sure of the object color and visibility. */
1710
- ((KX_GameObject *) *it)->UpdateBuckets ();
1710
+ (*it)->UpdateBuckets ();
1711
1711
}
1712
1712
1713
1713
m_bucketmanager->Renderbuckets (cameratransform,rasty);
@@ -1727,8 +1727,8 @@ void KX_Scene::UpdateObjectLods()
1727
1727
const MT_Vector3& cam_pos = m_active_camera->NodeGetWorldPosition ();
1728
1728
const float lodfactor = m_active_camera->GetLodDistanceFactor ();
1729
1729
1730
- for (CListValue::iterator it = m_objectlist->GetBegin (), end = m_objectlist->GetEnd (); it != end; ++it) {
1731
- KX_GameObject *gameobj = (KX_GameObject *) *it;
1730
+ for (CListValue::iterator<KX_GameObject> it = m_objectlist->GetBegin (), end = m_objectlist->GetEnd (); it != end; ++it) {
1731
+ KX_GameObject *gameobj = *it;
1732
1732
if (!gameobj->GetCulled ()) {
1733
1733
gameobj->UpdateLod (cam_pos, lodfactor);
1734
1734
}
0 commit comments