games/digger: Use voxelworld's voxel/atlas_reg for custom node

This commit is contained in:
Perttu Ahola 2014-10-19 18:46:42 +03:00
parent fea7208fa0
commit 17b09fabdb
2 changed files with 11 additions and 4 deletions

View File

@ -302,6 +302,14 @@ function M.set_camera(new_camera_node)
camera_node = new_camera_node
end
function M.get_voxel_registry()
return voxel_reg
end
function M.get_atlas_registry()
return atlas_reg
end
function send_get_section(p)
local data = cereal.binary_output({
p = {

View File

@ -217,11 +217,10 @@ magic.SubscribeToEvent("PhysicsCollision", function(event_type, event_data)
end
end)
-- TODO: Fill in some stuff to the voxel registry
local voxel_reg = buildat.createVoxelRegistry()
local atlas_reg = buildat.createAtlasRegistry()
function setup_simple_voxel_data(node)
local voxel_reg = voxelworld.get_voxel_registry()
local atlas_reg = voxelworld.get_atlas_registry()
local data = node:GetVar("simple_voxel_data"):GetBuffer()
local w = node:GetVar("simple_voxel_w"):GetInt()
local h = node:GetVar("simple_voxel_h"):GetInt()