From 3cb643c9cbb1bc34297a3a643f0c9a4d4fc0e98d Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 2 Jul 2012 16:38:30 +0000 Subject: BLOCKTYPE and NIBBLETYPE are finally exported in Lua API as numbers, not usertypes git-svn-id: http://mc-server.googlecode.com/svn/trunk@642 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/AllToLua.pkg | 17 +---------------- source/Bindings.cpp | 30 +++++++++++++++++++++++++++++- source/Bindings.h | 2 +- source/ChunkDef.h | 9 +++++---- 4 files changed, 36 insertions(+), 22 deletions(-) (limited to 'source') diff --git a/source/AllToLua.pkg b/source/AllToLua.pkg index c8d2b6384..b6ee64579 100644 --- a/source/AllToLua.pkg +++ b/source/AllToLua.pkg @@ -3,22 +3,7 @@ $#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same acr $#include "tolua_base.h" - - - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// NOTE: when changing the BLOCKTYPE or NIBBLETYPE types, you need to change them both in this file and in ChunkDef.h -// (for some reason, just including the ChunkDef.h file doesn't work in ToLua) - -typedef char BLOCKTYPE; -typedef unsigned char NIBBLETYPE; - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - - +$cfile "ChunkDef.h" $cfile "cTorch.h" $cfile "cStairs.h" diff --git a/source/Bindings.cpp b/source/Bindings.cpp index 81db4a447..485f37dc0 100644 --- a/source/Bindings.cpp +++ b/source/Bindings.cpp @@ -1,6 +1,6 @@ /* ** Lua binding: AllToLua -** Generated automatically by tolua++-1.0.92 on 07/02/12 18:28:58. +** Generated automatically by tolua++-1.0.92 on 07/02/12 18:39:13. */ #ifndef __cplusplus @@ -15,6 +15,7 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S); #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "tolua_base.h" +#include "ChunkDef.h" #include "cTorch.h" #include "cStairs.h" #include "cStep.h" @@ -21117,6 +21118,33 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_reg_types(tolua_S); tolua_module(tolua_S,NULL,1); tolua_beginmodule(tolua_S,NULL); + tolua_constant(tolua_S,"biOcean",biOcean); + tolua_constant(tolua_S,"biPlains",biPlains); + tolua_constant(tolua_S,"biDesert",biDesert); + tolua_constant(tolua_S,"biExtremeHills",biExtremeHills); + tolua_constant(tolua_S,"biForest",biForest); + tolua_constant(tolua_S,"biTaiga",biTaiga); + tolua_constant(tolua_S,"biSwampland",biSwampland); + tolua_constant(tolua_S,"biRiver",biRiver); + tolua_constant(tolua_S,"biHell",biHell); + tolua_constant(tolua_S,"biNether",biNether); + tolua_constant(tolua_S,"biSky",biSky); + tolua_constant(tolua_S,"biFrozenOcean",biFrozenOcean); + tolua_constant(tolua_S,"biFrozenRiver",biFrozenRiver); + tolua_constant(tolua_S,"biIcePlains",biIcePlains); + tolua_constant(tolua_S,"biTundra",biTundra); + tolua_constant(tolua_S,"biIceMountains",biIceMountains); + tolua_constant(tolua_S,"biMushroomIsland",biMushroomIsland); + tolua_constant(tolua_S,"biMushroomShore",biMushroomShore); + tolua_constant(tolua_S,"biBeach",biBeach); + tolua_constant(tolua_S,"biDesertHills",biDesertHills); + tolua_constant(tolua_S,"biForestHills",biForestHills); + tolua_constant(tolua_S,"biTaigaHills",biTaigaHills); + tolua_constant(tolua_S,"biExtremeHillsEdge",biExtremeHillsEdge); + tolua_constant(tolua_S,"biJungle",biJungle); + tolua_constant(tolua_S,"biJungleHills",biJungleHills); + tolua_constant(tolua_S,"biNumBiomes",biNumBiomes); + tolua_constant(tolua_S,"biMaxBiome",biMaxBiome); tolua_cclass(tolua_S,"cTorch","cTorch","",NULL); tolua_beginmodule(tolua_S,"cTorch"); tolua_function(tolua_S,"DirectionToMetaData",tolua_AllToLua_cTorch_DirectionToMetaData00); diff --git a/source/Bindings.h b/source/Bindings.h index aa87406e5..a47b5e463 100644 --- a/source/Bindings.h +++ b/source/Bindings.h @@ -1,6 +1,6 @@ /* ** Lua binding: AllToLua -** Generated automatically by tolua++-1.0.92 on 07/02/12 18:28:58. +** Generated automatically by tolua++-1.0.92 on 07/02/12 18:39:13. */ /* Exported function */ diff --git a/source/ChunkDef.h b/source/ChunkDef.h index a9a10335c..af96c52b7 100644 --- a/source/ChunkDef.h +++ b/source/ChunkDef.h @@ -41,9 +41,7 @@ typedef std::list cBlockEntityList; -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// NOTE: when changing the BLOCKTYPE or NIBBLETYPE types, you need to change them both in this file and in AllToLua.pkg -// (for some reason, just including the ChunkDef.h file in AllToLua.pkg doesn't work in ToLua) +// tolua_begin /// The datatype used by blockdata typedef char BLOCKTYPE; @@ -54,12 +52,14 @@ typedef unsigned char NIBBLETYPE; /// The type used by the heightmap typedef unsigned char HEIGHTTYPE; -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// tolua_end + +// tolua_begin /** Biome IDs The first batch corresponds to the clientside biomes, used by MineCraft. BiomeIDs over 255 are used by MCServer internally and are translated to MC biomes before sending them to client @@ -97,6 +97,7 @@ enum EMCSBiome biMaxBiome = biNumBiomes - 1, // The maximum biome value } ; +// tolua_end -- cgit v1.2.3