games/digger: Add and update textures: dirt.png, rock.png, tree.png, tree_top.png

This commit is contained in:
Perttu Ahola 2014-10-21 13:52:09 +03:00
parent 4c8d3eed2c
commit 73855c556d
8 changed files with 33 additions and 1 deletions

View File

@ -63,3 +63,5 @@ Buildat TODO
- Rename VoxelInstance::getId() to VoxelInstance::get_id()
- A way of figuring out which voxel is being pointed at
- Get rid of the dual module reload when saving a C++ file in Vim
- If a file tracked by client_data is deleted and re-added, it won't get updated
before server restart(?)

View File

@ -5,5 +5,9 @@ When not specified separately:
main/client_data/grass.png
main/client_data/leaves.png
main/client_data/dirt.png
main/client_data/tree.png
main/client_data/tree_top.png
main/client_data/rock.png
- CC BY-SA 3.0 2013 PilzAdam <pilzadam@minetest.net>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 B

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 B

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

View File

@ -232,6 +232,11 @@ end)
magic.SubscribeToEvent("Update", function(event_type, event_data)
--log:info("Update")
if player_node then
-- If falling out of world, restore onto world
if player_node.position.y < -500 then
player_node.position = magic.Vector3(0, 500, 0)
end
local dmouse = magic.input:GetMouseMove()
--log:info("dmouse: ("..dmouse.x..", "..dmouse.y..")")
camera_node:Pitch(dmouse.y * 0.1)

View File

@ -194,6 +194,27 @@ struct Module: public interface::Module
vdef.physically_solid = true;
voxel_reg->add_voxel(vdef); // id 5
}
{
interface::VoxelDefinition vdef;
vdef.name.block_name = "tree";
vdef.name.segment_x = 0;
vdef.name.segment_y = 0;
vdef.name.segment_z = 0;
vdef.name.rotation_primary = 0;
vdef.name.rotation_secondary = 0;
vdef.handler_module = "";
for(size_t i = 0; i < 6; i++){
interface::AtlasSegmentDefinition &seg = vdef.textures[i];
seg.resource_name = "main/tree.png";
seg.total_segments = magic::IntVector2(1, 1);
seg.select_segment = magic::IntVector2(0, 0);
}
vdef.textures[0].resource_name = "main/tree_top.png";
vdef.textures[1].resource_name = "main/tree_top.png";
vdef.edge_material_id = interface::EDGEMATERIALID_GROUND;
vdef.physically_solid = true;
voxel_reg->add_voxel(vdef); // id 6
}
});
m_server->access_scene([&](Scene *scene)
@ -376,7 +397,7 @@ struct Module: public interface::Module
for(int y1 = y; y1<y+4; y1++){
pv::Vector3DInt32 p(x, y1, z);
ivoxelworld->set_voxel(p, VoxelInstance(3), true);
ivoxelworld->set_voxel(p, VoxelInstance(6), true);
}
for(int x1 = x-2; x1 <= x+2; x1++){