Game Development Reference
In-Depth Information
entry->m_filename = getFilename( line );
m_file_list.push( entry );
}
// Mark the file as opened.
entry->m_opened = true;
break;
}
case ( FILE_READ ):
{
// First mark the entry as being read and
// increment the number of times this file is
// read.
FileEntry * entry =
file_list.find( getFilename( line ) );
entry->m_reading = true;
++entry->m_num_reads;
// Now we need to see if there are any other
// file entries which are currently reading.
// If there are then we need to add this
// occurrence of an overlap to our list.
Iterator< FileEntry* > ent_it =
file_list.start();
while (;ent_it != file_list.end(); ++ent_it)
{
if ( (*ent_it) != entry )
{
if ( (*ent_it)->m_reading )
{
recordClash( entry, (*ent_it );
}
}
}
break;
}
case ( FILE_SEEK ):
{
// Perform nothing at this time.
break;
}
case ( FILE_READ_COMPLETE ):
{
// Mark the entry as no longer being read.
FileEntry * entry =
file_list.find( getFilename( line ) );
entry->m_reading = false;
break;
}
case ( FILE_CLOSE ):
{
FileEntry * entry;
entry = file_list.find( getFilename( line ) );
entry->m_opened = false;
break;
}
}
}
}
// Record this clash of reads. This is where both files are
Search WWH ::




Custom Search