commit 3701b8e1d551a662554bab2cf28384974f708a64
parent acc706970ce4b78a1bde0561c13238ea7d57ddf4
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date: Thu, 22 Dec 2011 16:34:34 +0100
Correction d'un petit soucis sur les id des Heap.
Diffstat:
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/heap.cpp b/heap.cpp
@@ -21,6 +21,13 @@ void Heap::insert(float key, Chose* value) {
buckets[getBucket(lastNode)][getIndex(lastNode)].key = key;
buckets[getBucket(lastNode)][getIndex(lastNode)].value = value;
siftUp(lastNode);
+ for (int i = 0; i <= lastNode; i++) {
+ std::cout << id << " ";
+ std::cout << buckets[getBucket(lastNode)][getIndex(lastNode)].key << " ";
+ std::cout << buckets[getBucket(lastNode)][getIndex(lastNode)].value;
+ std::cout << typeid(*(buckets[getBucket(lastNode)][getIndex(lastNode)].value)).name();
+ std::cout << std::endl;
+ }
}
void Heap::remove(Chose* value) {
diff --git a/lod.cpp b/lod.cpp
@@ -4,7 +4,7 @@ Lod::Lod(Vertex camera, Chose* root) {
for (int i = 0; i < 6; i++) {
merge[i].init(i, (i & 1) ? -1 : 1);
splitIn[i].init(6+i, (i & 1) ? 1 : -1);
- splitOut[i].init(6+i, (i & 1) ? -1 : 1);
+ splitOut[i].init(12+i, (i & 1) ? -1 : 1);
}
this->camera[0] = camera.x;
this->camera[1] = camera.y;
@@ -33,8 +33,7 @@ void Lod::setCamera(Vertex newCamera) {
for(int i = 0; i < 6; i++) {
Chose* c;
while((c = splitOut[i].popIfLessThan(camera[i>>1]))) {
- // std::cout << "soi " << c->lod.inCounter + 1 << " ";
- // std::cout << typeid(*c).name() << " " << c << std::endl;
+ std::cout<<"soi "<<c->lod.inCounter+1<<" "<<typeid(*c).name()<<" "<<c<<std::endl;
if(c->lod.inCounter == 5) {
for(int j = 0; j < 6; j++) {
if(i == j) continue;
@@ -53,6 +52,7 @@ void Lod::setCamera(Vertex newCamera) {
for(int i = 0; i < 6; i++) {
Chose* c;
while((c = splitIn[i].popIfLessThan(camera[i>>1]))) {
+ std::cout<<"SIO "<<c->lod.inCounter-1<<" "<<typeid(*c).name()<<" "<<c<<std::endl;
c->lod.inCounter--;
splitOut[i].insert(c->lod.splitBox[i], c);
}
@@ -101,4 +101,5 @@ void Lod::addSplitCube(Chose* chose) {
splitIn[i].remove(chose);
doSplit(chose);
}
+ std::cout<<"insert "<<chose->lod.inCounter<<" "<<typeid(*chose).name()<<" "<<chose<<std::endl;
}
diff --git a/view.cpp b/view.cpp
@@ -105,7 +105,7 @@ void View::mainLoop() {
short continuer = 1;
SDL_Event event;
SDL_EnableKeyRepeat(40,40);
- SDL_WM_GrabInput(SDL_GRAB_ON);
+ // SDL_WM_GrabInput(SDL_GRAB_ON);
SDL_ShowCursor(SDL_DISABLE);
while ( SDL_PollEvent(&event) ); // empty queue.