|
@@ -64,6 +64,12 @@ namespace oxygine
|
|
|
|
|
|
|
|
VideoDriverCache& cache = _videoCache;
|
|
VideoDriverCache& cache = _videoCache;
|
|
|
|
|
|
|
|
|
|
+ MaterialX::null->apply();
|
|
|
|
|
+ rsCache().reset();
|
|
|
|
|
+ rsCache().changeDriver(&cache);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
STDRenderer* original = STDRenderer::getCurrent();
|
|
STDRenderer* original = STDRenderer::getCurrent();
|
|
|
|
|
|
|
@@ -91,6 +97,10 @@ namespace oxygine
|
|
|
else
|
|
else
|
|
|
item->doRender(rs);
|
|
item->doRender(rs);
|
|
|
|
|
|
|
|
|
|
+ rsCache().changeDriver(IVideoDriver::instance);
|
|
|
|
|
+ rsCache().reset();
|
|
|
|
|
+ MaterialX::null->apply();
|
|
|
|
|
+
|
|
|
|
|
|
|
|
RectF itemRect = cache._bounds;
|
|
RectF itemRect = cache._bounds;
|
|
|
if (itemRect == RectF::invalidated())
|
|
if (itemRect == RectF::invalidated())
|
|
@@ -145,8 +155,12 @@ namespace oxygine
|
|
|
|
|
|
|
|
void TreeInspectorPreview::doRender(RenderState const& parentRenderState)
|
|
void TreeInspectorPreview::doRender(RenderState const& parentRenderState)
|
|
|
{
|
|
{
|
|
|
|
|
+ rsCache().reset();
|
|
|
|
|
+ MaterialX::null->apply();
|
|
|
Sprite::doRender(parentRenderState);
|
|
Sprite::doRender(parentRenderState);
|
|
|
|
|
+ MaterialX::null->apply();
|
|
|
_videoCache.render(parentRenderState.transform);
|
|
_videoCache.render(parentRenderState.transform);
|
|
|
|
|
+ rsCache().reset();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
VideoDriverCache::VideoDriverCache()
|
|
VideoDriverCache::VideoDriverCache()
|
|
@@ -310,16 +324,16 @@ namespace oxygine
|
|
|
b.numVertices = 0;
|
|
b.numVertices = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void VideoDriverCache::draw(PRIMITIVE_TYPE pt, const VertexDeclaration* decl, const void* verticesData, unsigned int numVertices, const unsigned short* indicesData, unsigned int numIndices)
|
|
|
|
|
|
|
+ void VideoDriverCache::draw(PRIMITIVE_TYPE pt, const VertexDeclaration* decl, const void* verticesData, unsigned int verticesDataSize, const unsigned short* indicesData, unsigned int numIndices)
|
|
|
{
|
|
{
|
|
|
if (!numIndices)
|
|
if (!numIndices)
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
current().vdecl = decl;
|
|
current().vdecl = decl;
|
|
|
current().pt = pt;
|
|
current().pt = pt;
|
|
|
- current().numVertices = numVertices;
|
|
|
|
|
|
|
+ current().numVertices = verticesDataSize / decl->size;
|
|
|
current().numIndices = numIndices;
|
|
current().numIndices = numIndices;
|
|
|
- current().vertices.assign((const char*)verticesData, (const char*)verticesData + decl->size * numVertices);
|
|
|
|
|
|
|
+ current().vertices.assign((const char*)verticesData, (const char*)verticesData + verticesDataSize);
|
|
|
current().indices.assign(indicesData, indicesData + numIndices);
|
|
current().indices.assign(indicesData, indicesData + numIndices);
|
|
|
|
|
|
|
|
nextBatch();
|
|
nextBatch();
|