532 and 469 changes
More working on the spanning of split screens and some changes to the camera lists git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@4712 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: ec336874b506410550f76e6d549c9f7de72c7fbf Former-commit-id: 34021959239493d7d3359e25c70342e170b01a64
This commit is contained in:
parent
2b91056a89
commit
6e4366f887
3 changed files with 174 additions and 81 deletions
|
@ -32,6 +32,7 @@ static char path[1024];
|
||||||
static int spansplit;
|
static int spansplit;
|
||||||
static float spanfovy;
|
static float spanfovy;
|
||||||
static float bezelcomp;
|
static float bezelcomp;
|
||||||
|
static int spanaspect;
|
||||||
|
|
||||||
// Utilities ================================================================
|
// Utilities ================================================================
|
||||||
|
|
||||||
|
@ -111,7 +112,8 @@ void cGrPerspCamera::setProjection(void)
|
||||||
// result back to an angle. Care needs to be taken to because the
|
// result back to an angle. Care needs to be taken to because the
|
||||||
// tan and atan functions operate on angles in radians. Also,
|
// tan and atan functions operate on angles in radians. Also,
|
||||||
// we're only interested in half the viewing angle.
|
// we're only interested in half the viewing angle.
|
||||||
float fovx = atan(screen->getViewRatio() * tan(fovy * M_PI / 360.0)) * 360.0 / M_PI;
|
|
||||||
|
float fovx = atan(screen->getViewRatio() / spanaspect * tan(fovy * M_PI / 360.0)) * 360.0 / M_PI;
|
||||||
grContext.setFOV(fovx, fovy);
|
grContext.setFOV(fovx, fovy);
|
||||||
grContext.setNearFar(fnear, ffar);
|
grContext.setNearFar(fnear, ffar);
|
||||||
}
|
}
|
||||||
|
@ -295,7 +297,11 @@ class cGrCarCamInsideDriverEye : public cGrPerspCamera
|
||||||
float offset = 0;
|
float offset = 0;
|
||||||
|
|
||||||
p[0] = car->_drvPos_x;
|
p[0] = car->_drvPos_x;
|
||||||
|
#if 1 //SDW test
|
||||||
|
p[1] = car->_bonnetPos_y;
|
||||||
|
#else
|
||||||
p[1] = car->_drvPos_y;
|
p[1] = car->_drvPos_y;
|
||||||
|
#endif
|
||||||
p[2] = car->_drvPos_z;
|
p[2] = car->_drvPos_z;
|
||||||
sgXformPnt3(p, car->_posMat);
|
sgXformPnt3(p, car->_posMat);
|
||||||
|
|
||||||
|
@ -306,12 +312,16 @@ class cGrCarCamInsideDriverEye : public cGrPerspCamera
|
||||||
// Compute offset angle and bezel compensation)
|
// Compute offset angle and bezel compensation)
|
||||||
if (spansplit && viewOffset) {
|
if (spansplit && viewOffset) {
|
||||||
offset += (viewOffset - 10 + (int((viewOffset - 10) * 2) * (bezelcomp - 100)/200)) *
|
offset += (viewOffset - 10 + (int((viewOffset - 10) * 2) * (bezelcomp - 100)/200)) *
|
||||||
atan(screen->getViewRatio() * tan(spanfovy * M_PI / 360.0)) * 2;
|
atan(screen->getViewRatio() / spanaspect * tan(spanfovy * M_PI / 360.0)) * 2;
|
||||||
fovy = spanfovy;
|
fovy = spanfovy;
|
||||||
}
|
}
|
||||||
|
|
||||||
P[0] = car->_bonnetPos_x + 30.0 * cos(car->_glance + offset);
|
P[0] = car->_drvPos_x + 30.0 * cos(car->_glance + offset);
|
||||||
|
#if 1 //SDW test
|
||||||
P[1] = car->_bonnetPos_y - 30.0 * sin(car->_glance + offset);
|
P[1] = car->_bonnetPos_y - 30.0 * sin(car->_glance + offset);
|
||||||
|
#else
|
||||||
|
P[1] = car->_drvPos_y - 30.0 * sin(car->_glance + offset);
|
||||||
|
#endif
|
||||||
P[2] = car->_drvPos_z;
|
P[2] = car->_drvPos_z;
|
||||||
sgXformPnt3(P, car->_posMat);
|
sgXformPnt3(P, car->_posMat);
|
||||||
|
|
||||||
|
@ -374,8 +384,8 @@ class cGrCarCamInsideDynDriverEye : public cGrCarCamInsideDriverEye
|
||||||
eye[1] = p[1];
|
eye[1] = p[1];
|
||||||
eye[2] = p[2];
|
eye[2] = p[2];
|
||||||
|
|
||||||
P[0] = car->_bonnetPos_x + 30.0 * cos(car->_glance);
|
P[0] = car->_drvPos_x + 30.0 * cos(car->_glance);
|
||||||
P[1] = car->_bonnetPos_y - 30.0 * sin(car->_glance);
|
P[1] = car->_drvPos_y - 30.0 * sin(car->_glance);
|
||||||
P[2] = car->_drvPos_z;
|
P[2] = car->_drvPos_z;
|
||||||
sgXformPnt3(P, car->_posMat);
|
sgXformPnt3(P, car->_posMat);
|
||||||
|
|
||||||
|
@ -587,7 +597,7 @@ class cGrCarCamInsideFixedCar : public cGrPerspCamera
|
||||||
// Compute offset angle and bezel compensation)
|
// Compute offset angle and bezel compensation)
|
||||||
if (spansplit && viewOffset) {
|
if (spansplit && viewOffset) {
|
||||||
offset += (viewOffset - 10 + (int((viewOffset - 10) * 2) * (bezelcomp - 100)/200)) *
|
offset += (viewOffset - 10 + (int((viewOffset - 10) * 2) * (bezelcomp - 100)/200)) *
|
||||||
atan(screen->getViewRatio() * tan(spanfovy * M_PI / 360.0)) * 2;
|
atan(screen->getViewRatio() / spanaspect * tan(spanfovy * M_PI / 360.0)) * 2;
|
||||||
fovy = spanfovy;
|
fovy = spanfovy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -612,6 +622,62 @@ class cGrCarCamInsideFixedCar : public cGrPerspCamera
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// cGrCarCamInfrontFixedCar ================================================================
|
||||||
|
|
||||||
|
class cGrCarCamInfrontFixedCar : public cGrPerspCamera
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
cGrCarCamInfrontFixedCar(class cGrScreen *myscreen, int id, int drawCurr, int drawBG,
|
||||||
|
float myfovy, float myfovymin, float myfovymax,
|
||||||
|
float myfnear, float myffar = 1500.0,
|
||||||
|
float myfogstart = 1400.0, float myfogend = 1500.0)
|
||||||
|
: cGrPerspCamera(myscreen, id, drawCurr, 0, drawBG, 1,
|
||||||
|
myfovy, myfovymin, myfovymax,
|
||||||
|
myfnear, myffar, myfogstart, myfogend) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void update(tCarElt *car, tSituation *s) {
|
||||||
|
sgVec3 P, p;
|
||||||
|
float offset = 0;
|
||||||
|
|
||||||
|
p[0] = car->_dimension_x / 2;
|
||||||
|
p[1] = car->_bonnetPos_y;
|
||||||
|
p[2] = car->_statGC_z;
|
||||||
|
sgXformPnt3(p, car->_posMat);
|
||||||
|
|
||||||
|
eye[0] = p[0];
|
||||||
|
eye[1] = p[1];
|
||||||
|
eye[2] = p[2];
|
||||||
|
|
||||||
|
// Compute offset angle and bezel compensation)
|
||||||
|
if (spansplit && viewOffset) {
|
||||||
|
offset += (viewOffset - 10 + (int((viewOffset - 10) * 2) * (bezelcomp - 100)/200)) *
|
||||||
|
atan(screen->getViewRatio() / spanaspect * tan(spanfovy * M_PI / 360.0)) * 2;
|
||||||
|
fovy = spanfovy;
|
||||||
|
}
|
||||||
|
|
||||||
|
P[0] = (car->_dimension_x / 2) + 30.0 * cos(car->_glance + offset);
|
||||||
|
P[1] = car->_bonnetPos_y - 30.0 * sin(car->_glance + offset);
|
||||||
|
P[2] = car->_statGC_z;
|
||||||
|
|
||||||
|
sgXformPnt3(P, car->_posMat);
|
||||||
|
|
||||||
|
center[0] = P[0];
|
||||||
|
center[1] = P[1];
|
||||||
|
center[2] = P[2];
|
||||||
|
|
||||||
|
up[0] = car->_posMat[2][0];
|
||||||
|
up[1] = car->_posMat[2][1];
|
||||||
|
up[2] = car->_posMat[2][2];
|
||||||
|
|
||||||
|
speed[0] =car->pub.DynGCg.vel.x;
|
||||||
|
speed[1] =car->pub.DynGCg.vel.y;
|
||||||
|
speed[2] =car->pub.DynGCg.vel.z;
|
||||||
|
|
||||||
|
Speed = car->_speed_x * 3.6;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// cGrCarCamBehindFixedCar ================================================================
|
// cGrCarCamBehindFixedCar ================================================================
|
||||||
|
|
||||||
class cGrCarCamBehindFixedCar : public cGrPerspCamera
|
class cGrCarCamBehindFixedCar : public cGrPerspCamera
|
||||||
|
@ -630,9 +696,9 @@ class cGrCarCamBehindFixedCar : public cGrPerspCamera
|
||||||
{
|
{
|
||||||
sgVec3 P, p;
|
sgVec3 P, p;
|
||||||
float offset = 0;
|
float offset = 0;
|
||||||
|
|
||||||
p[0] = car->_bonnetPos_x - 6.0f;
|
p[0] = car->_drvPos_x - 6.0f * cos(1.5 * car->_glance);
|
||||||
p[1] = car->_bonnetPos_y;
|
p[1] = car->_bonnetPos_y + 6.0f * sin(1.5 * car->_glance);
|
||||||
p[2] = car->_bonnetPos_z + 1.0f;
|
p[2] = car->_bonnetPos_z + 1.0f;
|
||||||
sgXformPnt3(p, car->_posMat);
|
sgXformPnt3(p, car->_posMat);
|
||||||
|
|
||||||
|
@ -643,12 +709,12 @@ class cGrCarCamBehindFixedCar : public cGrPerspCamera
|
||||||
// Compute offset angle and bezel compensation)
|
// Compute offset angle and bezel compensation)
|
||||||
if (spansplit && viewOffset) {
|
if (spansplit && viewOffset) {
|
||||||
offset += (viewOffset - 10 + (int((viewOffset - 10) * 2) * (bezelcomp - 100)/200)) *
|
offset += (viewOffset - 10 + (int((viewOffset - 10) * 2) * (bezelcomp - 100)/200)) *
|
||||||
atan(screen->getViewRatio() * tan(spanfovy * M_PI / 360.0)) * 2;
|
atan(screen->getViewRatio() / spanaspect * tan(spanfovy * M_PI / 360.0)) * 2;
|
||||||
fovy = spanfovy;
|
fovy = spanfovy;
|
||||||
}
|
}
|
||||||
|
|
||||||
P[0] = car->_bonnetPos_x + 30.0 * cos(offset);
|
P[0] = car->_drvPos_x + 30.0 * cos(1.5 * car->_glance + offset);
|
||||||
P[1] = car->_bonnetPos_y - 30.0 * sin(offset);
|
P[1] = car->_bonnetPos_y - 30.0 * sin(1.5 * car->_glance + offset);
|
||||||
P[2] = car->_bonnetPos_z;
|
P[2] = car->_bonnetPos_z;
|
||||||
sgXformPnt3(P, car->_posMat);
|
sgXformPnt3(P, car->_posMat);
|
||||||
|
|
||||||
|
@ -715,7 +781,7 @@ class cGrCarCamBehindReverse : public cGrPerspCamera
|
||||||
// Compute offset angle and bezel compensation)
|
// Compute offset angle and bezel compensation)
|
||||||
if (spansplit && viewOffset) {
|
if (spansplit && viewOffset) {
|
||||||
offset += (viewOffset - 10 + (int((viewOffset - 10) * 2) * (bezelcomp - 100)/200)) *
|
offset += (viewOffset - 10 + (int((viewOffset - 10) * 2) * (bezelcomp - 100)/200)) *
|
||||||
atan(screen->getViewRatio() * tan(spanfovy * M_PI / 360.0)) * 2;
|
atan(screen->getViewRatio() / spanaspect * tan(spanfovy * M_PI / 360.0)) * 2;
|
||||||
fovy = spanfovy;
|
fovy = spanfovy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1603,6 +1669,10 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams,
|
||||||
|
|
||||||
bezelcomp = (float)GfParmGetNum(grHandle, GR_SCT_MONITOR, GR_ATT_BEZELCOMP, NULL, 120);
|
bezelcomp = (float)GfParmGetNum(grHandle, GR_SCT_MONITOR, GR_ATT_BEZELCOMP, NULL, 120);
|
||||||
|
|
||||||
|
const char *pszMonitorType =
|
||||||
|
GfParmGetStr(grHandle, GR_SCT_MONITOR, GR_ATT_MONITOR, GR_VAL_MONITOR_16BY9);
|
||||||
|
spanaspect = strcmp(pszMonitorType, GR_VAL_MONITOR_16BY9) ? 1.3333 : 1.7777;
|
||||||
|
|
||||||
/* Scene Cameras */
|
/* Scene Cameras */
|
||||||
c = 0;
|
c = 0;
|
||||||
|
|
||||||
|
@ -1610,23 +1680,6 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams,
|
||||||
GF_TAILQ_INIT(&cams[c]);
|
GF_TAILQ_INIT(&cams[c]);
|
||||||
id = 0;
|
id = 0;
|
||||||
|
|
||||||
/* cam F2 = just outside the car, behind; camera fixed to car */
|
|
||||||
cam = new cGrCarCamBehindFixedCar(myscreen,
|
|
||||||
id,
|
|
||||||
1, /* drawCurr */
|
|
||||||
1, /* drawBG */
|
|
||||||
67.5, /* fovy */
|
|
||||||
50.0, /* fovymin */
|
|
||||||
95.0, /* fovymax */
|
|
||||||
0.3, /* near */
|
|
||||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
|
||||||
fixedFar ? fixedFar/2 : 300.0 * fovFactor, /* fogstart */
|
|
||||||
fixedFar ? fixedFar : 600.0 * fovFactor /* fogend */
|
|
||||||
);
|
|
||||||
cam->add(&cams[c]);
|
|
||||||
id++;
|
|
||||||
|
|
||||||
|
|
||||||
/* cam F2 = inside, from the driver's eye, with head movements (driver's view) */
|
/* cam F2 = inside, from the driver's eye, with head movements (driver's view) */
|
||||||
cam = new cGrCarCamInsideDynDriverEye(myscreen,
|
cam = new cGrCarCamInsideDynDriverEye(myscreen,
|
||||||
id,
|
id,
|
||||||
|
@ -1649,7 +1702,7 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams,
|
||||||
1, /* drawCurr */
|
1, /* drawCurr */
|
||||||
1, /* drawBG */
|
1, /* drawBG */
|
||||||
75.5, /* fovy */
|
75.5, /* fovy */
|
||||||
20.0, /* fovymin */
|
10.0, /* fovymin */
|
||||||
195.0, /* fovymax */
|
195.0, /* fovymax */
|
||||||
0.03, /* near */
|
0.03, /* near */
|
||||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
||||||
|
@ -1665,7 +1718,7 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams,
|
||||||
1, /* drawCurr */
|
1, /* drawCurr */
|
||||||
1, /* drawBG */
|
1, /* drawBG */
|
||||||
67.5, /* fovy */
|
67.5, /* fovy */
|
||||||
50.0, /* fovymin */
|
10.0, /* fovymin */
|
||||||
95.0, /* fovymax */
|
95.0, /* fovymax */
|
||||||
0.3, /* near */
|
0.3, /* near */
|
||||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
||||||
|
@ -1676,12 +1729,16 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams,
|
||||||
id++;
|
id++;
|
||||||
|
|
||||||
/* cam F2 = ahead the windshield, from the bonnet (road view, car not visible) */
|
/* cam F2 = ahead the windshield, from the bonnet (road view, car not visible) */
|
||||||
|
#if 1 //SDW test
|
||||||
|
cam = new cGrCarCamInfrontFixedCar(myscreen,
|
||||||
|
#else
|
||||||
cam = new cGrCarCamInsideFixedCar(myscreen,
|
cam = new cGrCarCamInsideFixedCar(myscreen,
|
||||||
|
#endif
|
||||||
id,
|
id,
|
||||||
0, /* drawCurr */
|
0, /* drawCurr */
|
||||||
1, /* drawBG */
|
1, /* drawBG */
|
||||||
67.5, /* fovy */
|
67.5, /* fovy */
|
||||||
50.0, /* fovymin */
|
10.0, /* fovymin */
|
||||||
95.0, /* fovymax */
|
95.0, /* fovymax */
|
||||||
0.3, /* near */
|
0.3, /* near */
|
||||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
||||||
|
@ -1707,6 +1764,23 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams,
|
||||||
cam->add(&cams[c]);
|
cam->add(&cams[c]);
|
||||||
id++;
|
id++;
|
||||||
|
|
||||||
|
/* cam F2 = just outside the car, behind; camera fixed to car */
|
||||||
|
cam = new cGrCarCamBehindFixedCar(myscreen,
|
||||||
|
id,
|
||||||
|
1, /* drawCurr */
|
||||||
|
1, /* drawBG */
|
||||||
|
67.5, /* fovy */
|
||||||
|
50.0, /* fovymin */
|
||||||
|
95.0, /* fovymax */
|
||||||
|
0.3, /* near */
|
||||||
|
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
||||||
|
fixedFar ? fixedFar/2 : 300.0 * fovFactor, /* fogstart */
|
||||||
|
fixedFar ? fixedFar : 600.0 * fovFactor /* fogend */
|
||||||
|
);
|
||||||
|
cam->add(&cams[c]);
|
||||||
|
id++;
|
||||||
|
|
||||||
|
#if 0 //SDW test
|
||||||
/* cam F2 = behind the car, very near, looking forward */
|
/* cam F2 = behind the car, very near, looking forward */
|
||||||
cam = new cGrCarCamBehind(myscreen,
|
cam = new cGrCarCamBehind(myscreen,
|
||||||
id,
|
id,
|
||||||
|
@ -1743,7 +1817,7 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams,
|
||||||
25.0 /* relaxation */
|
25.0 /* relaxation */
|
||||||
);
|
);
|
||||||
cam->add(&cams[c]);
|
cam->add(&cams[c]);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* F3 */
|
/* F3 */
|
||||||
c++;
|
c++;
|
||||||
|
@ -1769,23 +1843,6 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams,
|
||||||
cam->add(&cams[c]);
|
cam->add(&cams[c]);
|
||||||
id++;
|
id++;
|
||||||
|
|
||||||
/* cam F3 = car behind */
|
|
||||||
cam = new cGrCarCamBehind2(myscreen,
|
|
||||||
id,
|
|
||||||
1, /* drawCurr */
|
|
||||||
1, /* drawBG */
|
|
||||||
40.0, /* fovy */
|
|
||||||
5.0, /* fovymin */
|
|
||||||
95.0, /* fovymax */
|
|
||||||
30.0, /* dist */
|
|
||||||
1.0, /* near */
|
|
||||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
|
||||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
|
||||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
|
||||||
);
|
|
||||||
cam->add(&cams[c]);
|
|
||||||
id++;
|
|
||||||
|
|
||||||
/* cam F3 = car behind */
|
/* cam F3 = car behind */
|
||||||
cam = new cGrCarCamBehind(myscreen,
|
cam = new cGrCarCamBehind(myscreen,
|
||||||
id,
|
id,
|
||||||
|
@ -1820,6 +1877,23 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams,
|
||||||
);
|
);
|
||||||
cam->add(&cams[c]);
|
cam->add(&cams[c]);
|
||||||
|
|
||||||
|
/* cam F3 = car behind */
|
||||||
|
cam = new cGrCarCamBehind2(myscreen,
|
||||||
|
id,
|
||||||
|
1, /* drawCurr */
|
||||||
|
1, /* drawBG */
|
||||||
|
40.0, /* fovy */
|
||||||
|
5.0, /* fovymin */
|
||||||
|
95.0, /* fovymax */
|
||||||
|
30.0, /* dist */
|
||||||
|
1.0, /* near */
|
||||||
|
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||||
|
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||||
|
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||||
|
);
|
||||||
|
cam->add(&cams[c]);
|
||||||
|
id++;
|
||||||
|
|
||||||
/* F4 */
|
/* F4 */
|
||||||
c++;
|
c++;
|
||||||
GF_TAILQ_INIT(&cams[c]);
|
GF_TAILQ_INIT(&cams[c]);
|
||||||
|
|
|
@ -137,15 +137,15 @@ grAdaptScreenSize(void)
|
||||||
default:
|
default:
|
||||||
grNbArrangeScreens = 0;
|
grNbArrangeScreens = 0;
|
||||||
case 0:
|
case 0:
|
||||||
// Left & Right half of the window
|
|
||||||
grScreens[0]->activate(grWinx, grWiny, grWinw / 2, grWinh, -0.5 + 10);
|
|
||||||
grScreens[1]->activate(grWinx + grWinw / 2, grWiny, grWinw / 2, grWinh, 0.5 + 10);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
// Top & Bottom half of the window
|
// Top & Bottom half of the window
|
||||||
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw, grWinh / 2, 0.0);
|
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw, grWinh / 2, 0.0);
|
||||||
grScreens[1]->activate(grWinx, grWiny, grWinw, grWinh / 2, 0.0);
|
grScreens[1]->activate(grWinx, grWiny, grWinw, grWinh / 2, 0.0);
|
||||||
break;
|
break;
|
||||||
|
case 1:
|
||||||
|
// Left & Right half of the window
|
||||||
|
grScreens[0]->activate(grWinx, grWiny, grWinw / 2, grWinh, -0.5 + 10);
|
||||||
|
grScreens[1]->activate(grWinx + grWinw / 2, grWiny, grWinw / 2, grWinh, 0.5 + 10);
|
||||||
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
// 33/66% Left/Right
|
// 33/66% Left/Right
|
||||||
grScreens[0]->activate(grWinx, grWiny, grWinw / 3, grWinh, 0.0);
|
grScreens[0]->activate(grWinx, grWiny, grWinw / 3, grWinh, 0.0);
|
||||||
|
@ -166,23 +166,23 @@ grAdaptScreenSize(void)
|
||||||
default:
|
default:
|
||||||
grNbArrangeScreens = 0;
|
grNbArrangeScreens = 0;
|
||||||
case 0:
|
case 0:
|
||||||
|
// Left/Right below wide
|
||||||
|
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw, grWinh / 2, 0.0);
|
||||||
|
grScreens[1]->activate(grWinx, grWiny, grWinw / 2, grWinh / 2, 0.0);
|
||||||
|
grScreens[2]->activate(grWinx + grWinw / 2, grWiny, grWinw / 2, grWinh / 2, 0.0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
// All side by side
|
// All side by side
|
||||||
grScreens[0]->activate(grWinx, grWiny, grWinw / 3, grWinh, -1 + 10);
|
grScreens[0]->activate(grWinx, grWiny, grWinw / 3, grWinh, -1 + 10);
|
||||||
grScreens[1]->activate(grWinx + grWinw / 3, grWiny, grWinw / 3, grWinh, 0.0 + 10);
|
grScreens[1]->activate(grWinx + grWinw / 3, grWiny, grWinw / 3, grWinh, 0.0 + 10);
|
||||||
grScreens[2]->activate(grWinx + grWinw * 2/3, grWiny, grWinw / 3, grWinh, 1 + 10);
|
grScreens[2]->activate(grWinx + grWinw * 2/3, grWiny, grWinw / 3, grWinh, 1 + 10);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 2:
|
||||||
// Left/Right above wide
|
// Left/Right above wide
|
||||||
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0);
|
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0);
|
||||||
grScreens[1]->activate(grWinx + grWinw / 2, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0);
|
grScreens[1]->activate(grWinx + grWinw / 2, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0);
|
||||||
grScreens[2]->activate(grWinx, grWiny, grWinw, grWinh / 2, 0.0);
|
grScreens[2]->activate(grWinx, grWiny, grWinw, grWinh / 2, 0.0);
|
||||||
break;
|
break;
|
||||||
case 2:
|
|
||||||
// Left/Right below wide
|
|
||||||
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw, grWinh / 2, 0.0);
|
|
||||||
grScreens[1]->activate(grWinx, grWiny, grWinw / 2, grWinh / 2, 0.0);
|
|
||||||
grScreens[2]->activate(grWinx + grWinw / 2, grWiny, grWinw / 2, grWinh / 2, 0.0);
|
|
||||||
break;
|
|
||||||
case 3:
|
case 3:
|
||||||
// 50/50% Left plus Top/Bottom on Right
|
// 50/50% Left plus Top/Bottom on Right
|
||||||
grScreens[0]->activate(grWinx, grWiny, grWinw / 2, grWinh, 0.0);
|
grScreens[0]->activate(grWinx, grWiny, grWinw / 2, grWinh, 0.0);
|
||||||
|
@ -216,19 +216,19 @@ grAdaptScreenSize(void)
|
||||||
default:
|
default:
|
||||||
grNbArrangeScreens = 0;
|
grNbArrangeScreens = 0;
|
||||||
case 0:
|
case 0:
|
||||||
// All side by side
|
|
||||||
grScreens[0]->activate(grWinx, grWiny, grWinw / 4, grWinh, -1.5 + 10);
|
|
||||||
grScreens[1]->activate(grWinx + grWinw / 4, grWiny, grWinw / 4, grWinh, -0.5 + 10);
|
|
||||||
grScreens[2]->activate(grWinx + grWinw * 2/4, grWiny, grWinw / 4, grWinh, 0.5 + 10);
|
|
||||||
grScreens[3]->activate(grWinx + grWinw * 3/4, grWiny, grWinw / 4, grWinh, 1.5 + 10);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
// Top/Bottom Left/Rigth Quarters
|
// Top/Bottom Left/Rigth Quarters
|
||||||
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0);
|
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0);
|
||||||
grScreens[1]->activate(grWinx + grWinw / 2, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0);
|
grScreens[1]->activate(grWinx + grWinw / 2, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0);
|
||||||
grScreens[2]->activate(grWinx, grWiny, grWinw / 2, grWinh / 2, 0.0);
|
grScreens[2]->activate(grWinx, grWiny, grWinw / 2, grWinh / 2, 0.0);
|
||||||
grScreens[3]->activate(grWinx + grWinw / 2, grWiny, grWinw / 2, grWinh / 2, 0.0);
|
grScreens[3]->activate(grWinx + grWinw / 2, grWiny, grWinw / 2, grWinh / 2, 0.0);
|
||||||
break;
|
break;
|
||||||
|
case 1:
|
||||||
|
// All side by side
|
||||||
|
grScreens[0]->activate(grWinx, grWiny, grWinw / 4, grWinh, -1.5 + 10);
|
||||||
|
grScreens[1]->activate(grWinx + grWinw / 4, grWiny, grWinw / 4, grWinh, -0.5 + 10);
|
||||||
|
grScreens[2]->activate(grWinx + grWinw * 2/4, grWiny, grWinw / 4, grWinh, 0.5 + 10);
|
||||||
|
grScreens[3]->activate(grWinx + grWinw * 3/4, grWiny, grWinw / 4, grWinh, 1.5 + 10);
|
||||||
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
// Left/Middle/Right above wide
|
// Left/Middle/Right above wide
|
||||||
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 3, grWinh / 2, 0.0);
|
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 3, grWinh / 2, 0.0);
|
||||||
|
@ -280,6 +280,14 @@ grAdaptScreenSize(void)
|
||||||
default:
|
default:
|
||||||
grNbArrangeScreens = 0;
|
grNbArrangeScreens = 0;
|
||||||
case 0:
|
case 0:
|
||||||
|
// Top/Bottom Left/Middle/Rigth Matrix
|
||||||
|
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0);
|
||||||
|
grScreens[1]->activate(grWinx + grWinw / 2 , grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0);
|
||||||
|
grScreens[2]->activate(grWinx, grWiny, grWinw / 3, grWinh / 2, 0.0);
|
||||||
|
grScreens[3]->activate(grWinx + grWinw / 3, grWiny, grWinw / 3, grWinh / 2, 0.0);
|
||||||
|
grScreens[4]->activate(grWinx + grWinw * 2/3, grWiny, grWinw / 3, grWinh / 2, 0.0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
// All side by side
|
// All side by side
|
||||||
grScreens[0]->activate(grWinx, grWiny, grWinw / 5, grWinh, -2.0 + 10);
|
grScreens[0]->activate(grWinx, grWiny, grWinw / 5, grWinh, -2.0 + 10);
|
||||||
grScreens[1]->activate(grWinx + grWinw / 5, grWiny, grWinw / 5, grWinh, -1.0 + 10);
|
grScreens[1]->activate(grWinx + grWinw / 5, grWiny, grWinw / 5, grWinh, -1.0 + 10);
|
||||||
|
@ -296,15 +304,6 @@ grAdaptScreenSize(void)
|
||||||
default:
|
default:
|
||||||
grNbArrangeScreens = 0;
|
grNbArrangeScreens = 0;
|
||||||
case 0:
|
case 0:
|
||||||
// All side by side
|
|
||||||
grScreens[0]->activate(grWinx, grWiny, grWinw / 6, grWinh, -2.5 + 10);
|
|
||||||
grScreens[1]->activate(grWinx + grWinw / 6, grWiny, grWinw / 6, grWinh, -1.5 + 10);
|
|
||||||
grScreens[2]->activate(grWinx + grWinw * 2/6, grWiny, grWinw / 6, grWinh, -0.5 + 10);
|
|
||||||
grScreens[3]->activate(grWinx + grWinw * 3/6, grWiny, grWinw / 6, grWinh, 0.5 + 10);
|
|
||||||
grScreens[4]->activate(grWinx + grWinw * 4/6, grWiny, grWinw / 6, grWinh, 1.5 + 10);
|
|
||||||
grScreens[5]->activate(grWinx + grWinw * 5/6, grWiny, grWinw / 6, grWinh, 2.5 + 10);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
// Top/Bottom Left/Middle/Rigth Matrix
|
// Top/Bottom Left/Middle/Rigth Matrix
|
||||||
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 3, grWinh / 2, 0.0);
|
grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 3, grWinh / 2, 0.0);
|
||||||
grScreens[1]->activate(grWinx + grWinw / 3, grWiny + grWinh / 2, grWinw / 3, grWinh / 2, 0.0);
|
grScreens[1]->activate(grWinx + grWinw / 3, grWiny + grWinh / 2, grWinw / 3, grWinh / 2, 0.0);
|
||||||
|
@ -313,6 +312,15 @@ grAdaptScreenSize(void)
|
||||||
grScreens[4]->activate(grWinx + grWinw / 3, grWiny, grWinw / 3, grWinh / 2, 0.0);
|
grScreens[4]->activate(grWinx + grWinw / 3, grWiny, grWinw / 3, grWinh / 2, 0.0);
|
||||||
grScreens[5]->activate(grWinx + grWinw * 2/3, grWiny, grWinw / 3, grWinh / 2, 0.0);
|
grScreens[5]->activate(grWinx + grWinw * 2/3, grWiny, grWinw / 3, grWinh / 2, 0.0);
|
||||||
break;
|
break;
|
||||||
|
case 1:
|
||||||
|
// All side by side
|
||||||
|
grScreens[0]->activate(grWinx, grWiny, grWinw / 6, grWinh, -2.5 + 10);
|
||||||
|
grScreens[1]->activate(grWinx + grWinw / 6, grWiny, grWinw / 6, grWinh, -1.5 + 10);
|
||||||
|
grScreens[2]->activate(grWinx + grWinw * 2/6, grWiny, grWinw / 6, grWinh, -0.5 + 10);
|
||||||
|
grScreens[3]->activate(grWinx + grWinw * 3/6, grWiny, grWinw / 6, grWinh, 0.5 + 10);
|
||||||
|
grScreens[4]->activate(grWinx + grWinw * 4/6, grWiny, grWinw / 6, grWinh, 1.5 + 10);
|
||||||
|
grScreens[5]->activate(grWinx + grWinw * 5/6, grWiny, grWinw / 6, grWinh, 2.5 + 10);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
for (i=6; i < GR_NB_MAX_SCREEN; i++)
|
for (i=6; i < GR_NB_MAX_SCREEN; i++)
|
||||||
grScreens[i]->deactivate();
|
grScreens[i]->deactivate();
|
||||||
|
@ -330,12 +338,12 @@ grSplitScreen(void *vp)
|
||||||
case GR_SPLIT_ADD:
|
case GR_SPLIT_ADD:
|
||||||
if (grNbActiveScreens < GR_NB_MAX_SCREEN)
|
if (grNbActiveScreens < GR_NB_MAX_SCREEN)
|
||||||
grNbActiveScreens++;
|
grNbActiveScreens++;
|
||||||
grNbArrangeScreens=1;
|
grNbArrangeScreens=0;
|
||||||
break;
|
break;
|
||||||
case GR_SPLIT_REM:
|
case GR_SPLIT_REM:
|
||||||
if (grNbActiveScreens > 1)
|
if (grNbActiveScreens > 1)
|
||||||
grNbActiveScreens--;
|
grNbActiveScreens--;
|
||||||
grNbArrangeScreens=1;
|
grNbArrangeScreens=0;
|
||||||
break;
|
break;
|
||||||
case GR_SPLIT_ARR:
|
case GR_SPLIT_ARR:
|
||||||
grNbArrangeScreens++;
|
grNbArrangeScreens++;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include <tgfclient.h>
|
#include <tgfclient.h>
|
||||||
|
|
||||||
#include <displayconfig.h>
|
#include <displayconfig.h>
|
||||||
|
#include <monitorconfig.h>
|
||||||
#include <graphconfig.h>
|
#include <graphconfig.h>
|
||||||
#include <openglconfig.h>
|
#include <openglconfig.h>
|
||||||
#include <soundconfig.h>
|
#include <soundconfig.h>
|
||||||
|
@ -38,6 +39,12 @@ onDisplayMenuActivate(void * /* dummy */)
|
||||||
GfuiScreenActivate(DisplayMenuInit(MenuHandle));
|
GfuiScreenActivate(DisplayMenuInit(MenuHandle));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
onMonitorMenuActivate(void * /* dummy */)
|
||||||
|
{
|
||||||
|
GfuiScreenActivate(MonitorMenuInit(MenuHandle));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
onGraphMenuActivate(void * /* dummy */)
|
onGraphMenuActivate(void * /* dummy */)
|
||||||
{
|
{
|
||||||
|
@ -80,7 +87,11 @@ OptionsMenuInit(void *prevMenu)
|
||||||
|
|
||||||
GfuiMenuCreateStaticControls(MenuHandle, param);
|
GfuiMenuCreateStaticControls(MenuHandle, param);
|
||||||
|
|
||||||
|
#if 0 // SDW hack to get access to Monitor menu, doesn't have a defined position yet
|
||||||
|
GfuiMenuCreateButtonControl(MenuHandle, param, "display", NULL, onMonitorMenuActivate);
|
||||||
|
#else
|
||||||
GfuiMenuCreateButtonControl(MenuHandle, param, "display", NULL, onDisplayMenuActivate);
|
GfuiMenuCreateButtonControl(MenuHandle, param, "display", NULL, onDisplayMenuActivate);
|
||||||
|
#endif
|
||||||
GfuiMenuCreateButtonControl(MenuHandle, param, "graphic", NULL, onGraphMenuActivate);
|
GfuiMenuCreateButtonControl(MenuHandle, param, "graphic", NULL, onGraphMenuActivate);
|
||||||
GfuiMenuCreateButtonControl(MenuHandle, param, "opengl", NULL, onOpenGLMenuActivate);
|
GfuiMenuCreateButtonControl(MenuHandle, param, "opengl", NULL, onOpenGLMenuActivate);
|
||||||
GfuiMenuCreateButtonControl(MenuHandle, param, "sound", NULL, onSoundMenuActivate);
|
GfuiMenuCreateButtonControl(MenuHandle, param, "sound", NULL, onSoundMenuActivate);
|
||||||
|
|
Loading…
Reference in a new issue