Fix T63697: correct stuck R_NO_CAMERA_SWITCH in scene->r.mode.

This flag becomes stuck in certain situations, causing the marker
camera switch feature to not work.

To fix old files with the problem, clear the flag on file load.

Also, the line that is supposed to clear it has wrong bit math,
causing seq_render_scene_strip to effectively toggle the flag on or
off every time it's run, instead of restoring to original state.

The flag and code were added in 001789d733 by @campbellbarton.
This commit is contained in:
2019-05-02 16:01:00 +03:00
parent 5ec7987949
commit 2c5ee7418c
2 changed files with 6 additions and 1 deletions

View File

@@ -3640,7 +3640,7 @@ finally:
#ifdef DURIAN_CAMERA_SWITCH
/* stooping to new low's in hackyness :( */
scene->r.mode &= ~(orig_data.mode & R_NO_CAMERA_SWITCH);
scene->r.mode &= orig_data.mode | ~R_NO_CAMERA_SWITCH;
#endif
return ibuf;

View File

@@ -6867,6 +6867,11 @@ static void direct_link_scene(FileData *fd, Scene *sce)
}
}
#ifdef DURIAN_CAMERA_SWITCH
/* Runtime */
sce->r.mode &= ~R_NO_CAMERA_SWITCH;
#endif
sce->r.avicodecdata = newdataadr(fd, sce->r.avicodecdata);
if (sce->r.avicodecdata) {
sce->r.avicodecdata->lpFormat = newdataadr(fd, sce->r.avicodecdata->lpFormat);