1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-28 19:10:35 +00:00

3d:: an option to limit cell generation

This commit is contained in:
Zeno Rogue 2019-05-11 17:20:57 +02:00
parent 16c4108a8d
commit 8388a448e7
4 changed files with 19 additions and 2 deletions

View File

@ -355,6 +355,7 @@ void initConfig() {
addsaver(vid.smart_range_detail, "smart-range-detail", 8);
addsaver(vid.smart_range_detail_3, "smart-range-detail", 30);
addsaver(vid.cells_drawn_limit, "limit on cells drawn", 10000);
addsaver(vid.cells_generated_limit, "limit on cells generated", 25);
addsaver(vid.skiprope, "mobius", 0);
@ -629,6 +630,14 @@ void add_cells_drawn(char c = 'C') {
);
dialog::scaleLog();
});
if(WDIM == 3 || vid.use_smart_range == 2) {
dialog::addSelItem(XLAT("limit generation per frame"), its(vid.cells_generated_limit), 'L');
dialog::add_action([] () {
dialog::editNumber(vid.cells_generated_limit, 1, 1000, log(10), 25, XLAT("limit generation per frame"),
XLAT("In the 3D mode, lowering this value may help if the game lags while exploring new areas.")
);
});
}
}
void edit_sightrange() {

View File

@ -1160,6 +1160,7 @@ struct videopar {
ld smart_range_detail;// minimum visible cell for modes 1 and 2
ld smart_range_detail_3;// minimum visible cell in 3D (for mode 2, there is no mode 1)
int cells_drawn_limit;
int cells_generated_limit; // limit on cells generated per frame
ld skiprope;

View File

@ -1272,7 +1272,7 @@ void panning(hyperpoint hf, hyperpoint ht) {
playermoved = false;
}
int cells_drawn;
int cells_drawn, cells_generated;
void fullcenter() {
conformal::path_for_lineanimation.clear();
@ -1690,6 +1690,8 @@ bool do_draw(cell *c, const transmatrix& T) {
if(cells_drawn > vid.cells_drawn_limit) return false;
if(vid.use_smart_range) {
if(cells_drawn >= 50 && !in_smart_range(T)) return false;
if(c->mpdist > 7 && cells_generated > vid.cells_generated_limit) return false;
cells_generated++;
setdist(c, 7, c);
}
else {
@ -1720,7 +1722,11 @@ bool do_draw(cell *c, const transmatrix& T) {
if(cells_drawn > vid.cells_drawn_limit) return false;
bool usr = vid.use_smart_range || quotient || euwrap;
if(usr && cells_drawn >= 50 && !in_smart_range(T)) return false;
if(vid.use_smart_range == 2) setdist(c, 7, c);
if(vid.use_smart_range == 2) {
if(cells_generated > vid.cells_generated_limit) return false;
setdist(c, 7, c);
cells_generated++;
}
return true;
}

View File

@ -312,6 +312,7 @@ void take(string fname, const function<void()>& what) {
dynamicval<bool> v2(inHighQual, true);
dynamicval<bool> v6(auraNOGL, true);
dynamicval<bool> vn(nohud, nohud || hide_hud);
dynamicval<int> cgl(vid.cells_generated_limit, 9999999);
vid.smart_range_detail *= multiplier;
darken = 0;