Fix for #164 Remember mode when switching views
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6436 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 68b7af86f7b59eded87a51b49f951fdf18820268 Former-commit-id: ea73ed5e3e3b3f5054f95e8f28852877aa0b3c76
This commit is contained in:
parent
aac3c4846c
commit
0b7d03c0a2
2 changed files with 8 additions and 3 deletions
|
@ -53,6 +53,7 @@ cGrScreen::cGrScreen(int myid)
|
||||||
selectPrevFlag = false;
|
selectPrevFlag = false;
|
||||||
mirrorFlag = 1;
|
mirrorFlag = 1;
|
||||||
memset(cams, 0, sizeof(cams));
|
memset(cams, 0, sizeof(cams));
|
||||||
|
memset(subcamIndex, 0, sizeof(subcamIndex));
|
||||||
viewRatio = 1.33;
|
viewRatio = 1.33;
|
||||||
cars = 0;
|
cars = 0;
|
||||||
viewOffset = 0;
|
viewOffset = 0;
|
||||||
|
@ -205,9 +206,9 @@ void cGrScreen::selectCamera(long cam)
|
||||||
curCam = (cGrPerspCamera*)GF_TAILQ_FIRST(&cams[cam]);
|
curCam = (cGrPerspCamera*)GF_TAILQ_FIRST(&cams[cam]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Change of camera list, take the first one */
|
|
||||||
curCamHead = cam;
|
/* Change of camera list, take the last one used*/
|
||||||
curCam = (cGrPerspCamera*)GF_TAILQ_FIRST(&cams[cam]);
|
selectNthCamera(cam,subcamIndex[cam]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curCam == NULL) {
|
if (curCam == NULL) {
|
||||||
|
@ -273,6 +274,8 @@ void cGrScreen::saveCamera(void)
|
||||||
drawCurrent = curCam->getDrawCurrent();
|
drawCurrent = curCam->getDrawCurrent();
|
||||||
curCam->limitFov ();
|
curCam->limitFov ();
|
||||||
GfParmWriteFile(NULL, grHandle, "Graph");
|
GfParmWriteFile(NULL, grHandle, "Graph");
|
||||||
|
|
||||||
|
subcamIndex[curCamHead] = curCam->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
static class cGrPerspCamera *TheDispCam; /* the display camera */
|
static class cGrPerspCamera *TheDispCam; /* the display camera */
|
||||||
|
@ -595,6 +598,7 @@ void cGrScreen::initCams(tSituation *s)
|
||||||
}
|
}
|
||||||
|
|
||||||
loadParams(s);
|
loadParams(s);
|
||||||
|
saveCamera();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cGrScreen::initBoard(void)
|
void cGrScreen::initBoard(void)
|
||||||
|
|
|
@ -34,6 +34,7 @@ class cGrScreen {
|
||||||
|
|
||||||
int curCamHead; // The current camera list.
|
int curCamHead; // The current camera list.
|
||||||
tGrCamHead cams[10]; // From F2 to F11.
|
tGrCamHead cams[10]; // From F2 to F11.
|
||||||
|
int subcamIndex[10]; // current subcam index (for each list)
|
||||||
|
|
||||||
class cGrPerspCamera *curCam; // The current camera.
|
class cGrPerspCamera *curCam; // The current camera.
|
||||||
class cGrCarCamMirror *mirrorCam; // The mirror camera.
|
class cGrCarCamMirror *mirrorCam; // The mirror camera.
|
||||||
|
|
Loading…
Reference in a new issue