1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-20 23:50:27 +00:00

ray:: in VR raycasting, raycast_map is called just once per frame

This commit is contained in:
Zeno Rogue 2021-03-09 14:09:58 +01:00
parent 04472e513d
commit 91f7b2696f

View File

@ -1426,6 +1426,8 @@ int nesting;
struct raycast_map { struct raycast_map {
int saved_frameid;
vector<cell*> lst; vector<cell*> lst;
map<cell*, int> ids; map<cell*, int> ids;
@ -1636,6 +1638,7 @@ struct raycast_map {
} }
void create_all(cell *cs) { void create_all(cell *cs) {
saved_frameid = frameid;
generate_initial_ms(cs); generate_initial_ms(cs);
generate_cell_listing(cs); generate_cell_listing(cs);
apply_shape(); apply_shape();
@ -1643,7 +1646,7 @@ struct raycast_map {
} }
bool need_to_create(cell *cs) { bool need_to_create(cell *cs) {
if(!fixed_map) return true; if(!fixed_map && frameid != saved_frameid) return true;
return !ids.count(cs); return !ids.count(cs);
} }
}; };