When explicitly regenerating groups, only generate until active group.
Before this change, groups and their meshes were generated even past the active group, which, in cause the mesh was broken, caused red marks to appear for no apparent reason. Furthermore, it unnecessarily slows down regeneration.pull/4/head
parent
76d582720a
commit
2f734d9cfa
16
src/dsc.h
16
src/dsc.h
|
@ -304,6 +304,22 @@ public:
|
|||
return t;
|
||||
}
|
||||
|
||||
int IndexOf(H h) {
|
||||
int first = 0, last = n-1;
|
||||
while(first <= last) {
|
||||
int mid = (first + last)/2;
|
||||
H hm = elem[mid].h;
|
||||
if(hm.v > h.v) {
|
||||
last = mid-1; // and first stays the same
|
||||
} else if(hm.v < h.v) {
|
||||
first = mid+1; // and last stays the same
|
||||
} else {
|
||||
return mid;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
T *FindByIdNoOops(H h) {
|
||||
int first = 0, last = n-1;
|
||||
while(first <= last) {
|
||||
|
|
|
@ -168,6 +168,12 @@ void SolveSpaceUI::GenerateAll(void) {
|
|||
void SolveSpaceUI::GenerateAll(int first, int last, bool andFindFree) {
|
||||
int i, j;
|
||||
|
||||
// generate until active group
|
||||
if(last == -2) {
|
||||
last = SK.group.IndexOf(SS.GW.activeGroup);
|
||||
if(last == -1) last = INT_MAX;
|
||||
}
|
||||
|
||||
// Remove any requests or constraints that refer to a nonexistent
|
||||
// group; can check those immediately, since we know what the list
|
||||
// of groups should be.
|
||||
|
|
|
@ -886,7 +886,7 @@ void GraphicsWindow::MenuEdit(int id) {
|
|||
|
||||
case MNU_REGEN_ALL:
|
||||
SS.ReloadAllImported();
|
||||
SS.GenerateAll(0, INT_MAX);
|
||||
SS.GenerateAll(0, -2);
|
||||
SS.ScheduleShowTW();
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue