# TODO: stb_truetype doesn't compile with some of these warnings.
CXX = g++ -std=gnu++0x -g -Wall -Werror -Wshadow -pedantic -rdynamic
MAIN = main.o
-OBJ = log.o real.o bezier.o document.o objectrenderer.o view.o screen.o vfpu.o graphicsbuffer.o framebuffer.o shaderprogram.o stb_truetype.o gl_core44.o add_digits_asm.o sub_digits_asm.o mul_digits_asm.o div_digits_asm.o arbint.o
+OBJ = log.o real.o bezier.o document.o objectrenderer.o view.o screen.o vfpu.o quadtree.o graphicsbuffer.o framebuffer.o shaderprogram.o stb_truetype.o gl_core44.o add_digits_asm.o sub_digits_asm.o mul_digits_asm.o div_digits_asm.o arbint.o
LIB_x86_64 = ../contrib/lib/libSDL2-2.0.so.0 -lGL -lgmp
LIB_i386 = ../contrib/lib32/libSDL2-2.0.so.0 -lGL -lgmp
#include "common.h"
+#include "ipdf.h"
namespace IPDF
{
QuadTreeIndex root_id;
std::vector<QuadTreeNode> nodes;
};
+
+ Rect TransformToQuadChild(const Rect& src, QuadTreeNodeChildren child_type);
+ Rect TransformFromQuadChild(const Rect& src, QuadTreeNodeChildren child_type);
}
#else
#ifndef QUADTREE_DISABLED
void View::RenderQuadtreeNode(int width, int height, QuadTreeIndex node, int remaining_depth)
{
+ Rect old_bounds = m_bounds;
if (node == QUADTREE_EMPTY) return;
if (!remaining_depth) return;
RenderRange(width, height, m_document.GetQuadTree().nodes[node].object_begin, m_document.GetQuadTree().nodes[node].object_end);
+
+ m_bounds = TransformToQuadChild(old_bounds, QTC_TOP_LEFT);
RenderQuadtreeNode(width, height, m_document.GetQuadTree().nodes[node].top_left, remaining_depth-1);
+ m_bounds = TransformToQuadChild(old_bounds, QTC_TOP_RIGHT);
RenderQuadtreeNode(width, height, m_document.GetQuadTree().nodes[node].top_right, remaining_depth-1);
+ m_bounds = TransformToQuadChild(old_bounds, QTC_BOTTOM_LEFT);
RenderQuadtreeNode(width, height, m_document.GetQuadTree().nodes[node].bottom_left, remaining_depth-1);
+ m_bounds = TransformToQuadChild(old_bounds, QTC_BOTTOM_RIGHT);
RenderQuadtreeNode(width, height, m_document.GetQuadTree().nodes[node].bottom_right, remaining_depth-1);
+ m_bounds = old_bounds;
}
#endif