forked from spoutn1k/mcmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolors.h
89 lines (81 loc) · 2.05 KB
/
colors.h
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#ifndef _COLORS_
#define _COLORS_
#include "helper.h"
#include <cmath>
// Byte order see below. Colors aligned to word boundaries for some speedup
// Brightness is precalculated to speed up calculations later
// Colors are stored twice since BMP and PNG need them in different order
// Noise is supposed to look normal when -noise 10 is given
extern uint8_t colors[256][8];
#define PRED 0
#define PGREEN 1
#define PBLUE 2
#define PALPHA 3
#define NOISE 4
#define BRIGHTNESS 5
#define GETBRIGHTNESS(c) (uint8_t)sqrt( \
double(PRED[c]) * double(PRED[c]) * .236 + \
double(PGREEN[c]) * double(PGREEN[c]) * .601 + \
double(PBLUE[c]) * double(PBLUE[c]) * .163)
void loadColors();
bool loadColorsFromFile(const char *file);
bool dumpColorsToFile(const char *file);
bool extractColors(const char *file);
bool loadBiomeColors(const char* path);
#define AIR 0
#define STONE 1
#define GRASS 2
#define DIRT 3
#define COBBLESTONE 4
#define WOOD 5
#define WATER 8
#define STAT_WATER 9
#define LAVA 10
#define STAT_LAVA 11
#define SAND 12
#define GRAVEL 13
#define LOG 17
#define LEAVES 18
#define SANDSTONE 24
#define BED 26
#define POW_RAILROAD 27
#define DET_RAILROAD 28
#define COBWEB 30
#define TALL_GRASS 31
#define SHRUB 32
#define WOOL 35
#define FLOWERY 37
#define FLOWERR 38
#define MUSHROOMB 39
#define MUSHROOMR 40
#define DOUBLESTEP 43
#define STEP 44
#define TORCH 50
#define FIRE 51
#define REDWIRE 55
#define RAILROAD 66
#define REDTORCH_OFF 75
#define REDTORCH_ON 76
#define SNOW 78
#define FENCE 85
#define CAKE 92
#define TRAPDOOR 96
#define IRON_BARS 101
#define PUMPKIN_STEM 104
#define MELON_STEM 105
#define VINES 106
#define FENCE_GATE 107
#define MYCELIUM 110
#define LILYPAD 111
#define NETHER_BRICK 112
#define NETHER_BRICK_FENCE 113
#define NETHER_BRICK_STAIRS 114
#define NETHER_WART 115
#define SANDSTEP 233
#define WOODSTEP 234
#define COBBLESTEP 235
#define BRICKSTEP 236
#define STONEBRICKSTEP 237
#define PINELEAVES 231
#define BIRCHLEAVES 232
#endif