X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fview.cpp;fp=src%2Fview.cpp;h=8063cecc9e6be645ee88184c7719fafd8c6ce5f6;hp=1f855a27fad587f37c5385f96f9fcb8d061a8281;hb=5f600e9c0d22c09bd60ef3c7245dbecc8d35d576;hpb=f8b8daf1828b8a8028b9344dd0feca1b8d9e859a 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))) {