src/game/Editor/Road_Smoothing.cc
void ReplaceObsoleteRoads()
{
	INT32 i;
	INT32 iMacro;
	LEVELNODE *pObject;
	BOOLEAN fRoadExistsAtGridNo;
	for( i = 0; i < WORLD_MAX; i++ )
	{
		pObject = gpWorldLevelData[ i ].pObjectHead;
		fRoadExistsAtGridNo = FALSE;
		while( pObject )
		{
			if( pObject->usIndex >= FIRSTROAD1 && pObject->usIndex <= FIRSTROAD32 )
			{
				fRoadExistsAtGridNo = TRUE;
				iMacro = pObject->usIndex - FIRSTROAD1;
				PlaceRoadMacroAtGridNo( i, iMacro );
			}
			pObject = pObject->pNext;
		}
		if( fRoadExistsAtGridNo )
		{
			RemoveAllObjectsOfTypeRange( i, FIRSTROAD, FIRSTROAD );
		}
	}
}
//The old road system used multi-tiled roads as a single image.  The new road system has taken these large
//pieces and chopped them up into single tiled images (to mitigate lighting problems).  Some of the larger
//road pieces turned into 18 smaller pieces.  So this function will go analyse the world, and replaces any
//locations containing the original road tile information, delete it, and replace it by inserting it's
//equivalent macro.
The old road system used multi-tiled roads as a single image.  The new road system has taken these large
pieces and chopped them up into single tiled images (to mitigate lighting problems).  Some of the larger
road pieces turned into 18 smaller pieces.  So this function will go analyse the world, and replaces any
locations containing the original road tile information, delete it, and replace it by inserting it's
equivalent macro.
The old road system used multi - tiled roads as a single image . The new road system has taken these large pieces and chopped them up into single tiled images ( to mitigate lighting problems ) . Some of the larger road pieces turned into 18 smaller pieces . So this function will go analyse the world and replaces any locations containing the original road tile information delete it and replace it by inserting it ' s equivalent macro .
void ReplaceObsoleteRoads()
{
	INT32 i;
	INT32 iMacro;
	LEVELNODE *pObject;
	BOOLEAN fRoadExistsAtGridNo;
	for( i = 0; i < WORLD_MAX; i++ )
	{
		pObject = gpWorldLevelData[ i ].pObjectHead;
		fRoadExistsAtGridNo = FALSE;
		while( pObject )
		{
			if( pObject->usIndex >= FIRSTROAD1 && pObject->usIndex <= FIRSTROAD32 )
			{
				fRoadExistsAtGridNo = TRUE;
				iMacro = pObject->usIndex - FIRSTROAD1;
				PlaceRoadMacroAtGridNo( i, iMacro );
			}
			pObject = pObject->pNext;
		}
		if( fRoadExistsAtGridNo )
		{
			RemoveAllObjectsOfTypeRange( i, FIRSTROAD, FIRSTROAD );
		}
	}
}
void ReplaceObsoleteRoads ( ) { INT32 i ; INT32 iMacro ; LEVELNODE * pObject ; BOOLEAN fRoadExistsAtGridNo ; for ( i = 0 ; i < WORLD_MAX ; i ++ ) { pObject = gpWorldLevelData [ i ] . pObjectHead ; fRoadExistsAtGridNo = FALSE ; while ( pObject ) { if ( pObject -> usIndex >= FIRSTROAD1 && pObject -> usIndex <= FIRSTROAD32 ) { fRoadExistsAtGridNo = TRUE ; iMacro = pObject -> usIndex - FIRSTROAD1 ; PlaceRoadMacroAtGridNo ( i , iMacro ) ; } pObject = pObject -> pNext ; } if ( fRoadExistsAtGridNo ) { RemoveAllObjectsOfTypeRange ( i , FIRSTROAD , FIRSTROAD ) ; } } }
The old road system used multi-tiled roads as a single image.
The old road system used multi - tiled roads as a single image .