Improved traces to follow race engine state changes

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@2898 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 5b08b88afa75bc33095fc4c50603fcc474ec260a
Former-commit-id: 527aa62274d07f8f1f50f1a56eee86b0ab84e36c
This commit is contained in:
pouillot 2010-10-16 16:34:51 +00:00
parent 7a1e43792e
commit 00b35091eb
2 changed files with 12 additions and 12 deletions

View file

@ -212,7 +212,7 @@ static void ReCalculateClassPoints(char const *race)
do {
snprintf( path2, 1024, "%s/%s", race, RM_SECT_CLASSPOINTS );
if (GfParmListSeekFirst( ReInfo->params, path2 ) != 0) {
printf( "First not found (path2 = %s)\n", path2 );
GfLogDebug( "First not found (path2 = %s)\n", path2 );
continue;
}
do {
@ -225,8 +225,8 @@ static void ReCalculateClassPoints(char const *race)
points = GfParmGetNum (ReInfo->results, path, RE_ATTR_POINTS, NULL, 0);
GfParmSetVariable (ReInfo->params, buf, "pos", rank);
GfParmSetVariable (ReInfo->params, buf, "cars", count);
printf( "pos = %d; count = %d\n", rank, count);
printf( "GfParmGetNum (..., %s, %s, NULL, 0)\n", buf, RM_ATTR_POINTS );
GfLogDebug( "pos = %d; count = %d\n", rank, count);
GfLogDebug( "GfParmGetNum (..., %s, %s, NULL, 0)\n", buf, RM_ATTR_POINTS );
points += ( GfParmGetNum (ReInfo->params, buf, RM_ATTR_POINTS, NULL, 0) /
GfParmGetNum (ReInfo->params, RM_SECT_TRACKS, RM_ATTR_NUMBER, NULL, 1) );
GfParmRemoveVariable (ReInfo->params, buf, "pos");

View file

@ -62,7 +62,7 @@ ReStateManage(void)
do {
switch (ReInfo->_reState) {
case RE_STATE_CONFIG:
GfOut("RaceEngine: state = RE_STATE_CONFIG\n");
GfLogInfo("%s now in CONFIG state\n", ReInfo->_reName);
/* Display the race specific menu */
mode = ReRacemanMenu();
if (mode & RM_NEXT_STEP) {
@ -71,7 +71,7 @@ ReStateManage(void)
break;
case RE_STATE_EVENT_INIT:
GfOut("RaceEngine: state = RE_STATE_EVENT_INIT\n");
GfLogInfo("%s now in EVENT_INIT state\n", ReInfo->_reName);
/* Load the event description (track and drivers list) */
mode = ReRaceEventInit();
if (mode & RM_NEXT_STEP) {
@ -80,7 +80,7 @@ ReStateManage(void)
break;
case RE_STATE_PRE_RACE:
GfOut("RaceEngine: state = RE_STATE_PRE_RACE\n");
GfLogInfo("%s now in PRE_RACE state\n", ReInfo->_reName);
mode = RePreRace();
if (mode & RM_NEXT_RACE) {
if (mode & RM_NEXT_STEP) {
@ -92,7 +92,7 @@ ReStateManage(void)
break;
case RE_STATE_RACE_START:
GfOut("RaceEngine: state = RE_STATE_RACE_START\n");
GfLogInfo("%s now in RACE_START state\n", ReInfo->_reName);
mode = ReRaceStart();
if (mode & RM_NEXT_STEP) {
@ -120,7 +120,7 @@ ReStateManage(void)
break;
case RE_STATE_RACE_STOP:
GfOut("RaceEngine: state = RE_STATE_RACE_STOP\n");
GfLogInfo("%s now in RACE_STOP state\n", ReInfo->_reName);
/* Race was interrupted (paused) by the player */
mode = ReRaceStop();
if (mode & RM_NEXT_STEP) {
@ -129,7 +129,7 @@ ReStateManage(void)
break;
case RE_STATE_RACE_END:
GfOut("RaceEngine: state = RE_STATE_RACE_END\n");
GfLogInfo("%s now in RACE_END state\n", ReInfo->_reName);
mode = ReRaceEnd();
if (mode & RM_NEXT_STEP) {
ReInfo->_reState = RE_STATE_POST_RACE;
@ -139,7 +139,7 @@ ReStateManage(void)
break;
case RE_STATE_POST_RACE:
GfOut("RaceEngine: state = RE_STATE_POST_RACE\n");
GfLogInfo("%s now in POST_RACE state\n", ReInfo->_reName);
mode = RePostRace();
if (mode & RM_NEXT_STEP) {
ReInfo->_reState = RE_STATE_EVENT_SHUTDOWN;
@ -149,7 +149,7 @@ ReStateManage(void)
break;
case RE_STATE_EVENT_SHUTDOWN:
GfOut("RaceEngine: state = RE_STATE_EVENT_SHUTDOWN\n");
GfLogInfo("%s now in EVENT_SHUTDOWN state\n", ReInfo->_reName);
mode = ReEventShutdown();
if (mode & RM_NEXT_STEP) {
@ -161,7 +161,7 @@ ReStateManage(void)
case RE_STATE_SHUTDOWN:
case RE_STATE_ERROR:
GfOut("RaceEngine: state = RE_STATE_SHUTDOWN\n");
GfLogInfo("%s now in SHUTDOWN state\n", ReInfo->_reName);
/* Back to race menu */
ReInfo->_reState = RE_STATE_CONFIG;
mode = RM_SYNC;