1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

rogueviz:: fixed the type in perturb to color_t

This commit is contained in:
Zeno Rogue 2019-04-23 10:42:06 +02:00
parent 884ab0cd5f
commit 38e1dc6a7a

View File

@ -73,10 +73,10 @@ colorpair parse(const string& s) {
} }
int nh = 0; int nh = 0;
int hues[256*6]; color_t hues[256*6];
void buildhue() { void buildhue() {
unsigned mh = 193; color_t mh = 193;
for(unsigned y=0; y<=mh; y++) for(unsigned y=0; y<=mh; y++)
hues[nh++] = (int) (0xFF + 0x1000000*mh + (unsigned) 0x10000 * y); hues[nh++] = (int) (0xFF + 0x1000000*mh + (unsigned) 0x10000 * y);
for(unsigned y=0; y<=mh; y++) for(unsigned y=0; y<=mh; y++)
@ -91,7 +91,7 @@ void buildhue() {
hues[nh++] = (int) (0xFF + 0x1000100*mh - 0x100 * y); hues[nh++] = (int) (0xFF + 0x1000100*mh - 0x100 * y);
} }
int perturb(int c) { color_t perturb(color_t c) {
if(nh == 0) buildhue(); if(nh == 0) buildhue();
int hueid = -1; int hueid = -1;
for(int t=0; t<nh; t++) if(hues[t] == c) hueid = t; for(int t=0; t<nh; t++) if(hues[t] == c) hueid = t;