Esempio n. 1
0
void HashBase::Serialize(Stream& s) {
	int version = 0;
	s / version;
	if(s.IsLoading())
		ClearIndex();
	hash.Serialize(s);
	Reindex();
}
Esempio n. 2
0
void idBoundsTrack::ClearAll()
{
	maxIndex = 0;
	for( int i = 0 ; i < MAX_BOUNDS_TRACK_INDEXES ; i++ )
	{
		ClearIndex( i );
	}
}
Esempio n. 3
0
void HashBase::Shrink() {
	hash.Shrink();
	if((int)HashBound(hash.GetCount()) < mcount) {
		ClearIndex();
		DoIndex();
	}
	else
		link.Shrink();
}
Esempio n. 4
0
void HashBase::Reindex(int n)
{
	ClearIndex();
	Free();
	mcount = n = HashBound(n);
	map = (int *)new byte[n * sizeof(int)];
	Fill(map, map + n, -1);
	FinishIndex();
}
Esempio n. 5
0
void SIFLoader::CloseFile()
{
	ClearIndex();
	
	if (fFP)
	{
		cclose(fFP);
		fFP = NULL;
	}
}
Esempio n. 6
0
bool SIFLoader::LoadHeader(const char *filename)
{
CFILE *fp;
uint32_t magick;

	ClearIndex();
	
	if (fFP) cclose(fFP);
	fp = fFP = copen(filename, "rb");
	
	if (!fp)
	{
		NX_ERR("SIFLoader::LoadHeader: failed to open file '%s'\n", filename);
		return 1;
	}
	
	if ((magick = cgetl(fp)) != SIF_MAGICK)
	{
		NX_ERR("SIFLoader::LoadHeader: magick check failed--this isn't a SIF file or is wrong version?\n");
		NX_ERR(" (expected %08x, got %08x)\n", SIF_MAGICK, magick);
		return 1;
	}
	
	int nsections = cgetc(fp);
	NX_LOG("SIFLoader::LoadHeader: read index of %d sections\n", nsections);
	
	for(int i=0;i<nsections;i++)
	{
		SIFIndexEntry *entry = new SIFIndexEntry;
		
		entry->type = cgetc(fp);		// section type
		entry->foffset = cgetl(fp);		// absolute offset in file
		entry->length = cgetl(fp);		// length of section data
		entry->data = NULL;				// we won't load it until asked
		
		fIndex.AddItem(entry);
		//NX_LOG("  - Sect%02d @ %04x\n", entry->type, entry->foffset);
	}
	
	// ..leave file handle open, its ok
	return 0;
}
Esempio n. 7
0
SIFLoader::~SIFLoader()
{
	ClearIndex();
	if (fFP) cclose(fFP);
}
Esempio n. 8
0
void SDTSAttrReader::Close()

{
    ClearIndex();
    oDDFModule.Close();
}
Esempio n. 9
0
void HashBase::operator<<=(const HashBase& b)
{
	ClearIndex();
	hash <<= b.hash;
	Reindex();
}
Esempio n. 10
0
void HashBase::Insert(int i, unsigned _hash) {
	hash.Insert(i, _hash & ~UNSIGNED_HIBIT);
	ClearIndex();
	Reindex();
}
Esempio n. 11
0
void HashBase::Remove(const int *sorted_list, int count)
{
	hash.Remove(sorted_list, count);
	ClearIndex();
	Reindex();
}
Esempio n. 12
0
void HashBase::Remove(int i, int count)
{
	hash.Remove(i, count);
	ClearIndex();
	Reindex();
}
Esempio n. 13
0
void HashBase::Remove(int i)
{
	hash.Remove(i);
	ClearIndex();
	Reindex();
}