mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-18 23:10:26 +00:00
ray:: vr:: fixed raycaster not recompiling correctly on setting changes
This commit is contained in:
parent
b166b64006
commit
198decfd64
@ -218,10 +218,29 @@ string build_getter(string type, string name, int index) {
|
|||||||
EX hookset<void(string&, string&)> hooks_rayshader;
|
EX hookset<void(string&, string&)> hooks_rayshader;
|
||||||
EX hookset<bool(shared_ptr<raycaster>)> hooks_rayset;
|
EX hookset<bool(shared_ptr<raycaster>)> hooks_rayset;
|
||||||
|
|
||||||
|
tuple<
|
||||||
|
#if CAP_VR
|
||||||
|
int, vrhr::eEyes,
|
||||||
|
#endif
|
||||||
|
eGeometry
|
||||||
|
> raycaster_state() {
|
||||||
|
return make_tuple(
|
||||||
|
#if CAP_VR
|
||||||
|
vrhr::state,
|
||||||
|
vrhr::eyes,
|
||||||
|
#endif
|
||||||
|
geometry
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
decltype(raycaster_state()) saved_state;
|
||||||
|
|
||||||
void enable_raycaster() {
|
void enable_raycaster() {
|
||||||
using glhr::to_glsl;
|
using glhr::to_glsl;
|
||||||
if(geometry != last_geometry) {
|
auto state = raycaster_state();
|
||||||
|
if(state != saved_state) {
|
||||||
reset_raycaster();
|
reset_raycaster();
|
||||||
|
saved_state = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
wall_offset(centerover); /* so raywall is not empty and deg is not zero */
|
wall_offset(centerover); /* so raywall is not empty and deg is not zero */
|
||||||
|
Loading…
Reference in New Issue
Block a user