diff options
| author | Comment <tim@gray.(none)> | 2014-02-26 10:58:43 +0000 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2014-02-26 10:58:43 +0000 |
| commit | 8740fb5e6b9084ea548f11d1ab1944fa653a82d7 (patch) | |
| tree | 94534bd1788d1f967c7859d379bc351d29a6e4ee /offsetProject/src/ofApp.cpp | |
| parent | 4043777c902b5f4297b133a0435be91083f3f02a (diff) | |
changes
Diffstat (limited to 'offsetProject/src/ofApp.cpp')
| -rw-r--r-- | offsetProject/src/ofApp.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/offsetProject/src/ofApp.cpp b/offsetProject/src/ofApp.cpp index 144512c..ab02ea2 100644 --- a/offsetProject/src/ofApp.cpp +++ b/offsetProject/src/ofApp.cpp @@ -113,7 +113,7 @@ void ofApp::update() { void ofApp::checktile(int level,int x,int y,int size){ int levels_factor=255/levels; - if (depthTiles[level].getPixels()[y*((int)depthTiles[level].getHeight())+x]>level*levels_factor&&level>0){ + if (depthTiles[level].getPixels()[y*((int)depthTiles[level].getWidth())+x]>level*levels_factor&&level>0){ for (int i=0;i<2;i++){ for (int j=0;j<2;j++){ checktile(level-1,x*2+i,y*2+j,size/2); @@ -121,9 +121,9 @@ void ofApp::checktile(int level,int x,int y,int size){ } } else { - ofSetColor(depthTiles[level].getPixels()[(y*((int)depthTiles[level].getHeight())+x)*3], - depthTiles[level].getPixels()[(y*((int)depthTiles[level].getHeight())+x)*3+1], - depthTiles[level].getPixels()[(y*((int)depthTiles[level].getHeight())+x)*3+2]); + ofSetColor(colourTiles[level].getPixels()[(y*((int)colourTiles[level].getWidth())+x)*3], + colourTiles[level].getPixels()[(y*((int)colourTiles[level].getWidth())+x)*3+1], + colourTiles[level].getPixels()[(y*((int)colourTiles[level].getWidth())+x)*3+2]); ofRect(x*size,y*size,size,size); } } @@ -135,7 +135,8 @@ void ofApp::draw() { //recursively draw pixels - int pixelsize=ofGetWidth()/MAX_TILE_SIZE; + int pixelsize=ofGetWidth()/colourTiles[levels-1].getWidth(); + //int yoffset= for (int i=0;i<colourTiles[levels-1].getWidth();i++){ for (int j=0;j<colourTiles[levels-1].getHeight();j++){ |
