1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-30 15:39:54 +00:00

fixed a crash in some tilings when drawing plain sidewalls

This commit is contained in:
Zeno Rogue 2020-03-11 09:53:53 +01:00
parent 28f8412604
commit 3539d43690

View File

@ -286,6 +286,7 @@ void geometry_information::bshape_regular(floorshape &fsh, int id, int sides, ld
} }
for(int k=0; k<SIDEPARS; k++) { for(int k=0; k<SIDEPARS; k++) {
if(isize(fsh.gpside[k]) < c->type)
fsh.gpside[k].resize(c->type); fsh.gpside[k].resize(c->type);
for(int i=0; i<c->type; i++) { for(int i=0; i<c->type; i++) {
sizeto(fsh.gpside[k][i], id); sizeto(fsh.gpside[k][i], id);
@ -442,6 +443,7 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i
hpcpush(mid_at(hpxy(0,0), cornerlist[i%cor], SHADMUL)); hpcpush(mid_at(hpxy(0,0), cornerlist[i%cor], SHADMUL));
for(int k=0; k<SIDEPARS; k++) { for(int k=0; k<SIDEPARS; k++) {
if(isize(fsh.gpside[k]) < cor)
fsh.gpside[k].resize(cor); fsh.gpside[k].resize(cor);
for(int cid=0; cid<cor; cid++) { for(int cid=0; cid<cor; cid++) {
sizeto(fsh.gpside[k][cid], id); sizeto(fsh.gpside[k][cid], id);
@ -594,6 +596,7 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i
for(int l=0; l<SIDEPARS; l++) { for(int l=0; l<SIDEPARS; l++) {
for(auto& li: fsh.side[l]) for(auto& li: fsh.side[l])
bind_floor_texture(li, fsh.id); bind_floor_texture(li, fsh.id);
if(isize(fsh.gpside[l]) < c->type)
fsh.gpside[l].resize(c->type); fsh.gpside[l].resize(c->type);
for(auto& gs: fsh.gpside[l]) { for(auto& gs: fsh.gpside[l]) {
for(auto& li: gs) for(auto& li: gs)
@ -611,6 +614,7 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i
for(auto& li: fsh.levels[l]) bind_floor_texture(li, fsh.id); for(auto& li: fsh.levels[l]) bind_floor_texture(li, fsh.id);
fsh.side[l] = shFullFloor.side[l]; fsh.side[l] = shFullFloor.side[l];
for(auto& li: fsh.side[l]) bind_floor_texture(li, fsh.id); for(auto& li: fsh.side[l]) bind_floor_texture(li, fsh.id);
if(isize(fsh.gpside[l]) < c->type)
fsh.gpside[l].resize(c->type); fsh.gpside[l].resize(c->type);
for(int e=0; e<c->type; e++) { for(int e=0; e<c->type; e++) {
fsh.gpside[l][e] = shFullFloor.gpside[l][e]; fsh.gpside[l][e] = shFullFloor.gpside[l][e];