Merge branch 'master' of https://github.com/DigitalPulseSoftware/NazaraEngine
Former-commit-id: 81dfaea9fd265b8a2610fda2a155cef4a73695b3 [formerly 4ca561497c773dd88058e448f1e1901ce558eb0b] [formerly 5ae1e8f8d0bd13c6ee275b655ec82e66435ae5b1 [formerly 2ea9e9744d6877a1192e6cb844e3172ae8db7218]] Former-commit-id: d8944c28fa76195f7fdbd682b0d6113d0ae3c487 [formerly a81b6d5a73db2fbe5b0428cb7a8bc3388432c06c] Former-commit-id: 50f7995003fd968d85a0f3f020313c7d6d9f5d68
This commit is contained in:
commit
560825fa8e
|
|
@ -43,7 +43,7 @@ namespace Nz
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WindowEventType_MouseButtonReleased:
|
case WindowEventType_MouseButtonReleased:
|
||||||
OnMouseButtonPressed(this, event.mouseButton);
|
OnMouseButtonReleased(this, event.mouseButton);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WindowEventType_MouseEntered:
|
case WindowEventType_MouseEntered:
|
||||||
|
|
|
||||||
|
|
@ -187,18 +187,11 @@ namespace Nz
|
||||||
drawFunc(meshData.primitiveMode, 0, indexCount);
|
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();
|
layers.clear();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (auto it = layers.begin(); it != layers.end(); ++it)
|
for (auto it = layers.begin(); it != layers.end();)
|
||||||
{
|
{
|
||||||
Layer& layer = it->second;
|
Layer& layer = it->second;
|
||||||
if (layer.clearCount++ >= 100)
|
if (layer.clearCount++ >= 100)
|
||||||
it = layers.erase(it);
|
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++);
|
layers.erase(it++);
|
||||||
else
|
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.otherDrawables.clear();
|
||||||
layer.transparentModels.clear();
|
layer.transparentModels.clear();
|
||||||
layer.transparentModelData.clear();
|
layer.transparentModelData.clear();
|
||||||
|
|
|
||||||
|
|
@ -386,17 +386,12 @@ namespace Nz
|
||||||
vertexMapper.Unmap();
|
vertexMapper.Unmap();
|
||||||
|
|
||||||
Renderer::DrawIndexedPrimitives(PrimitiveMode_TriangleList, 0, spriteCount * 6);
|
Renderer::DrawIndexedPrimitives(PrimitiveMode_TriangleList, 0, spriteCount * 6);
|
||||||
} while (spriteChain < spriteChainCount);
|
}
|
||||||
|
while (spriteChain < spriteChainCount);
|
||||||
spriteChainVector.clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We set it back to zero
|
|
||||||
matEntry.enabled = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pipelineEntry.enabled = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -781,12 +776,8 @@ namespace Nz
|
||||||
instances.clear();
|
instances.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
matEntry.enabled = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pipelineEntry.maxInstanceCount = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue