summaryrefslogtreecommitdiff
path: root/scene.cpp
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-04-10 14:51:47 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-04-10 14:51:47 +0200
commite0c0a9f3816facd0fc4066a50479f823447e03f6 (patch)
tree0dae6e6e1472256c7c4287d34fbd0ea5cb42edbb /scene.cpp
parent70d2e2f6af64b43067d4a8421592b14d1258069b (diff)
Simple raise/lower implementation.
Diffstat (limited to 'scene.cpp')
-rw-r--r--scene.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/scene.cpp b/scene.cpp
index cbeedd3..4f872d2 100644
--- a/scene.cpp
+++ b/scene.cpp
@@ -177,8 +177,10 @@ void Scene::events() {
show_selection = false;
break;
case SDL_BUTTON_WHEELUP:
+ qt->raise(selected.x, selected.z, 10, 1, 1);
+ break;
case SDL_BUTTON_WHEELDOWN:
- // TODO: reimplement?
+ qt->raise(selected.x, selected.z, 10, 1, -1);
break;
}
case SDL_MOUSEMOTION:
@@ -252,7 +254,9 @@ void Scene::render() {
yvel = 0;
}
}
- move_str = (boost::format("%s %.2f,%.2f %.2fx%.2f") % pos.str() % node->x % node->y % node->width % node->height).str();
+ move_str = (boost::format("%s n: %.2f,%.2f %.2fx%.2f c: %d,%d %dx%d")
+ % pos.str() % node->x % node->y % node->width % node->height
+ % node->chunk->x % node->chunk->y % node->chunk->width % node->chunk->height).str();
if(last_node != node) {
last_node = node;
@@ -355,14 +359,16 @@ void Scene::render() {
float height = font->LineHeight();
glColor3f(1, 1, 1);
glTranslatef(0, video::height-height, 0);
- font->Render((boost::format("%dx%d chunks: %d steps: %d")
- % qt->width % qt->height % chunks_rendered % steps).str().c_str());
+ font->Render((boost::format("%dx%d chunks: %d gravity: %d steps: %d")
+ % qt->width % qt->height % chunks_rendered % gravity % steps).str().c_str());
//font->Render((boost::format("%dx%d %d levels %d nodes tree creation time: %f steps: %d update: %d")
// % scene.qt->width % scene.qt->height % scene.qt->levels % scene.qt->nodes % scene.qt->init_time % steps % scene.qt->thread_running).str().c_str());
//glTranslatef(0, height, 0);
//font->Render((boost::format("selected: %x") % selected).str().c_str());
glTranslatef(0, -height, 0);
font->Render(move_str.c_str());
+ glTranslatef(0, -height, 0);
+ font->Render(selected.str().c_str());
/*if(selected) {
glTranslatef(0, height, 0);
//font->Render((boost::format("(%s %s %s %s)") % selected->a->str() % selected->b->str() % selected->c->str() % selected->d->str()).str().c_str());