Sets draw type and updates related state (e.g. FullOpaque) for the given block */
| 156 | |
| 157 | /* Sets draw type and updates related state (e.g. FullOpaque) for the given block */ |
| 158 | static void Block_SetDrawType(BlockID block, cc_uint8 draw) { |
| 159 | if (draw == DRAW_OPAQUE && Blocks.Collide[block] != COLLIDE_SOLID) draw = DRAW_TRANSPARENT; |
| 160 | Blocks.Draw[block] = draw; |
| 161 | Block_RecalcIsLiquid(block); |
| 162 | |
| 163 | /* Whether a block is opaque and exactly occupies a cell in the world */ |
| 164 | /* The mesh builder module needs this information for optimisation purposes */ |
| 165 | Blocks.FullOpaque[block] = draw == DRAW_OPAQUE |
| 166 | && Blocks.MinBB[block].x == 0 && Blocks.MinBB[block].y == 0 && Blocks.MinBB[block].z == 0 |
| 167 | && Blocks.MaxBB[block].x == 1 && Blocks.MaxBB[block].y == 1 && Blocks.MaxBB[block].z == 1; |
| 168 | } |
| 169 | |
| 170 | void Block_SetSide(TextureLoc texLoc, BlockID blockId) { |
| 171 | int index = blockId * FACE_COUNT; |
no test coverage detected