From a638f876f123cb9c9d3540ce7ff184c097162480 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 19 Jul 2016 08:43:53 -0600 Subject: Fixed multidimensional floor spacing. --- build.sh | 2 +- src/renderpng.cpp | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index cf2880f..04cf5f4 100644 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/bin/bash -exec g++ -ggdb src/*.cpp -o lost.exe -L/usr/lib -lpng16 -I/usr/include -lz -ggdb +exec g++ -ggdb src/*.cpp -I/c/Qt/Qt5.0.1/5.0.1/mingw47_32/include -L/c/Qt/Qt5.0.1/5.0.1/mingw47_32/lib -o lost.exe -lpng16 -lz -ggdb diff --git a/src/renderpng.cpp b/src/renderpng.cpp index 83f789a..dec0621 100644 --- a/src/renderpng.cpp +++ b/src/renderpng.cpp @@ -44,9 +44,17 @@ void RenderPng::render() for( int j = 2; j < iDims; j++ ) { if( j%2 == 0 ) - aiPixDims[j] = iBufHeight = rMap.getSize( j )*(iBufHeight+iFloorSpacing); + { + aiPixDims[j] = iBufHeight = rMap.getSize( j )*(iBufHeight+(j/2)*iFloorSpacing); +// if( j >= 4 ) +// iBufHeight += j*24; + } else - aiPixDims[j] = iBufWidth = rMap.getSize( j )*(iBufWidth+iFloorSpacing); + { + aiPixDims[j] = iBufWidth = rMap.getSize( j )*(iBufWidth+(j/2)*iFloorSpacing); +// if( j >= 4 ) +// iBufWidth += (j*24); + } } int ox = 0; int oy = 12; @@ -294,9 +302,17 @@ void RenderPng::render() for( int j = 2; j < iDims; j++ ) { if( j%2 == 0 ) + { oy += p[j]*aiPixDims[j-2]; + if( j >= 4 ) + oy += (p[j]*(j/2)*iFloorSpacing); + } else + { ox += p[j]*aiPixDims[j-2]; + if( j >= 4 ) + ox += (p[j]*(j/2)*iFloorSpacing); + } } oy += 12; } -- cgit v1.2.3