diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -78,6 +78,7 @@ int main(int argc, char **argv) { /*boost::timer t; double last_time = 0;*/ Vector3 selected; + Quadtree::QuadNode *node; while(running) { unsigned int time = SDL_GetTicks(); //double time = t.elapsed(); @@ -110,6 +111,16 @@ int main(int argc, char **argv) { scene.qt->create_nodes(scene.qt->levels-1); } break; + case SDLK_KP_MULTIPLY: + node = scene.qt->find(scene.pos.x, scene.pos.z); + node->parent->merge(); + scene.qt->make_vbo(); + break; + case SDLK_KP_DIVIDE: + node = scene.qt->find(scene.pos.x, scene.pos.z); + node->subdivide(); + scene.qt->make_vbo(); + break; case SDLK_SPACE: scene.yvel = .05; break; @@ -200,6 +211,8 @@ int main(int argc, char **argv) { move_str = (boost::format("%s %.2f,%.2f %.2fx%.2f %d") % scene.pos.str() % node->x % node->y % node->width % node->height % node->level).str(); } + scene.update(); + scene.lookat(); glEnable(GL_LIGHTING); |