diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2010-06-16 23:07:20 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2010-06-16 23:07:20 +0400 |
commit | 08a94f9bbdf74a2d87da5908d919d018445ca222 (patch) | |
tree | ec1e5dfe666f373a4582084bafc4e9923d42ba95 /source/gameengine/Rasterizer/RAS_BucketManager.cpp | |
parent | dd3513e3622ab09db5b619a061db43f6b5447380 (diff) |
BGE: When dynamically loading scenes (bge.logic.LibLoad()) in GLSL mode, the lights in the loaded scene would not affect the current scene and vice versa. To fix this, I've updated to merge code to update the scenes that the shaders are using to the scene being merged into.
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_BucketManager.cpp')
-rw-r--r-- | source/gameengine/Rasterizer/RAS_BucketManager.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index 4c22f4dcfc7..32fb1e31780 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -346,13 +346,21 @@ void RAS_BucketManager::RemoveMaterial(RAS_IPolyMaterial * mat) //#include <stdio.h> -void RAS_BucketManager::MergeBucketManager(RAS_BucketManager *other) +void RAS_BucketManager::MergeBucketManager(RAS_BucketManager *other, SCA_IScene *scene) { /* concatinate lists */ // printf("BEFORE %d %d\n", GetSolidBuckets().size(), GetAlphaBuckets().size()); + BucketList::iterator it; + + for (it = other->GetSolidBuckets().begin(); it != other->GetSolidBuckets().end(); ++it) + (*it)->GetPolyMaterial()->Replace_IScene(scene); + GetSolidBuckets().insert( GetSolidBuckets().end(), other->GetSolidBuckets().begin(), other->GetSolidBuckets().end() ); other->GetSolidBuckets().clear(); + for (it = other->GetAlphaBuckets().begin(); it != other->GetAlphaBuckets().end(); ++it) + (*it)->GetPolyMaterial()->Replace_IScene(scene); + GetAlphaBuckets().insert( GetAlphaBuckets().end(), other->GetAlphaBuckets().begin(), other->GetAlphaBuckets().end() ); other->GetAlphaBuckets().clear(); //printf("AFTER %d %d\n", GetSolidBuckets().size(), GetAlphaBuckets().size()); |