diff --git a/CppOutRun.layout b/CppOutRun.layout
index e5bf66f..aa081e1 100644
--- a/CppOutRun.layout
+++ b/CppOutRun.layout
@@ -2,14 +2,39 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
@@ -17,7 +42,17 @@
-
+
+
+
+
+
+
+
+
+
+
+
@@ -27,14 +62,14 @@
-
+
-
+
-
+
@@ -48,37 +83,38 @@
-
+
+
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
@@ -94,79 +130,46 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
+
+
+
+
+
diff --git a/src/include/circuit.h b/src/include/circuit.h
index e2e6999..b0b83e7 100644
--- a/src/include/circuit.h
+++ b/src/include/circuit.h
@@ -68,10 +68,7 @@ void createTraffic( uint16_t maxSegment );
void projectCircuitFP( void );
void projectCircuitFP( uint16_t index );
-void updateTraffic( float dt, uint32_t maxdistance );
-
-void printCircuit( void );
-void printCircuit( int i );
+void updateTraffic( float dt, double maxdistance );
void drawCircuitSegment( uint16_t index );
void drawDecoration( uint16_t index );
diff --git a/src/main.cc b/src/main.cc
index 791a4fa..176abba 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -35,7 +35,7 @@
extern bopti_image_t player;
-extern font_t speedfont, startseq, plate;
+extern font_t speedfont, startseq, plate, autofont;
extern bopti_image_t speedhud;
extern bopti_image_t flag, bigflag;
@@ -72,6 +72,7 @@ extern bool saveexist;
BestRanking HallOfFame[10][5]; // Table of score : 10 levels * 5 best scores
uint32_t FinalTime=0;
bool skipranking=false;
+int ranking = -1; // ranking is -1 if not ranked and between 1 and 5 if ranked
#define MAXDATA 120
DataPerf GraphPerf[ MAXDATA ];
@@ -454,6 +455,7 @@ int main(void)
time_create=0;
time_project=0;
time_render=0;
+ ranking = -1;
exitToOS = false;
@@ -1066,18 +1068,6 @@ int main(void)
if (finishSequence)
{
- speed = 0;
-
- dimage( 198-bigflag.width/2, 112-bigflag.height/2, &bigflag );
-
- dfont(&startseq);
-
- dprint_opt(200,108, C_RGB(0,0,0), C_NONE, DTEXT_CENTER, DTEXT_BOTTOM, "YOU" );
- dprint_opt(198,112, C_RGB(0,255,0), C_NONE, DTEXT_CENTER, DTEXT_BOTTOM, "YOU" );
-
- dprint_opt(200,108, C_RGB(0,0,0), C_NONE, DTEXT_CENTER, DTEXT_TOP, "WIN" );
- dprint_opt(198,112, C_RGB(0,255,0), C_NONE, DTEXT_CENTER, DTEXT_TOP, "WIN" );
-
if (mode==1 && !skipranking)
{
@@ -1122,6 +1112,8 @@ int main(void)
donerank = true;
skipranking = true;
+ ranking = k;
+
gint_world_switch( GINT_CALL( saveprogress ) );
}
@@ -1130,6 +1122,45 @@ int main(void)
}
+ speed = 0;
+
+ dimage( 198-bigflag.width/2, 112-bigflag.height/2, &bigflag );
+
+ if (ranking!=-1)
+ {
+
+ dfont(&startseq);
+
+ dprint_opt(200,108, C_RGB(0,0,0), C_NONE, DTEXT_CENTER, DTEXT_BOTTOM, "YOU" );
+ dprint_opt(198,112, C_RGB(0,255,0), C_NONE, DTEXT_CENTER, DTEXT_BOTTOM, "YOU" );
+
+ dprint_opt(200,108, C_RGB(0,0,0), C_NONE, DTEXT_CENTER, DTEXT_TOP, "WIN", ranking );
+ dprint_opt(198,112, C_RGB(0,255,0), C_NONE, DTEXT_CENTER, DTEXT_TOP, "WIN", ranking );
+
+ dfont(&autofont);
+
+ uint32_t temp1 = FinalTime/1000000/60;
+ uint32_t temp2 = FinalTime/1000000 - temp1*60;
+ uint32_t temp3 = (FinalTime - temp1*60*1000000 - temp2*1000000)/1000;
+ dprint_opt(200, 202, C_RGB(0,0,0), C_NONE, DTEXT_CENTER, DTEXT_TOP, "%d - %D:%D,%D", ranking+1, temp1, temp2, temp3 );
+ dprint_opt(198, 200, C_RGB(255, 255, 255), C_NONE, DTEXT_CENTER, DTEXT_TOP, "%d - %D:%D,%D", ranking+1, temp1, temp2, temp3 );
+
+
+ }
+
+ else
+ {
+
+ dfont(&startseq);
+
+ dprint_opt(200,108, C_RGB(0,0,0), C_NONE, DTEXT_CENTER, DTEXT_BOTTOM, "YOU" );
+ dprint_opt(198,112, C_RGB(255,0,0), C_NONE, DTEXT_CENTER, DTEXT_BOTTOM, "YOU" );
+
+ dprint_opt(200,108, C_RGB(0,0,0), C_NONE, DTEXT_CENTER, DTEXT_TOP, "LOOSE" );
+ dprint_opt(198,112, C_RGB(255,0,0), C_NONE, DTEXT_CENTER, DTEXT_TOP, "LOOSE" );
+
+ }
+
}
diff --git a/src/src/circuit.cc b/src/src/circuit.cc
index f2d7683..51ae06f 100644
--- a/src/src/circuit.cc
+++ b/src/src/circuit.cc
@@ -909,7 +909,7 @@ void addCurvyHill( Length l, HillSize s, HillType t, CurveStrength cs, CurveType
void projectCircuitFP( void )
{
- for( int i=0; iProject3DFP( cam );
}
@@ -922,22 +922,6 @@ void projectCircuitFP( uint16_t index )
};
-void printCircuit( void )
-{
- for( int i=0; i<20; i++)
- {
- dprint(198, 1+10*(i), C_RED, "%d-(sX,Y,W)=(%d,%d,%d)", i, circuit[i]->X, circuit[i]->Y, circuit[i]->W );
- //dprint(1, 1+10*(i), C_GREEN, "%d-(_sY,Y,W)=(%.0f,%.0f,%.0f)", i, circuit[i]->_wX, circuit[i]->_wY, circuit[i]->_sW );
- }
-};
-
-void printCircuit( int i )
-{
- dprint(1, 1+10*(i), C_RED, "%d-(wX,Y,Z)=(%d,%d,%d)", i, fround(circuit[i]->wX), fround(circuit[i]->wY), fround(circuit[i]->wZ) );
- dprint(198, 1+10*(i), C_RED, "%d-(sX,Y,W)=(%d,%d,%d)", i, circuit[i]->X, circuit[i]->Y, circuit[i]->W );
-};
-
-
void drawCircuitSegment( uint16_t index )
{
if (index>=circuit.size()-1) return;
@@ -1317,7 +1301,7 @@ void drawDecoration( uint16_t index )
}
-void updateTraffic( float dt, uint32_t maxdistance )
+void updateTraffic( float dt, double maxdistance )
{
for(unsigned int k=0; k