From c6fd2986d4261cf742d3bc21e8c12be59ab89f95 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 14 Nov 2011 21:41:30 +0200 Subject: GameDef compiles --- src/test.cpp | 106 ++++++++++++++--------------------------------------------- 1 file changed, 25 insertions(+), 81 deletions(-) (limited to 'src/test.cpp') diff --git a/src/test.cpp b/src/test.cpp index 37412d179..e1242ccb3 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -31,6 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include "porting.h" #include "content_mapnode.h" +#include "nodedef.h" #include "mapsector.h" #include "settings.h" #include "log.h" @@ -216,26 +217,26 @@ struct TestCompress struct TestMapNode { - void Run() + void Run(INodeDefManager *nodedef) { MapNode n; // Default values assert(n.getContent() == CONTENT_AIR); - assert(n.getLight(LIGHTBANK_DAY) == 0); - assert(n.getLight(LIGHTBANK_NIGHT) == 0); + assert(n.getLight(LIGHTBANK_DAY, nodedef) == 0); + assert(n.getLight(LIGHTBANK_NIGHT, nodedef) == 0); // Transparency n.setContent(CONTENT_AIR); - assert(n.light_propagates() == true); + assert(nodedef->get(n).light_propagates == true); n.setContent(CONTENT_STONE); - assert(n.light_propagates() == false); + assert(nodedef->get(n).light_propagates == false); } }; struct TestVoxelManipulator { - void Run() + void Run(INodeDefManager *nodedef) { /* VoxelArea @@ -278,13 +279,13 @@ struct TestVoxelManipulator VoxelManipulator v; - v.print(infostream); + v.print(infostream, nodedef); infostream<<"*** Setting (-1,0,-1)=2 ***"<=0; y--) - for(s16 x=0; x active_nodes; - v.updateAreaWaterPressure(area, active_nodes); - - v.print(infostream, VOXELPRINT_WATERPRESSURE); - - //s16 highest_y = -32768; - /* - NOTE: These are commented out because this behaviour is changed - all the time - */ - //assert(v.getWaterPressure(v3s16(7, 1, 1), highest_y, 0) == -1); - //assert(highest_y == 3); - /*assert(v.getWaterPressure(v3s16(7, 1, 1), highest_y, 0) == 3); - //assert(highest_y == 3);*/ - - active_nodes.clear(); - active_nodes[v3s16(9,1,0)] = 1; - //v.flowWater(active_nodes, 0, true, 1000); - v.flowWater(active_nodes, 0, false, 1000); - - infostream<<"Final result of flowWater:"<