the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2
3#include "Tile_SPU.h"
4
5class Player;
6
7class TreeTile_SPU : public Tile_SPU
8{
9public:
10 static const int DARK_TRUNK = 1;
11 static const int BIRCH_TRUNK = 2;
12 static const int JUNGLE_TRUNK = 3;
13
14 static const int MASK_TYPE = 0x3;
15 static const int MASK_FACING = 0xC;
16 static const int FACING_Y = 0 << 2;
17 static const int FACING_X = 1 << 2;
18 static const int FACING_Z = 2 << 2;
19
20 static const int TREE_NAMES_LENGTH = 4;
21
22 TreeTile_SPU(int id) : Tile_SPU(id) {}
23 int getRenderShape() { return Tile_SPU::SHAPE_TREE; }
24
25
26public:
27 Icon_SPU *getTexture(int face, int data)
28 {
29 int dir = data & MASK_FACING;
30 int type = data & MASK_TYPE;
31 if (dir == FACING_Y && (face == Facing::UP || face == Facing::DOWN))
32 return &ms_pTileData->treeTile_iconTop;
33 else if (dir == FACING_X && (face == Facing::EAST || face == Facing::WEST))
34 return &ms_pTileData->treeTile_iconTop;
35 else if (dir == FACING_Z && (face == Facing::NORTH || face == Facing::SOUTH))
36 return &ms_pTileData->treeTile_iconTop;
37
38 return &ms_pTileData->treeTile_icons[data];
39 }
40};