mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-01 05:21:02 +00:00
[renderer] Allow the camera to be overridden
Necessary for a debug camera.
This commit is contained in:
parent
706995f6b3
commit
d0d39ecee0
2 changed files with 12 additions and 1 deletions
|
@ -53,6 +53,10 @@ extern int r_zgraph;
|
|||
extern int scr_copytop;
|
||||
extern bool scr_skipupdate;
|
||||
|
||||
extern bool r_lock_viewleaf;
|
||||
extern bool r_override_camera;
|
||||
extern struct transform_s r_camera;
|
||||
|
||||
struct view_pos_s;
|
||||
void R_TimeGraph (struct view_pos_s abs, struct view_pos_s len);
|
||||
void R_ZGraph (struct view_pos_s abs, struct view_pos_s len);
|
||||
|
|
|
@ -60,6 +60,9 @@
|
|||
int scr_copytop;
|
||||
byte *draw_chars; // 8*8 graphic characters FIXME location
|
||||
bool r_cache_thrash; // set if surface cache is thrashing
|
||||
bool r_lock_viewleaf; // prevent vis updates (for debug camera)
|
||||
bool r_override_camera;
|
||||
transform_t r_camera;
|
||||
|
||||
visstate_t r_visstate; //FIXME per renderer
|
||||
|
||||
|
@ -292,6 +295,10 @@ SCR_UpdateScreen (transform_t camera, double realtime, SCR_Func *scr_funcs)
|
|||
r_time1 = Sys_DoubleTime ();
|
||||
}
|
||||
|
||||
if (__builtin_expect (r_override_camera, 0)) {
|
||||
camera = r_camera;
|
||||
}
|
||||
|
||||
refdef_t *refdef = r_data->refdef;
|
||||
if (Transform_Valid (camera)) {
|
||||
Transform_GetWorldMatrix (camera, refdef->camera);
|
||||
|
@ -313,7 +320,7 @@ SCR_UpdateScreen (transform_t camera, double realtime, SCR_Func *scr_funcs)
|
|||
}
|
||||
|
||||
R_AnimateLight ();
|
||||
if (scr_scene && scr_scene->worldmodel) {
|
||||
if (!r_lock_viewleaf && scr_scene && scr_scene->worldmodel) {
|
||||
scr_scene->viewleaf = 0;
|
||||
vec4f_t position = refdef->frame.position;
|
||||
auto brush = &scr_scene->worldmodel->brush;
|
||||
|
|
Loading…
Reference in a new issue