mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-22 23:17:04 +00:00
mapeditor:: correct and efficient ghosts when using a larger range or quotient spaces
This commit is contained in:
parent
1539d85a45
commit
59e58693f4
@ -732,6 +732,9 @@ namespace mapeditor {
|
||||
displayButton(8, vid.yres-8-fs*3, XLAT("SPACE = map/graphics"), ' ', 0);
|
||||
displayButton(8, vid.yres-8-fs*2, XLAT("ESC = return to the game"), SDLK_ESCAPE, 0);
|
||||
}
|
||||
|
||||
EX unordered_set<cell*> affected;
|
||||
EX unordered_set<int> affected_id;
|
||||
|
||||
EX void showMapEditor() {
|
||||
cmode = sm::MAP;
|
||||
@ -739,6 +742,13 @@ namespace mapeditor {
|
||||
|
||||
int fs = editor_fsize();
|
||||
|
||||
affected.clear();
|
||||
affected_id.clear();
|
||||
if(lmouseover) {
|
||||
celllister cl(lmouseover, radius, 10000, nullptr);
|
||||
for(cell *c: cl.lst) affected.insert(c), affected_id.insert(patterns::getpatterninfo0(c).id);
|
||||
}
|
||||
|
||||
getcstat = '-';
|
||||
|
||||
displayfr(8, 8 + fs, 2, vid.fsize, paintwhat_str, forecolor, 0);
|
||||
@ -1154,11 +1164,16 @@ namespace mapeditor {
|
||||
#endif
|
||||
|
||||
EX void drawGhosts(cell *c, const transmatrix& V, int ct) {
|
||||
if((cmode & sm::MAP) && lmouseover && darken == 0 &&
|
||||
(GDIM == 3 || !mouseout()) &&
|
||||
(patterns::whichPattern ? patterns::getpatterninfo0(c).id == patterns::getpatterninfo0(lmouseover).id : c == lmouseover)) {
|
||||
queuecircleat(c, .78, 0x00FFFFFF);
|
||||
if(!(cmode & sm::MAP)) return;
|
||||
if(darken != 0) return;
|
||||
if(GDIM == 2 && mouseout()) return;
|
||||
if(patterns::whichPattern) {
|
||||
if(!affected_id.count(patterns::getpatterninfo0(c).id)) return;
|
||||
}
|
||||
else {
|
||||
if(!affected.count(c)) return;
|
||||
}
|
||||
queuecircleat1(c, V, .78, 0x00FFFFFF);
|
||||
}
|
||||
|
||||
hyperpoint ccenter = C0;
|
||||
|
Loading…
Reference in New Issue
Block a user