summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2016-07-19 08:43:53 -0600
committerMike Buland <mike@xagasoft.com>2016-07-19 08:43:53 -0600
commita638f876f123cb9c9d3540ce7ff184c097162480 (patch)
tree09440f896478321bf3f1a4106ac3a7a88303b27e
parent0d451543b78e173bc94c561278e16c8b20787d63 (diff)
downloadlost-a638f876f123cb9c9d3540ce7ff184c097162480.tar.gz
lost-a638f876f123cb9c9d3540ce7ff184c097162480.tar.bz2
lost-a638f876f123cb9c9d3540ce7ff184c097162480.tar.xz
lost-a638f876f123cb9c9d3540ce7ff184c097162480.zip
Fixed multidimensional floor spacing.
-rw-r--r--build.sh2
-rw-r--r--src/renderpng.cpp20
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 @@
1#!/bin/bash 1#!/bin/bash
2 2
3exec g++ -ggdb src/*.cpp -o lost.exe -L/usr/lib -lpng16 -I/usr/include -lz -ggdb 3exec 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()
44 for( int j = 2; j < iDims; j++ ) 44 for( int j = 2; j < iDims; j++ )
45 { 45 {
46 if( j%2 == 0 ) 46 if( j%2 == 0 )
47 aiPixDims[j] = iBufHeight = rMap.getSize( j )*(iBufHeight+iFloorSpacing); 47 {
48 aiPixDims[j] = iBufHeight = rMap.getSize( j )*(iBufHeight+(j/2)*iFloorSpacing);
49// if( j >= 4 )
50// iBufHeight += j*24;
51 }
48 else 52 else
49 aiPixDims[j] = iBufWidth = rMap.getSize( j )*(iBufWidth+iFloorSpacing); 53 {
54 aiPixDims[j] = iBufWidth = rMap.getSize( j )*(iBufWidth+(j/2)*iFloorSpacing);
55// if( j >= 4 )
56// iBufWidth += (j*24);
57 }
50 } 58 }
51 int ox = 0; 59 int ox = 0;
52 int oy = 12; 60 int oy = 12;
@@ -294,9 +302,17 @@ void RenderPng::render()
294 for( int j = 2; j < iDims; j++ ) 302 for( int j = 2; j < iDims; j++ )
295 { 303 {
296 if( j%2 == 0 ) 304 if( j%2 == 0 )
305 {
297 oy += p[j]*aiPixDims[j-2]; 306 oy += p[j]*aiPixDims[j-2];
307 if( j >= 4 )
308 oy += (p[j]*(j/2)*iFloorSpacing);
309 }
298 else 310 else
311 {
299 ox += p[j]*aiPixDims[j-2]; 312 ox += p[j]*aiPixDims[j-2];
313 if( j >= 4 )
314 ox += (p[j]*(j/2)*iFloorSpacing);
315 }
300 } 316 }
301 oy += 12; 317 oy += 12;
302 } 318 }