X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Fview.cpp;h=8063cecc9e6be645ee88184c7719fafd8c6ce5f6;hb=3917214a11bf76381ddc528e3fe51de9ec038d42;hp=1f855a27fad587f37c5385f96f9fcb8d061a8281;hpb=1d179b93f6a1b2a4fe3823c26fba862c24bc5d6e;p=ipdf%2Fcode.git diff --git a/src/view.cpp b/src/view.cpp index 1f855a2..8063cec 100644 --- a/src/view.cpp +++ b/src/view.cpp @@ -201,7 +201,7 @@ void View::Render(int width, int height) #ifndef QUADTREE_DISABLED if (m_bounds_dirty || !m_lazy_rendering) { - if ( false && (m_bounds.x > 1.0 || m_bounds.x < 0.0 || m_bounds.y > 1.0 || m_bounds.y < 0.0 || m_bounds.w > 1.0 || m_bounds.h > 1.0)) + if ( (m_bounds.x > 1.0 || m_bounds.x < 0.0 || m_bounds.y > 1.0 || m_bounds.y < 0.0 || m_bounds.w > 1.0 || m_bounds.h > 1.0)) { //TODO: Generate a new parent node. if (m_document.GetQuadTree().nodes[m_current_quadtree_node].parent != QUADTREE_EMPTY) @@ -255,8 +255,16 @@ void View::Render(int width, int height) m_current_quadtree_node = m_document.GetQuadTree().nodes[m_current_quadtree_node].bottom_right; } } - m_screen.DebugFontPrintF("Current View QuadTree Node: %d (objs: %d -> %d)\n", m_current_quadtree_node, m_document.GetQuadTree().nodes[m_current_quadtree_node].object_begin, - m_document.GetQuadTree().nodes[m_current_quadtree_node].object_end); + + m_screen.DebugFontPrintF("Current View QuadTree"); + QuadTreeIndex overlay = m_current_quadtree_node; + while (overlay != -1) + { + m_screen.DebugFontPrintF(" Node: %d (objs: %d -> %d)", overlay, m_document.GetQuadTree().nodes[overlay].object_begin, + m_document.GetQuadTree().nodes[overlay].object_end); + overlay = m_document.GetQuadTree().nodes[overlay].next_overlay; + } + m_screen.DebugFontPrintF("\n"); Rect view_top_bounds = m_bounds; QuadTreeIndex tmp = m_current_quadtree_node; @@ -313,7 +321,12 @@ void View::RenderQuadtreeNode(int width, int height, QuadTreeIndex node, int rem if (!remaining_depth) return; //Debug("Rendering QT node %d, (objs: %d -- %d)\n", node, m_document.GetQuadTree().nodes[node].object_begin, m_document.GetQuadTree().nodes[node].object_end); m_bounds_dirty = true; - RenderRange(width, height, m_document.GetQuadTree().nodes[node].object_begin, m_document.GetQuadTree().nodes[node].object_end); + QuadTreeIndex overlay = node; + while(overlay != -1) + { + RenderRange(width, height, m_document.GetQuadTree().nodes[overlay].object_begin, m_document.GetQuadTree().nodes[overlay].object_end); + overlay = m_document.GetQuadTree().nodes[overlay].next_overlay; + } if (m_bounds.Intersects(Rect(-1,-1,1,1))) {