Skip to content

Commit

Permalink
Fix some 3d mode issues
Browse files Browse the repository at this point in the history
- Fix 3d mode crash when flats_use_vbo cvar is false
- Fix wrong logic checking min distance to sector bbox
  • Loading branch information
sirjuddington committed May 29, 2024
1 parent 74dda70 commit b38ded8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/MapEditor/Renderer/MapRenderer3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2945,7 +2945,7 @@ void MapRenderer3D::quickVisDiscard()
if (dist < min_dist)
min_dist = dist;

dist_sectors_[a] = dist;
dist_sectors_[a] = min_dist;
}
}

Expand Down Expand Up @@ -3095,6 +3095,10 @@ void MapRenderer3D::checkVisibleFlats()
if (dist_sectors_[a] < 0)
continue;

// Update sector info if needed
if (isSectorStale(a))
updateSector(a);

n_flats_ += sector_flats_[a].size();
}
flats_.resize(n_flats_);
Expand Down Expand Up @@ -3126,10 +3130,6 @@ void MapRenderer3D::checkVisibleFlats()
}
}

// Update sector info if needed
if (isSectorStale(a))
updateSector(a);

// Set distance fade alpha
if (render_max_dist > 0)
alpha = calcDistFade(dist_sectors_[a], render_max_dist);
Expand Down

0 comments on commit b38ded8

Please sign in to comment.