blob: 788d61d98bb44767d006177d8367963184bffc3f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#pragma once
#include "Tile_SPU.h"
class QuartzBlockTile_SPU : public Tile_SPU
{
public:
static const int TYPE_DEFAULT = 0;
static const int TYPE_CHISELED = 1;
static const int TYPE_LINES_Y = 2;
static const int TYPE_LINES_X = 3;
static const int TYPE_LINES_Z = 4;
static const int QUARTZ_BLOCK_NAMES = 3;
private:
static const int QUARTZ_BLOCK_TEXTURES = 5;
// Icon *icons[QUARTZ_BLOCK_TEXTURES];
// Icon *iconChiseledTop;
// Icon *iconLinesTop;
// Icon *iconTop;
// Icon *iconBottom;
public:
QuartzBlockTile_SPU(int id) : Tile_SPU(id) {}
Icon_SPU *getTexture(int face, int data)
{
if (data == TYPE_LINES_Y || data == TYPE_LINES_X || data == TYPE_LINES_Z)
{
if (data == TYPE_LINES_Y && (face == Facing::UP || face == Facing::DOWN))
{
return &ms_pTileData->quartzBlock_iconLinesTop;
}
else if (data == TYPE_LINES_X && (face == Facing::EAST || face == Facing::WEST))
{
return &ms_pTileData->quartzBlock_iconLinesTop;
}
else if (data == TYPE_LINES_Z && (face == Facing::NORTH || face == Facing::SOUTH))
{
return &ms_pTileData->quartzBlock_iconLinesTop;
}
return &ms_pTileData->quartzBlock_icons[data];
}
if (face == Facing::UP || (face == Facing::DOWN && data == TYPE_CHISELED))
{
if (data == TYPE_CHISELED)
{
return &ms_pTileData->quartzBlock_iconChiseledTop;
}
return &ms_pTileData->quartzBlock_iconTop;
}
if (face == Facing::DOWN)
{
return &ms_pTileData->quartzBlock_iconBottom;
}
if (data < 0 || data >= QUARTZ_BLOCK_TEXTURES) data = 0;
return &ms_pTileData->quartzBlock_icons[data];
}
int getRenderShape() { return Tile_SPU::SHAPE_QUARTZ; }
};
|