Merge branch 'master' of https://github.com/DigitalPulseSoftware/NazaraEngine
Former-commit-id: d40335a1d84793068db6d9ea7291e4053d00b349 [formerly 60aa10a46378c238c40f700bfd6c6e5585558da2] [formerly 0133433740741edc53e2070b8c2fdf5a4b831361 [formerly deb7b7432d4e327e8f9438814eafaa25dd3d9a51]] Former-commit-id: f1eea3bf4fe3d0024217f5e9b38046cf2517b0cc [formerly 6a21f03e56a7d5c8d4aa9855f2aa50e9e7b30ae3] Former-commit-id: 124f40eb3bbd24740ca15338a99153bab98846a4
This commit is contained in:
commit
82f39221f7
|
|
@ -43,7 +43,7 @@ namespace Nz
|
|||
break;
|
||||
|
||||
case WindowEventType_MouseButtonReleased:
|
||||
OnMouseButtonPressed(this, event.mouseButton);
|
||||
OnMouseButtonReleased(this, event.mouseButton);
|
||||
break;
|
||||
|
||||
case WindowEventType_MouseEntered:
|
||||
|
|
|
|||
|
|
@ -187,18 +187,11 @@ namespace Nz
|
|||
drawFunc(meshData.primitiveMode, 0, indexCount);
|
||||
}
|
||||
}
|
||||
|
||||
instances.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// And we set it back data to zero
|
||||
matEntry.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
pipelineEntry.maxInstanceCount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -273,11 +273,43 @@ namespace Nz
|
|||
layers.clear();
|
||||
else
|
||||
{
|
||||
for (auto it = layers.begin(); it != layers.end(); ++it)
|
||||
for (auto it = layers.begin(); it != layers.end();)
|
||||
{
|
||||
Layer& layer = it->second;
|
||||
if (layer.clearCount++ >= 100)
|
||||
it = layers.erase(it);
|
||||
else
|
||||
{
|
||||
for (auto& pipelinePair : layer.opaqueModels)
|
||||
{
|
||||
const MaterialPipeline* pipeline = pipelinePair.first;
|
||||
auto& pipelineEntry = pipelinePair.second;
|
||||
|
||||
if (pipelineEntry.maxInstanceCount > 0)
|
||||
{
|
||||
for (auto& materialPair : pipelineEntry.materialMap)
|
||||
{
|
||||
auto& matEntry = materialPair.second;
|
||||
|
||||
if (matEntry.enabled)
|
||||
{
|
||||
MeshInstanceContainer& meshInstances = matEntry.meshMap;
|
||||
|
||||
for (auto& meshIt : meshInstances)
|
||||
{
|
||||
auto& meshEntry = meshIt.second;
|
||||
|
||||
meshEntry.instances.clear();
|
||||
}
|
||||
matEntry.enabled = false;
|
||||
}
|
||||
}
|
||||
pipelineEntry.maxInstanceCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -527,6 +527,62 @@ namespace Nz
|
|||
layers.erase(it++);
|
||||
else
|
||||
{
|
||||
for (auto& pipelinePair : layer.basicSprites)
|
||||
{
|
||||
auto& pipelineEntry = pipelinePair.second;
|
||||
|
||||
if (pipelineEntry.enabled)
|
||||
{
|
||||
for (auto& materialPair : pipelineEntry.materialMap)
|
||||
{
|
||||
auto& matEntry = materialPair.second;
|
||||
|
||||
if (matEntry.enabled)
|
||||
{
|
||||
auto& overlayMap = matEntry.overlayMap;
|
||||
for (auto& overlayIt : overlayMap)
|
||||
{
|
||||
const Texture* overlay = overlayIt.first;
|
||||
auto& spriteChainVector = overlayIt.second.spriteChains;
|
||||
|
||||
spriteChainVector.clear();
|
||||
}
|
||||
|
||||
matEntry.enabled = false;
|
||||
}
|
||||
}
|
||||
pipelineEntry.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& pipelinePair : layer.opaqueModels)
|
||||
{
|
||||
auto& pipelineEntry = pipelinePair.second;
|
||||
|
||||
if (pipelineEntry.maxInstanceCount > 0)
|
||||
{
|
||||
for (auto& materialPair : pipelineEntry.materialMap)
|
||||
{
|
||||
const Material* material = materialPair.first;
|
||||
auto& matEntry = materialPair.second;
|
||||
|
||||
if (matEntry.enabled)
|
||||
{
|
||||
MeshInstanceContainer& meshInstances = matEntry.meshMap;
|
||||
|
||||
for (auto& meshIt : meshInstances)
|
||||
{
|
||||
auto& meshEntry = meshIt.second;
|
||||
|
||||
meshEntry.instances.clear();
|
||||
}
|
||||
matEntry.enabled = false;
|
||||
}
|
||||
}
|
||||
pipelineEntry.maxInstanceCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
layer.otherDrawables.clear();
|
||||
layer.transparentModels.clear();
|
||||
layer.transparentModelData.clear();
|
||||
|
|
|
|||
|
|
@ -386,17 +386,12 @@ namespace Nz
|
|||
vertexMapper.Unmap();
|
||||
|
||||
Renderer::DrawIndexedPrimitives(PrimitiveMode_TriangleList, 0, spriteCount * 6);
|
||||
} while (spriteChain < spriteChainCount);
|
||||
|
||||
spriteChainVector.clear();
|
||||
}
|
||||
while (spriteChain < spriteChainCount);
|
||||
}
|
||||
}
|
||||
|
||||
// We set it back to zero
|
||||
matEntry.enabled = false;
|
||||
}
|
||||
}
|
||||
pipelineEntry.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -781,12 +776,8 @@ namespace Nz
|
|||
instances.clear();
|
||||
}
|
||||
}
|
||||
|
||||
matEntry.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
pipelineEntry.maxInstanceCount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue