Correction sur les fenêtres.

This commit is contained in:
Georges Dupéron 2012-01-20 02:00:22 +01:00
parent 8be65b8703
commit 2df4e1d07c
2 changed files with 10 additions and 4 deletions

View File

@ -1,8 +1,10 @@
#include "all_includes.hh" #include "all_includes.hh"
MurQuad::MurQuad(Quad _c, Quad _ch, bool _window) : Chose(), c(_c), ch(_ch), window(_window) { MurQuad::MurQuad(Quad _c, Quad _ch, bool _window, bool _top, bool _bottom) : Chose(), c(_c), ch(_ch), window(_window), top(_top), bottom(_bottom) {
addEntropy(c); addEntropy(c);
addEntropy(ch); addEntropy(ch);
addEntropy((int)top);
addEntropy((int)bottom);
if(_window) if(_window)
setWindow(); setWindow();
} }
@ -44,8 +46,8 @@ bool MurQuad::split() {
Quad lefth = Quad(ch[NE],ch[SE],windowPosh[SE],windowPosh[NE]); Quad lefth = Quad(ch[NE],ch[SE],windowPosh[SE],windowPosh[NE]);
Quad top = Quad(windowPosh[NE],windowPosh[NW],windowPosh[SW],windowPosh[SE]); Quad top = Quad(windowPosh[NE],windowPosh[NW],windowPosh[SW],windowPosh[SE]);
addChild(new MurQuad(c,windowPos,false)); addChild(new MurQuad(c,windowPos,false, true, false));
addChild(new MurQuad(windowPosh,ch, false)); addChild(new MurQuad(windowPosh,ch, false, false, true));
addChild(new MurQuad(left,lefth,false)); addChild(new MurQuad(left,lefth,false));
addChild(new MurQuad(right,righth,false)); addChild(new MurQuad(right,righth,false));
} }
@ -54,6 +56,8 @@ bool MurQuad::split() {
} }
void MurQuad::triangulation() { void MurQuad::triangulation() {
if (bottom) addGPUQuad(c, Couleurs::mur);
if (top) addGPUQuad(ch, Couleurs::mur);
addGPUFourQuads(c, ch, Couleurs::mur); addGPUFourQuads(c, ch, Couleurs::mur);
} }

View File

@ -10,10 +10,12 @@ private :
bool window; // Contient une fenêtre ou non. bool window; // Contient une fenêtre ou non.
Quad windowPos; Quad windowPos;
Quad windowPosh; Quad windowPosh;
bool top;
bool bottom;
public : public :
MurQuad(Quad c, Quad ch, bool _window=false); MurQuad(Quad c, Quad ch, bool _window=false, bool _top=false, bool _bottom=false);
virtual void triangulation(); virtual void triangulation();
virtual bool split(); virtual bool split();
virtual void getBoundingBoxPoints(); virtual void getBoundingBoxPoints();