From 7b0a859fe609e9c760e0d8e50f703d3c93a799ee Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Fri, 23 Jan 2009 02:13:51 +0000 Subject: [PATCH] Added new "layer 3" tiles which are drawn in front of sprites. --- data/levels/level1.dat | 15 +++++++ data/levels/level10.dat | 5 +++ data/levels/level100.dat | 12 ++++++ data/levels/level101.dat | 13 ++++++ data/levels/level106.dat | 5 +++ data/levels/level107.dat | 14 +++++++ data/levels/level108.dat | 11 +++++ data/levels/level113.dat | 5 +++ data/levels/level117.dat | 6 +++ data/levels/level14.dat | 7 ++++ data/levels/level2.dat | 2 + data/levels/level22.dat | 16 +++++++ data/levels/level3.dat | 6 +++ data/levels/level4.dat | 2 +- data/levels/level403.dat | 17 +++++++- data/levels/level414.dat | 16 +++++++ data/levels/level419.dat | 30 ++++++++++++++ data/levels/level420.dat | 18 +++++++- data/levels/level422.dat | 87 +++++++++++++++++++++++++++++++++++++++ data/levels/level5.5.dat | 6 +++ data/levels/level7.5.dat | 18 +++++++- data/levels/level8.5.dat | 8 ++++ data/levels/level8.dat | 5 +++ data/levels/level9.dat | 21 ++++++++++ data/levels/level99.dat | 11 +++++ data/newtiles/bars.png | Bin 0 -> 261 bytes data/newtiles/fence.png | Bin 0 -> 554 bytes data/tiledefs.dat | 12 ++++++ defs.h | 2 + edit.c | 86 +++++++++++++++++++++++++++++++++----- edit.h | 2 + rc.c | 17 +++++++- shared.c | 61 ++++++++++++++++++++++++--- shared.h | 1 + 34 files changed, 517 insertions(+), 20 deletions(-) create mode 100644 data/newtiles/bars.png create mode 100644 data/newtiles/fence.png diff --git a/data/levels/level1.dat b/data/levels/level1.dat index 4dd78a1..f9e30c4 100644 --- a/data/levels/level1.dat +++ b/data/levels/level1.dat @@ -63,3 +63,18 @@ exitdir 1 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,44,44,4,4,4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, layer2 +5,19,94,layer3 +6,19,94,layer3 +7,19,94,layer3 +8,19,94,layer3 +9,19,94,layer3 +11,19,94,layer3 +12,19,94,layer3 +13,19,94,layer3 +14,19,94,layer3 +15,19,94,layer3 +33,19,94,layer3 +34,19,94,layer3 +35,19,94,layer3 +36,19,94,layer3 +37,19,94,layer3 diff --git a/data/levels/level10.dat b/data/levels/level10.dat index 7145b2d..a0bf5b8 100644 --- a/data/levels/level10.dat +++ b/data/levels/level10.dat @@ -154,6 +154,11 @@ layer2 16,18,28 17,18,28 18,18,34 +28,18,94,layer3 +29,18,94,layer3 +30,18,94,layer3 +31,18,94,layer3 +32,18,94,layer3 7,22,35 10,22,28 11,22,28 diff --git a/data/levels/level100.dat b/data/levels/level100.dat index e008c89..c13b1ba 100644 --- a/data/levels/level100.dat +++ b/data/levels/level100.dat @@ -86,3 +86,15 @@ layer2 23,8,8 16,14,8 23,14,8 +14,24,94,layer3 +15,24,94,layer3 +16,24,94,layer3 +17,24,94,layer3 +18,24,94,layer3 +19,24,94,layer3 +20,24,94,layer3 +21,24,94,layer3 +22,24,94,layer3 +23,24,94,layer3 +24,24,94,layer3 +25,24,94,layer3 diff --git a/data/levels/level101.dat b/data/levels/level101.dat index a1fa8e9..2833d3b 100644 --- a/data/levels/level101.dat +++ b/data/levels/level101.dat @@ -90,12 +90,25 @@ layer2 26,13,28 13,14,28 27,14,28 +9,15,94,layer3 +10,15,94,layer3 12,15,28 28,15,28 +30,15,94,layer3 +31,15,94,layer3 11,16,28 29,16,28 +1,17,94,layer3 +2,17,94,layer3 +3,17,94,layer3 +4,17,94,layer3 +5,17,94,layer3 12,17,28 28,17,28 +35,17,94,layer3 +36,17,94,layer3 +37,17,94,layer3 +38,17,94,layer3 13,18,28 27,18,28 14,19,28 diff --git a/data/levels/level106.dat b/data/levels/level106.dat index 8160029..0ce1304 100644 --- a/data/levels/level106.dat +++ b/data/levels/level106.dat @@ -61,3 +61,8 @@ exitdir 2 44,0,0,0,44,44,44,44,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,44,44,44,44,0,0,0,44, 44,0,0,0,44,44,44,44,44,0,0,0,0,45,45,45,45,45,45,45,45,45,45,45,45,45,0,0,0,0,0,44,44,44,44,44,0,0,0,44, layer2 +17,11,94,layer3 +18,11,94,layer3 +19,11,94,layer3 +20,11,94,layer3 +21,11,94,layer3 diff --git a/data/levels/level107.dat b/data/levels/level107.dat index f13f2bc..928885f 100644 --- a/data/levels/level107.dat +++ b/data/levels/level107.dat @@ -75,3 +75,17 @@ exitdir 1 4,41,4,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,70,4, 4,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4, layer2 +26,15,94,layer3 +27,15,94,layer3 +28,15,94,layer3 +29,15,94,layer3 +30,15,94,layer3 +18,17,94,layer3 +19,17,94,layer3 +20,17,94,layer3 +21,17,94,layer3 +22,17,94,layer3 +11,19,94,layer3 +12,19,94,layer3 +13,19,94,layer3 +14,19,94,layer3 diff --git a/data/levels/level108.dat b/data/levels/level108.dat index bee2cc5..3441075 100644 --- a/data/levels/level108.dat +++ b/data/levels/level108.dat @@ -75,3 +75,14 @@ exitdir 1 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,17,0,4, 4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4, layer2 +25,16,94,layer3 +26,16,94,layer3 +27,16,94,layer3 +28,16,94,layer3 +29,16,94,layer3 +30,16,94,layer3 +31,16,94,layer3 +5,24,94,layer3 +6,24,94,layer3 +7,24,94,layer3 +8,24,94,layer3 diff --git a/data/levels/level113.dat b/data/levels/level113.dat index e2673d0..3216480 100644 --- a/data/levels/level113.dat +++ b/data/levels/level113.dat @@ -79,3 +79,8 @@ exitdir 2 44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44, layer2 20,9,8 +18,12,94,layer3 +19,12,94,layer3 +20,12,94,layer3 +21,12,94,layer3 +22,12,94,layer3 diff --git a/data/levels/level117.dat b/data/levels/level117.dat index db5d46e..03b55c2 100644 --- a/data/levels/level117.dat +++ b/data/levels/level117.dat @@ -213,6 +213,12 @@ layer2 27,17,50 39,17,44 0,18,44 +19,18,94,layer3 +20,18,94,layer3 +21,18,94,layer3 +22,18,94,layer3 +23,18,94,layer3 +24,18,94,layer3 28,18,50 34,18,20 35,18,20 diff --git a/data/levels/level14.dat b/data/levels/level14.dat index 259cc62..fb50397 100644 --- a/data/levels/level14.dat +++ b/data/levels/level14.dat @@ -73,3 +73,10 @@ exitdir 2 layer2 15,20,22 25,20,22 +17,28,94,layer3 +18,28,94,layer3 +19,28,94,layer3 +20,28,94,layer3 +21,28,94,layer3 +22,28,94,layer3 +23,28,94,layer3 diff --git a/data/levels/level2.dat b/data/levels/level2.dat index 881e146..563a16a 100644 --- a/data/levels/level2.dat +++ b/data/levels/level2.dat @@ -56,6 +56,8 @@ exitdir 1 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, layer2 4,3,30 +13,3,94,layer3 +14,3,94,layer3 5,5,8 24,5,8 4,6,42 diff --git a/data/levels/level22.dat b/data/levels/level22.dat index 02f1eb7..32440b7 100644 --- a/data/levels/level22.dat +++ b/data/levels/level22.dat @@ -76,4 +76,20 @@ exitdir 2 44,0,0,44,44,44,44,44,44,44,44,44,44,44,44,44,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44, 44,0,0,44,44,44,44,44,44,44,44,44,44,44,44,44,0,0,0,0,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,0,0,0,44, layer2 +29,8,94,layer3 +30,8,94,layer3 +31,8,94,layer3 +32,8,94,layer3 +33,8,94,layer3 +34,8,94,layer3 10,11,8 +35,11,94,layer3 +36,11,94,layer3 +37,11,94,layer3 +38,11,94,layer3 +17,18,94,layer3 +18,18,94,layer3 +19,18,94,layer3 +20,18,94,layer3 +21,18,94,layer3 +22,18,94,layer3 diff --git a/data/levels/level3.dat b/data/levels/level3.dat index 2a51b33..c6aaf4a 100644 --- a/data/levels/level3.dat +++ b/data/levels/level3.dat @@ -65,3 +65,9 @@ exitdir 1 39,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,38, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, layer2 +3,27,94,layer3 +4,27,94,layer3 +5,27,94,layer3 +32,27,94,layer3 +33,27,94,layer3 +34,27,94,layer3 diff --git a/data/levels/level4.dat b/data/levels/level4.dat index 3fc070a..6bf5258 100644 --- a/data/levels/level4.dat +++ b/data/levels/level4.dat @@ -7,7 +7,7 @@ endhelp monsters 0 18 8 134 23 8 -23 20 8 +23 16 8 1 10 4 1 11 12 1 33 12 diff --git a/data/levels/level403.dat b/data/levels/level403.dat index 7b5ce58..f1935aa 100644 --- a/data/levels/level403.dat +++ b/data/levels/level403.dat @@ -17,7 +17,7 @@ monsters 1 34 16 1 27 28 1 32 20 -132 30 13 488 224 488 224 488 224 488 224 488 472 +132 30 13 488 224 488 224 488 224 488 224 488 224 488 472 endmonsters exitdir -1 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,0,0,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, @@ -53,3 +53,18 @@ exitdir -1 layer2 8,8,8 20,8,8 +34,10,95,layer3 +35,10,95,layer3 +36,10,95,layer3 +37,10,95,layer3 +38,10,95,layer3 +34,11,95,layer3 +35,11,95,layer3 +36,11,95,layer3 +37,11,95,layer3 +38,11,95,layer3 +34,12,95,layer3 +35,12,95,layer3 +36,12,95,layer3 +37,12,95,layer3 +38,12,95,layer3 diff --git a/data/levels/level414.dat b/data/levels/level414.dat index 56e5b9f..1ec5b10 100644 --- a/data/levels/level414.dat +++ b/data/levels/level414.dat @@ -73,3 +73,19 @@ exitdir -1 57,0,0,0,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, layer2 39,0,57 +12,1,95,layer3 +13,1,95,layer3 +14,1,95,layer3 +15,1,95,layer3 +23,1,95,layer3 +24,1,95,layer3 +25,1,95,layer3 +26,1,95,layer3 +12,2,95,layer3 +13,2,95,layer3 +14,2,95,layer3 +15,2,95,layer3 +23,2,95,layer3 +24,2,95,layer3 +25,2,95,layer3 +26,2,95,layer3 diff --git a/data/levels/level419.dat b/data/levels/level419.dat index 3e945f5..6410068 100644 --- a/data/levels/level419.dat +++ b/data/levels/level419.dat @@ -103,3 +103,33 @@ layer2 28,22,7 12,23,7 12,24,7 +5,26,95,layer3 +6,26,95,layer3 +7,26,95,layer3 +8,26,95,layer3 +9,26,95,layer3 +30,26,95,layer3 +31,26,95,layer3 +32,26,95,layer3 +33,26,95,layer3 +34,26,95,layer3 +5,27,95,layer3 +6,27,95,layer3 +7,27,95,layer3 +8,27,95,layer3 +9,27,95,layer3 +30,27,95,layer3 +31,27,95,layer3 +32,27,95,layer3 +33,27,95,layer3 +34,27,95,layer3 +5,28,95,layer3 +6,28,95,layer3 +7,28,95,layer3 +8,28,95,layer3 +9,28,95,layer3 +30,28,95,layer3 +31,28,95,layer3 +32,28,95,layer3 +33,28,95,layer3 +34,28,95,layer3 diff --git a/data/levels/level420.dat b/data/levels/level420.dat index 4b00622..585313a 100644 --- a/data/levels/level420.dat +++ b/data/levels/level420.dat @@ -12,7 +12,7 @@ monsters 133 33 14 60 21 14 49 27 19 -132 37 24 600 400 600 400 340 400 +132 37 24 600 400 600 400 600 400 340 400 18 12 22 17 21 19 17 32 19 @@ -65,3 +65,19 @@ exitdir -1 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, layer2 4,7,8 +35,17,95,layer3 +36,17,95,layer3 +37,17,95,layer3 +38,17,95,layer3 +35,18,95,layer3 +36,18,95,layer3 +37,18,95,layer3 +38,18,95,layer3 +35,19,95,layer3 +36,19,95,layer3 +37,19,95,layer3 +38,19,95,layer3 +35,20,95,layer3 +36,20,95,layer3 +37,20,95,layer3 +38,20,95,layer3 diff --git a/data/levels/level422.dat b/data/levels/level422.dat index 676544d..5d5b0d9 100644 --- a/data/levels/level422.dat +++ b/data/levels/level422.dat @@ -65,3 +65,90 @@ exitdir -1 61,85,85,85,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, 64,61,61,61,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, layer2 +13,6,95,layer3 +14,6,95,layer3 +15,6,95,layer3 +16,6,95,layer3 +17,6,95,layer3 +13,7,95,layer3 +14,7,95,layer3 +15,7,95,layer3 +16,7,95,layer3 +17,7,95,layer3 +22,7,95,layer3 +23,7,95,layer3 +24,7,95,layer3 +25,7,95,layer3 +26,7,95,layer3 +13,8,95,layer3 +14,8,95,layer3 +15,8,95,layer3 +16,8,95,layer3 +17,8,95,layer3 +22,8,95,layer3 +23,8,95,layer3 +24,8,95,layer3 +25,8,95,layer3 +26,8,95,layer3 +22,9,95,layer3 +23,9,95,layer3 +24,9,95,layer3 +25,9,95,layer3 +26,9,95,layer3 +6,14,95,layer3 +7,14,95,layer3 +8,14,95,layer3 +6,15,95,layer3 +7,15,95,layer3 +8,15,95,layer3 +6,16,95,layer3 +7,16,95,layer3 +8,16,95,layer3 +26,16,95,layer3 +27,16,95,layer3 +28,16,95,layer3 +26,17,95,layer3 +27,17,95,layer3 +28,17,95,layer3 +26,18,95,layer3 +27,18,95,layer3 +28,18,95,layer3 +33,23,95,layer3 +34,23,95,layer3 +35,23,95,layer3 +15,24,95,layer3 +16,24,95,layer3 +17,24,95,layer3 +18,24,95,layer3 +19,24,95,layer3 +20,24,95,layer3 +21,24,95,layer3 +33,24,95,layer3 +34,24,95,layer3 +35,24,95,layer3 +15,25,95,layer3 +16,25,95,layer3 +17,25,95,layer3 +18,25,95,layer3 +19,25,95,layer3 +20,25,95,layer3 +21,25,95,layer3 +33,25,95,layer3 +34,25,95,layer3 +35,25,95,layer3 +1,26,95,layer3 +2,26,95,layer3 +3,26,95,layer3 +15,26,95,layer3 +16,26,95,layer3 +17,26,95,layer3 +18,26,95,layer3 +19,26,95,layer3 +20,26,95,layer3 +21,26,95,layer3 +1,27,95,layer3 +2,27,95,layer3 +3,27,95,layer3 +1,28,95,layer3 +2,28,95,layer3 +3,28,95,layer3 diff --git a/data/levels/level5.5.dat b/data/levels/level5.5.dat index 752c4de..36aa447 100644 --- a/data/levels/level5.5.dat +++ b/data/levels/level5.5.dat @@ -62,6 +62,12 @@ exitdir 1 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, layer2 +17,6,94,layer3 +18,6,94,layer3 +19,6,94,layer3 +20,6,94,layer3 +21,6,94,layer3 +22,6,94,layer3 1,10,8 38,10,8 15,28,11 diff --git a/data/levels/level7.5.dat b/data/levels/level7.5.dat index 4a4ca3b..e529b3d 100644 --- a/data/levels/level7.5.dat +++ b/data/levels/level7.5.dat @@ -63,7 +63,7 @@ exitdir 1 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, -39,1,1,1,1,1,1,1,1,1,1,1,34,23,23,23,23,23,23,23,23,23,23,23,23,23,23,35,1,1,1,1,1,1,1,1,1,1,1,38, +39,1,1,1,1,1,1,1,1,1,1,1,34,28,28,28,28,28,28,28,28,28,28,28,28,28,28,35,1,1,1,1,1,1,1,1,1,1,1,38, 4,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,4, 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, @@ -80,3 +80,19 @@ exitdir 1 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, 39,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,38, layer2 +12,13,94,layer3 +13,13,94,layer3 +14,13,94,layer3 +15,13,94,layer3 +16,13,94,layer3 +17,13,94,layer3 +18,13,94,layer3 +19,13,94,layer3 +20,13,94,layer3 +21,13,94,layer3 +22,13,94,layer3 +23,13,94,layer3 +24,13,94,layer3 +25,13,94,layer3 +26,13,94,layer3 +27,13,94,layer3 diff --git a/data/levels/level8.5.dat b/data/levels/level8.5.dat index 34d25c8..f6230d5 100644 --- a/data/levels/level8.5.dat +++ b/data/levels/level8.5.dat @@ -46,3 +46,11 @@ exitdir 2 44,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,44, 44,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,44, layer2 +1,20,94,layer3 +2,20,94,layer3 +37,20,94,layer3 +38,20,94,layer3 +1,23,94,layer3 +2,23,94,layer3 +37,23,94,layer3 +38,23,94,layer3 diff --git a/data/levels/level8.dat b/data/levels/level8.dat index 485f8b6..b615269 100644 --- a/data/levels/level8.dat +++ b/data/levels/level8.dat @@ -80,6 +80,11 @@ exitdir 1 layer2 4,6,8 35,6,8 +18,15,94,layer3 +19,15,94,layer3 +20,15,94,layer3 +21,15,94,layer3 +22,15,94,layer3 10,20,41 29,20,41 10,21,42 diff --git a/data/levels/level9.dat b/data/levels/level9.dat index 4c89210..c280a34 100644 --- a/data/levels/level9.dat +++ b/data/levels/level9.dat @@ -84,6 +84,27 @@ exitdir 1 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, layer2 37,15,8 +9,18,94,layer3 +10,18,94,layer3 +11,18,94,layer3 +12,18,94,layer3 +13,18,94,layer3 +14,18,94,layer3 +15,18,94,layer3 +16,18,94,layer3 +17,18,94,layer3 +18,18,94,layer3 +19,18,94,layer3 +20,18,94,layer3 +21,18,94,layer3 +22,18,94,layer3 +23,18,94,layer3 +24,18,94,layer3 +25,18,94,layer3 +26,18,94,layer3 +27,18,94,layer3 +28,18,94,layer3 +29,18,94,layer3 10,19,28 11,19,28 12,19,28 diff --git a/data/levels/level99.dat b/data/levels/level99.dat index ab62c44..08d404c 100644 --- a/data/levels/level99.dat +++ b/data/levels/level99.dat @@ -59,3 +59,14 @@ exitdir 1 4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4, layer2 +28,13,94,layer3 +29,13,94,layer3 +30,13,94,layer3 +31,13,94,layer3 +32,13,94,layer3 +33,13,94,layer3 +34,13,94,layer3 +35,13,94,layer3 +36,13,94,layer3 +37,13,94,layer3 +38,13,94,layer3 diff --git a/data/newtiles/bars.png b/data/newtiles/bars.png new file mode 100644 index 0000000000000000000000000000000000000000..ec72e30d02894f1825c7733e1df1d77275491e54 GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE>3?l%LH*)|003CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00E9kL_t(I%YBluY8){T zhCl5FEd*3u<*mdmIBxE$bDviT+!Oc#T)6RD82ke619=OBtE+4X+`<`Ey6PaHY8S$| z(5|%S4Vgy6e41Y){Zb6^bXT&dV}A0anASe?n}@#?WAp!FDmaa&yD|!dKd^s}MfW@B z0O6GR%g;G40Q?&O5>AMJLq@oN2D8W<=3D{XUzf3HfRMx$K)r%#(w=ksXe=AKI0P>IpVRD8-YL>JPC9&A0V<{!@2 z(dxtvd}%|44jr~W-`j>N<(G9AoBY{7L5B|2EF0GPD4K5e({{ZDU~8RxeuvQ=1<))T s*=U!n`gO92t@RO2C&@-KKfE9K0J%B9AM1HRwg3PC07*qoM6N<$f)^+AKmY&$ literal 0 HcmV?d00001 diff --git a/data/tiledefs.dat b/data/tiledefs.dat index ee5fcc3..8e8b2fe 100644 --- a/data/tiledefs.dat +++ b/data/tiledefs.dat @@ -607,3 +607,15 @@ id 1 solid 1 file newtiles/brownrocksw.png end + +tile fence +id 5 +solid 0 +file newtiles/fence.png +end + +tile bars +id 5 +solid 0 +file newtiles/bars.png +end diff --git a/defs.h b/defs.h index ccc57e5..28e49d7 100644 --- a/defs.h +++ b/defs.h @@ -844,8 +844,10 @@ typedef struct level_s { char filename[BUFLEN]; int map[LEVELW*LEVELH]; int map2[LEVELW*LEVELH]; // second map layer + int map3[LEVELW*LEVELH]; // third map layer int tileframe[LEVELW*LEVELH]; // tracks frame numbers for tiles int *animtiles; // array of offsets to map positions which are animated + int *l3tiles; // array of layer 3 tiles struct level_s *next; struct level_s *prev; int bottomopen; // can you fall through the bottom of the level? diff --git a/edit.c b/edit.c index 88e1427..6933151 100644 --- a/edit.c +++ b/edit.c @@ -315,19 +315,15 @@ int main (int argc, char **argv) { if (layer == 1) { curlevel->map[y*LEVELW+x] = seltile->uniqid; curlevel->tileframe[y*LEVELW+x] = 0; + } else if (layer == 2) { + curlevel->map2[y*LEVELW+x] = seltile->uniqid; } else { - // if there's nothing at layer1, it goes there - //if (curlevel->map[y*LEVELW+x] == T_BLANK) { - // printf("falling to layer 1\n"); - // curlevel->map[y*LEVELW+x] = seltile->uniqid; - // curlevel->tileframe[y*LEVELW+x] = 0; - //} else { - curlevel->map2[y*LEVELW+x] = seltile->uniqid; - //} + curlevel->map3[y*LEVELW+x] = seltile->uniqid; } // redraw tile and sprites draweditortile(screen,x,y); drawsprites(); + draweditortile3(screen,x,y); setmod(B_TRUE); setstatustext("", &white); @@ -477,9 +473,29 @@ int main (int argc, char **argv) { if (state == LS_EDIT) { - if (keys[SDLK_1] || keys[SDLK_2]) { // toggle layer + if (keys[SDLK_1] ) { // change layer if (toggletimer == 0) { - layer = 3 - layer; + layer = 1; + draweditorlevel(); + drawsprites(); + sprintf(tempm, "Now editting layer %d",layer); + setstatustext(tempm, &green); + toggletimer = 30; + } + } + if (keys[SDLK_2] ) { // change layer + if (toggletimer == 0) { + layer = 2; + draweditorlevel(); + drawsprites(); + sprintf(tempm, "Now editting layer %d",layer); + setstatustext(tempm, &green); + toggletimer = 30; + } + } + if (keys[SDLK_3] ) { // change layer + if (toggletimer == 0) { + layer = 3; draweditorlevel(); drawsprites(); sprintf(tempm, "Now editting layer %d",layer); @@ -840,6 +856,7 @@ void draweditorlevel(void) { for (x = 0; x < LEVELW; x++) { for (y = 0; y < LEVELH; y++) { draweditortile(screen,x,y); + draweditortile3(screen,x,y); } } @@ -848,6 +865,15 @@ void draweditorlevel(void) { SDL_UpdateRect(screen, 0, 0, EDITORW, EDITORH); } +void drawl3(void) { + int x,y; + + for (x = 0; x < LEVELW; x++) { + for (y = 0; y < LEVELH; y++) { + draweditortile3(screen,x,y); + } + } +} @@ -875,6 +901,7 @@ void drawsprites(void) { } //} } + drawl3(); } @@ -1064,6 +1091,10 @@ int savelevel(int lnum) { // x,y,tileid fprintf(f, "%d,%d,%d\n",x,y,level->map2[y*LEVELW+x]); } + if (level->map3[y*LEVELW+x] != T_BLANK) { + // x,y,tileid + fprintf(f, "%d,%d,%d,layer3\n",x,y,level->map3[y*LEVELW+x]); + } } } @@ -1087,7 +1118,9 @@ void filllevel(void) { offset = y*LEVELW+x; curlevel->map[offset] = seltile->uniqid; curlevel->map2[offset] = T_BLANK; + curlevel->map3[offset] = T_BLANK; draweditortile(screen,x,y); + draweditortile3(screen,x,y); } } } @@ -1121,8 +1154,10 @@ void clearlevel(void) { curlevel->map[offset] = T_BLANK; } curlevel->map2[offset] = T_BLANK; + curlevel->map3[offset] = T_BLANK; curlevel->tileframe[offset] = 0; draweditortile(screen,x,y); + draweditortile3(screen,x,y); } } @@ -1231,6 +1266,37 @@ void draweditortile(SDL_Surface *where, int x, int y) { } +// like drawtile but adjusts transparncy based on current layer and draws l3 only +void draweditortile3(SDL_Surface *where, int x, int y) { + SDL_Rect area; + tiletype_t *tt; + int offset; + + + if ((x < 0) || (y < 0) || (x >= LEVELW) || (y >= LEVELH)) { + return; + } + + area.x = x * TILEW; + area.y = y * TILEH; + area.w = TILEW; + area.h = TILEH; + + /* figure out what the layer3 tile is */ + /* draw layer3 if it exists */ + offset = y*LEVELW+x; + + if (curlevel->map3[offset] != T_BLANK) { + tt = gettile(curlevel->map3[offset]); + if (tt->id != curlevel->bgtileid) { + SDL_BlitSurface(tt->img[0], NULL, where, &area); + drawtilehint(where, tt, area.x, area.y); + } + } + +} + + /* draw hints on some more obscure tiles */ void drawtilehint(SDL_Surface *where, tiletype_t *tt, double x, double y) { if (tt->id == T_WATERRIGHT) { diff --git a/edit.h b/edit.h index 609f4a1..18b959e 100644 --- a/edit.h +++ b/edit.h @@ -42,7 +42,9 @@ // Editor specific functions void draweditorlevel(void); +void drawl3(void); void draweditortile(SDL_Surface *where, int x, int y); +void draweditortile3(SDL_Surface *where, int x, int y); void drawtilehint(SDL_Surface *where, tiletype_t *tt, double x, double y); void drawpalette(void); void drawsprites(void); diff --git a/rc.c b/rc.c index 6217d90..736aa47 100644 --- a/rc.c +++ b/rc.c @@ -195,7 +195,7 @@ int main (int argc, char **argv) { //sprite_t *s,*nextsprite; char filename[BUFLEN]; int i; - int *animtile; + int *animtile,*l3tile; levelbg = NULL; @@ -773,6 +773,21 @@ int main (int argc, char **argv) { drawallsprites(); } + /// draw layer 3 tiles + // for each layer 3 tile on the level... + for (l3tile = curlevel->l3tiles; l3tile && *l3tile != -1; l3tile++) { + int offset; + tiletype_t *tt; + + offset = *l3tile; + + tt = gettile(curlevel->map3[offset]); + + // redraw it + drawl3tile(screen, offset%LEVELW,offset/LEVELW); + + } + // warning for cloud if (!isbosslevel(curlevelnum)) { diff --git a/shared.c b/shared.c index 95ecc0a..0509d95 100644 --- a/shared.c +++ b/shared.c @@ -39,9 +39,11 @@ int loadlevel(int lnum, int wantmonsters) { //int nmappings = 0; //tiletype_t *lasttile; int newversion; - int numanim = 0; int leveldone; + int numanim = 0; int tempanim[LEVELW*LEVELH]; + int numl3 = 0; + int templ3[LEVELW*LEVELH]; sprite_t *ss, *nextss; @@ -77,6 +79,7 @@ int loadlevel(int lnum, int wantmonsters) { if (!level) { level = malloc(sizeof(level_t)); level->animtiles = NULL; + level->l3tiles = NULL; } sprintf(level->filename, levelentry[lnum].filename); @@ -85,6 +88,7 @@ int loadlevel(int lnum, int wantmonsters) { curlevel = level; if (level->animtiles) free(level->animtiles); + if (level->l3tiles) free(level->l3tiles); level->id = levelentry[lnum].id; sprintf(level->name, "%s",levelentry[lnum].desc); @@ -479,10 +483,11 @@ int loadlevel(int lnum, int wantmonsters) { } } - // clear out layer2 by default + // clear out layer2 and layer3 by default for (xx = 0; xx < LEVELW; xx++) { for (yy = 0; yy < LEVELH; yy++) { level->map2[yy*LEVELW+xx] = T_BLANK; + level->map3[yy*LEVELW+xx] = T_BLANK; } } @@ -496,17 +501,38 @@ int loadlevel(int lnum, int wantmonsters) { p = strtok(buf, ","); xx = atoi(p); p = strtok(NULL, ","); yy = atoi(p); p = strtok(NULL, ","); tid = atoi(p); - - level->map2[yy*LEVELW+xx] = tid; + p = strtok(NULL, ","); + if (p == NULL) { // no more data + level->map2[yy*LEVELW+xx] = tid; + } else { // more data! this means use layer 3 + level->map3[yy*LEVELW+xx] = tid; + } fgets(buf, BUFLEN, f); + } } fclose(f); + /// fill in array of l3 tiles for speed + numl3 = 0; + for (xx = 0; xx < LEVELW; xx++) { + for (yy = 0; yy < LEVELH; yy++) { + if (level->map3[yy*LEVELW+xx] != T_BLANK) { + templ3[numl3] = yy*LEVELW+xx; + numl3++; + } + } + } - // copy from our temp buffer into the real one + // copy from our temp layer 3 buffer into the real one + level->l3tiles = malloc(sizeof(int) * (numl3+1)); + memcpy(level->l3tiles,templ3,numl3*sizeof(int)); + level->l3tiles[numl3] = -1; + + + // copy from our temp animation buffer into the real one level->animtiles = malloc(sizeof(int) * (numanim+1)); memcpy(level->animtiles,tempanim,numanim*sizeof(int)); level->animtiles[numanim] = -1; @@ -3052,6 +3078,31 @@ void drawtile(SDL_Surface *where, int x, int y) { } + +void drawl3tile(SDL_Surface *where, int x, int y) { + SDL_Rect area; + tiletype_t *tt; + int offset; + + if ((x < 0) || (y < 0) || (x >= LEVELW) || (y >= LEVELH)) { + return; + } + + area.x = x * TILEW; + area.y = y * TILEH; + area.w = TILEW; + area.h = TILEH; + /* draw layer3 if it exists */ + offset = y*LEVELW+x; + if (curlevel->map3[offset] != T_BLANK) { + tt = gettile(curlevel->map3[offset]); + if (tt->id != curlevel->bgtileid) { + SDL_BlitSurface(tt->img[0], NULL, where, &area); + } + + } + +} void initglobals(void) { sprite = NULL; diff --git a/shared.h b/shared.h index 2966236..14a2a5a 100644 --- a/shared.h +++ b/shared.h @@ -37,6 +37,7 @@ char monstertochar(int id); tiletype_t *gettile(int uniqid); int getuniq(int tileid); void drawtile(SDL_Surface *s, int x, int y); +void drawl3tile(SDL_Surface *s, int x, int y); void initglobals(void); void killtext(text_t *t); int ismonster(int id);