comparison engine/core/view/renderers/gridrenderer.cpp @ 482:16c2b3ee59ce

* Merged the view performance branch back into trunk. fixes[ticket:419]
author helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 29 Apr 2010 13:51:45 +0000
parents 90005975cdbb
children b2feacaed53c
comparison
equal deleted inserted replaced
481:1f37adc9a685 482:16c2b3ee59ce
57 } 57 }
58 58
59 GridRenderer::~GridRenderer() { 59 GridRenderer::~GridRenderer() {
60 } 60 }
61 61
62 void GridRenderer::render(Camera* cam, Layer* layer, std::vector<Instance*>& instances) { 62 void GridRenderer::render(Camera* cam, Layer* layer, RenderList& instances) {
63 CellGrid* cg = layer->getCellGrid(); 63 CellGrid* cg = layer->getCellGrid();
64 if (!cg) { 64 if (!cg) {
65 FL_WARN(_log, "No cellgrid assigned to layer, cannot draw grid"); 65 FL_WARN(_log, "No cellgrid assigned to layer, cannot draw grid");
66 return; 66 return;
67 } 67 }
132 coptt2 = Point(copt2.x,copt2.y); 132 coptt2 = Point(copt2.x,copt2.y);
133 m_renderbackend->drawLine(coptt1,coptt2 ,200, 200, 200); 133 m_renderbackend->drawLine(coptt1,coptt2 ,200, 200, 200);
134 134
135 135
136 Rect cv = cam->getViewPort(); 136 Rect cv = cam->getViewPort();
137 std::vector<Instance*>::const_iterator instance_it = instances.begin(); 137 RenderList::const_iterator instance_it = instances.begin();
138 for (;instance_it != instances.end(); ++instance_it) { 138 for (;instance_it != instances.end(); ++instance_it) {
139 Instance* instance = *instance_it; 139 Instance* instance = (*instance_it)->instance;
140 std::vector<ExactModelCoordinate> vertices; 140 std::vector<ExactModelCoordinate> vertices;
141 cg->getVertices(vertices, instance->getLocationRef().getLayerCoordinates()); 141 cg->getVertices(vertices, instance->getLocationRef().getLayerCoordinates());
142 std::vector<ExactModelCoordinate>::const_iterator it = vertices.begin(); 142 std::vector<ExactModelCoordinate>::const_iterator it = vertices.begin();
143 ScreenPoint firstpt = cam->toScreenCoordinates(cg->toMapCoordinates(*it)); 143 ScreenPoint firstpt = cam->toScreenCoordinates(cg->toMapCoordinates(*it));
144 Point pt1(firstpt.x, firstpt.y); 144 Point pt1(firstpt.x, firstpt.y);