Exemple #1
0
void ReRaceAbort()
{
	ReShutdownUpdaters();

	RePhysicsEngine().shutdown();
	RaceEngine::self().unloadPhysicsEngine();

	ReUI().onRaceFinishing();

	ReRaceCleanDrivers();

	if (NetGetNetwork())
		NetGetNetwork()->Disconnect();

	FREEZ(ReInfo->_reCarInfo);
	
	if (ReInfo->params != ReInfo->mainParams)
	{
		GfParmReleaseHandle(ReInfo->params);
		ReInfo->params = ReInfo->mainParams;
	}

	// Return to race configuration step
	ReStateApply((void*)RE_STATE_CONFIG);
}
Exemple #2
0
void ReRaceRestart()
{
	ReShutdownUpdaters();

	ReUI().onRaceFinishing();
	
	ReRaceCleanup();

	ReStateApply((void*)RE_STATE_PRE_RACE);
}
Exemple #3
0
// Start configuring the race
void
ReRaceConfigure(bool bInteractive)
{
	// Update race engine info.
	ReInfo->mainParams = ReInfo->params =
		StandardGame::self().race()->getManager()->getDescriptorHandle();
	
	GfParmRemoveVariable(ReInfo->params, "/", "humanInGroup");
	GfParmSetVariable(ReInfo->params, "/", "humanInGroup", ReHumanInGroup() ? 1.0f : 0.0f);
	
	// Enter CONFIG state and return to the race engine automaton if interactive mode.
	if (bInteractive)
		ReStateApply((void*)RE_STATE_CONFIG);
}
/* Launch a race manager */
static void reSelectRaceman(void *params)
{
	char *s, *e, *m;

	ReInfo->params = params;
	FREEZ(ReInfo->_reFilename);

	s = GfParmGetFileName(params);
	while ((m = strstr(s, "/")) != 0) {
		s = m + 1;
	}

	e = strstr(s, PARAMEXT);
	ReInfo->_reFilename = strndup(s, e-s+1);
	ReInfo->_reFilename[e-s] = '\0';
	ReInfo->_reName = GfParmGetStr(params, RM_SECT_HEADER, RM_ATTR_NAME, "");
	ReStateApply(RE_STATE_CONFIG);
}
Exemple #5
0
void ReRaceAbandon()
{
	// Notify the UI that the race event is finishing now.
	ReUI().onRaceEventFinishing();

	// Shutdown track-physics-related stuff.
	ReTrackShutdown();

	// Cleanup needed stuff.
	FREEZ(ReInfo->_reCarInfo);

	if (ReInfo->params != ReInfo->mainParams)
	{
		GfParmReleaseHandle(ReInfo->params);
		ReInfo->params = ReInfo->mainParams;
	}

	// Return to race configuration step
	ReStateApply((void*)RE_STATE_CONFIG);
}
Exemple #6
0
// Start a new race for the previously configured race manager
void
ReStartNewRace()
{
	// Save the race settings to the race manager file is anything changed.
	GfRace* pRace = StandardGame::self().race();
	if (pRace->isDirty())
	{
		pRace->store(); // Save data to params.
		GfParmWriteFile(NULL, ReInfo->params, ReInfo->_reName); // Save params to disk.
	}

	// Initialize the result system (different way for the Career mode).
	if (pRace->getManager()->hasSubFiles())
		ReCareerNew();
	else
		ReInitResults();

	// Enter EVENT_INIT state and return to the race engine automaton.
	ReStateApply((void*)RE_STATE_EVENT_INIT);
}
Exemple #7
0
void ReRaceSkipSession()
{
	ReStateApply((void*)RE_STATE_RACE_END);
}