V1.0 Release Candidate

master
Sylvain PILLOT 6 months ago
parent 1a315efc1d
commit a34944e853
  1. 163
      CppOutRun.layout
  2. 5
      src/include/circuit.h
  3. 57
      src/main.cc
  4. 20
      src/src/circuit.cc

@ -2,14 +2,39 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Release" />
<File name="src/src/utils.cc" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/src/clouds.cc" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="30" topLine="0" />
<Cursor1 position="203" topLine="0" />
</Cursor>
</File>
<File name="src/include/camera.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="221" topLine="0" />
</Cursor>
</File>
<File name="src/src/cars.cc" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1019" topLine="8" />
</Cursor>
</File>
<File name="src/parameters.h" open="1" top="1" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="505" topLine="0" />
</Cursor>
</File>
<File name="src/include/saves.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="256" topLine="0" />
<Cursor1 position="264" topLine="0" />
</Cursor>
</File>
<File name="src/include/drawstuff.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="655" topLine="0" />
</Cursor>
</File>
<File name="src/fixed.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="5" topLine="0" />
</Cursor>
</File>
<File name="src/include/segment.h" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@ -17,7 +42,17 @@
<Cursor1 position="783" topLine="3" />
</Cursor>
</File>
<File name="src/src/saves.cc" open="1" top="1" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/include/utils.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="107" topLine="0" />
</Cursor>
</File>
<File name="src/src/camera.cc" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="370" topLine="0" />
</Cursor>
</File>
<File name="src/include/clouds.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="306" topLine="0" />
</Cursor>
@ -27,14 +62,14 @@
<Cursor1 position="410" topLine="29" />
</Cursor>
</File>
<File name="src/include/circuit.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/colors.h" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1686" topLine="0" />
<Cursor1 position="35" topLine="0" />
</Cursor>
</File>
<File name="src/src/menus.cc" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="39199" topLine="146" />
<Cursor1 position="24483" topLine="197" />
</Cursor>
<Folding>
<Collapse line="70" />
@ -48,37 +83,38 @@
<Collapse line="497" />
<Collapse line="520" />
<Collapse line="635" />
<Collapse line="678" />
<Collapse line="796" />
<Collapse line="888" />
<Collapse line="950" />
<Collapse line="1001" />
<Collapse line="1119" />
<Collapse line="1168" />
<Collapse line="1228" />
</Folding>
</File>
<File name="src/include/menus.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="CMakeLists.txt" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="615" topLine="0" />
<Cursor1 position="448" topLine="0" />
</Cursor>
</File>
<File name="CMakeLists.txt" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="TODO.txt" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="448" topLine="0" />
<Cursor1 position="251" topLine="0" />
</Cursor>
</File>
<File name="src/include/clouds.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/src/utils.cc" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="306" topLine="0" />
<Cursor1 position="30" topLine="0" />
</Cursor>
</File>
<File name="src/colors.h" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/src/saves.cc" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="35" topLine="0" />
<Cursor1 position="306" topLine="2" />
</Cursor>
</File>
<File name="src/include/cars.h" open="0" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/main.cc" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="-2" zoom_2="0">
<Cursor>
<Cursor1 position="412" topLine="1" />
<Cursor1 position="7487" topLine="337" />
</Cursor>
</File>
<File name="src/src/drawstuff.cc" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@ -94,79 +130,46 @@
<Collapse line="131" />
</Folding>
</File>
<File name="TODO.txt" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="251" topLine="0" />
</Cursor>
</File>
<File name="src/src/cars.cc" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1019" topLine="8" />
</Cursor>
</File>
<File name="src/fixed.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="5" topLine="0" />
</Cursor>
</File>
<File name="src/parameters.h" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="355" topLine="0" />
</Cursor>
</File>
<File name="src/include/drawstuff.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="655" topLine="0" />
</Cursor>
</File>
<File name="src/main.cc" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="-2" zoom_2="0">
<Cursor>
<Cursor1 position="39899" topLine="1082" />
</Cursor>
</File>
<File name="src/src/camera.cc" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="370" topLine="0" />
</Cursor>
</File>
<File name="src/include/camera.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="221" topLine="0" />
</Cursor>
</File>
<File name="src/src/circuit.cc" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="448" topLine="0" />
<Cursor1 position="31927" topLine="266" />
</Cursor>
<Folding>
<Collapse line="68" />
<Collapse line="357" />
<Collapse line="385" />
<Collapse line="413" />
<Collapse line="441" />
<Collapse line="471" />
<Collapse line="644" />
<Collapse line="692" />
<Collapse line="702" />
<Collapse line="751" />
<Collapse line="801" />
<Collapse line="852" />
<Collapse line="925" />
<Collapse line="962" />
<Collapse line="1254" />
<Collapse line="1261" />
<Collapse line="1271" />
<Collapse line="1281" />
<Collapse line="102" />
<Collapse line="154" />
<Collapse line="192" />
<Collapse line="229" />
<Collapse line="274" />
<Collapse line="292" />
<Collapse line="381" />
<Collapse line="554" />
<Collapse line="602" />
<Collapse line="612" />
<Collapse line="661" />
<Collapse line="711" />
<Collapse line="762" />
<Collapse line="835" />
<Collapse line="872" />
<Collapse line="1148" />
<Collapse line="1155" />
<Collapse line="1165" />
<Collapse line="1175" />
</Folding>
</File>
<File name="src/include/utils.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/include/circuit.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="107" topLine="0" />
<Cursor1 position="1093" topLine="57" />
</Cursor>
</File>
<File name="src/src/clouds.cc" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/include/menus.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="203" topLine="0" />
<Cursor1 position="505" topLine="0" />
</Cursor>
</File>
<File name="src/include/cars.h" open="0" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="412" topLine="1" />
</Cursor>
</File>
</CodeBlocks_layout_file>

@ -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 );

@ -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" );
}
}

@ -909,7 +909,7 @@ void addCurvyHill( Length l, HillSize s, HillType t, CurveStrength cs, CurveType
void projectCircuitFP( void )
{
for( int i=0; i<circuit.size(); i++)
for( unsigned int i=0; i<circuit.size(); i++)
{
circuit[i]->Project3DFP( 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<traffic.size(); k++)
{

Loading…
Cancel
Save