Closed satoshinm closed 7 years ago
There is already code to write "signs" = text on any block face, reusing it the block completion percentage is visible:
but this really ought to be a custom break animation texture, not text.
Perhaps easier, what about basing it on the wireframe code (draws around the targeted block), but change to render textured faces, the textures being the block break animation?
Rendering a textured cube over the mining target block works well, added what I call render_cover()
(since it covers the block) to do this, now the only complication is getting the right block break textures and ensuring they are transparent so the original block texture underneath shows through.
gen_cube_buffer() takes w, the block type, passes to make_cube in cube.c, this indexes into item.c blocks[][]
which is an array of arrays of texture indices per block. The faces are in a different order than I expected, see https://github.com/satoshinm/NetCraft/issues/116 - but won't matter for block break animation since all the faces could be the same. Call make_cube_faces with given texture indices instead of make_cube?
Now all that's left to do is the ten block break textures. But Paintbrush rewrites the magenta background somehow:
looks the same, but after resaving without changing anything, Craft doesn't recognize it as the magenta it uses for transparent:
need a better image editor. Preview doesn't mangle the colors, but it also has limited editing abilities.
https://github.com/satoshinm/NetCraft/issues/106