diff --git a/src/modules/graphic/ssggraph/grmain.cpp b/src/modules/graphic/ssggraph/grmain.cpp index 32d98f199..6f1322885 100644 --- a/src/modules/graphic/ssggraph/grmain.cpp +++ b/src/modules/graphic/ssggraph/grmain.cpp @@ -56,7 +56,7 @@ int grWinx, grWiny, grWinw, grWinh; tgrCarInfo *grCarInfo; ssgContext grContext; -cGrScreen *grScreens[GR_NB_MAX_SCREEN] = { 0, 0, 0, 0 }; +cGrScreen *grScreens[GR_NB_MAX_SCREEN]; tdble grLodFactorValue = 1.0; // Frame/FPS info. @@ -135,7 +135,12 @@ grAdaptScreenSize(void) case 2: switch (grNbArrangeScreens) { default: - grNbArrangeScreens = 1; + grNbArrangeScreens = 0; + case 0: + // Left & Right half of the window + grScreens[0]->activate(grWinx, grWiny, grWinw / 2, grWinh, -0.5); + grScreens[1]->activate(grWinx + grWinw / 2, grWiny, grWinw / 2, grWinh, 0.5); + break; case 1: // Top & Bottom half of the window grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw, grWinh / 2, 0.0); @@ -151,11 +156,6 @@ grAdaptScreenSize(void) grScreens[0]->activate(grWinx, grWiny, grWinw * 2/3, grWinh, 0.0); grScreens[1]->activate(grWinx + grWinw * 2/3, grWiny, grWinw / 3, grWinh, 0.0); break; - case 0: - // Left & Right half of the window - grScreens[0]->activate(grWinx, grWiny, grWinw / 2, grWinh, -0.5); - grScreens[1]->activate(grWinx + grWinw / 2, grWiny, grWinw / 2, grWinh, 0.5); - break; } for (i=2; i < GR_NB_MAX_SCREEN; i++) @@ -164,7 +164,13 @@ grAdaptScreenSize(void) case 3: switch (grNbArrangeScreens) { default: - grNbArrangeScreens = 1; + grNbArrangeScreens = 0; + case 0: + // All side by side + grScreens[0]->activate(grWinx, grWiny, grWinw / 3, grWinh, -1); + grScreens[1]->activate(grWinx + grWinw / 3, grWiny, grWinw / 3, grWinh, 0.0); + grScreens[2]->activate(grWinx + grWinw * 2/3, grWiny, grWinw / 3, grWinh, 1); + break; case 1: // Left/Right above wide grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0); @@ -201,12 +207,6 @@ grAdaptScreenSize(void) grScreens[1]->activate(grWinx + grWinw / 3, grWiny, grWinw * 2/3, grWinh, 0.0); grScreens[2]->activate(grWinx, grWiny, grWinw / 3, grWinh / 2, 0.0); break; - case 0: - // All side by side - grScreens[0]->activate(grWinx, grWiny, grWinw / 3, grWinh, -1); - grScreens[1]->activate(grWinx + grWinw / 3, grWiny, grWinw / 3, grWinh, 0.0); - grScreens[2]->activate(grWinx + grWinw * 2/3, grWiny, grWinw / 3, grWinh, 1); - break; } for (i=3; i < GR_NB_MAX_SCREEN; i++) grScreens[i]->deactivate(); @@ -214,7 +214,14 @@ grAdaptScreenSize(void) case 4: switch (grNbArrangeScreens) { default: - grNbArrangeScreens = 1; + grNbArrangeScreens = 0; + case 0: + // All side by side + grScreens[0]->activate(grWinx, grWiny, grWinw / 4, grWinh, -1.5); + grScreens[1]->activate(grWinx + grWinw / 4, grWiny, grWinw / 4, grWinh, -0.5); + grScreens[2]->activate(grWinx + grWinw * 2/4, grWiny, grWinw / 4, grWinh, 0.5); + grScreens[3]->activate(grWinx + grWinw * 3/4, grWiny, grWinw / 4, grWinh, 1.5); + break; case 1: // Top/Bottom Left/Rigth Quarters grScreens[0]->activate(grWinx, grWiny + grWinh / 2, grWinw / 2, grWinh / 2, 0.0); @@ -264,19 +271,53 @@ grAdaptScreenSize(void) grScreens[2]->activate(grWinx, grWiny + grWinh / 3 , grWinw / 3, grWinh / 3, 0.0); grScreens[3]->activate(grWinx, grWiny, grWinw / 3, grWinh / 3, 0.0); break; - case 0: - // All side by side - grScreens[0]->activate(grWinx, grWiny, grWinw / 4, grWinh, -1.5); - grScreens[1]->activate(grWinx + grWinw / 4, grWiny, grWinw / 4, grWinh, -0.5); - grScreens[2]->activate(grWinx + grWinw * 2/4, grWiny, grWinw / 4, grWinh, 0.5); - grScreens[3]->activate(grWinx + grWinw * 3/4, grWiny, grWinw / 4, grWinh, 1.5); - break; } - for (i=4; i < GR_NB_MAX_SCREEN; i++) grScreens[i]->deactivate(); - break; - } + break; + case 5: + switch (grNbArrangeScreens) { + default: + grNbArrangeScreens = 0; + case 0: + // All side by side + grScreens[0]->activate(grWinx, grWiny, grWinw / 5, grWinh, -2.0); + grScreens[1]->activate(grWinx + grWinw / 5, grWiny, grWinw / 5, grWinh, -1.0); + grScreens[2]->activate(grWinx + grWinw * 2/5, grWiny, grWinw / 5, grWinh, 0.0); + grScreens[3]->activate(grWinx + grWinw * 3/5, grWiny, grWinw / 5, grWinh, 1.0); + grScreens[4]->activate(grWinx + grWinw * 4/5, grWiny, grWinw / 5, grWinh, 2.0); + break; + } + for (i=5; i < GR_NB_MAX_SCREEN; i++) + grScreens[i]->deactivate(); + break; + case 6: + switch (grNbArrangeScreens) { + default: + grNbArrangeScreens = 0; + case 0: + // All side by side + grScreens[0]->activate(grWinx, grWiny, grWinw / 6, grWinh, -2.5); + grScreens[1]->activate(grWinx + grWinw / 6, grWiny, grWinw / 6, grWinh, -1.5); + grScreens[2]->activate(grWinx + grWinw * 2/6, grWiny, grWinw / 6, grWinh, -0.5); + grScreens[3]->activate(grWinx + grWinw * 3/6, grWiny, grWinw / 6, grWinh, 0.5); + grScreens[4]->activate(grWinx + grWinw * 4/6, grWiny, grWinw / 6, grWinh, 1.5); + grScreens[5]->activate(grWinx + grWinw * 5/6, grWiny, grWinw / 6, grWinh, 2.5); + break; + case 1: + // Top/Bottom Left/Middle/Rigth Matrix + 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[2]->activate(grWinx + grWinw * 2/3, grWiny + grWinh / 2, grWinw / 3, grWinh / 2, 0.0); + grScreens[3]->activate(grWinx, 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); + break; + } + for (i=6; i < GR_NB_MAX_SCREEN; i++) + grScreens[i]->deactivate(); + break; + } } static void diff --git a/src/modules/graphic/ssggraph/grmain.h b/src/modules/graphic/ssggraph/grmain.h index 0c63d5a48..52e4acf31 100644 --- a/src/modules/graphic/ssggraph/grmain.h +++ b/src/modules/graphic/ssggraph/grmain.h @@ -81,7 +81,7 @@ extern class cGrScreen* grGetCurrentScreen(void); #define GR_NEXT_SCREEN 0 #define GR_PREV_SCREEN 1 -#define GR_NB_MAX_SCREEN 4 +#define GR_NB_MAX_SCREEN 6 extern tdble grLodFactorValue;