mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-23 15:36:59 +00:00
colors:: allocate more colors
This commit is contained in:
parent
25b77617cd
commit
9d26e98fcd
@ -32,6 +32,10 @@ struct colortable: vector<color_t> {
|
||||
const color_t& operator [] (int i) const { i %= size(); if(i<0) i += size(); return ((vector<color_t>&)(*this)) [i]; }
|
||||
colortable(std::initializer_list<color_t> v) : vector(v) {}
|
||||
colortable() : vector({0}) {}
|
||||
void allocate(int num) {
|
||||
int q = size();
|
||||
for(int i=q; i<num; i++) push_back((*this)[i % q]);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -3110,10 +3110,11 @@ int read_pattern_args() {
|
||||
((color_t*)(&vid.cs.skincolor)) [d] = h;
|
||||
return 0;
|
||||
}
|
||||
else ct = &(colortables[patterns::whichCanvas]);
|
||||
else ct = &(colortables[args()[0]]);
|
||||
shift();
|
||||
}
|
||||
int d = argi();
|
||||
ct->allocate(d+1);
|
||||
shift(); (*ct)[d] = arghex();
|
||||
}
|
||||
else if(argis("-canvas")) {
|
||||
|
Loading…
Reference in New Issue
Block a user