void HashBase::Serialize(Stream& s) { int version = 0; s / version; if(s.IsLoading()) ClearIndex(); hash.Serialize(s); Reindex(); }
void idBoundsTrack::ClearAll() { maxIndex = 0; for( int i = 0 ; i < MAX_BOUNDS_TRACK_INDEXES ; i++ ) { ClearIndex( i ); } }
void HashBase::Shrink() { hash.Shrink(); if((int)HashBound(hash.GetCount()) < mcount) { ClearIndex(); DoIndex(); } else link.Shrink(); }
void HashBase::Reindex(int n) { ClearIndex(); Free(); mcount = n = HashBound(n); map = (int *)new byte[n * sizeof(int)]; Fill(map, map + n, -1); FinishIndex(); }
void SIFLoader::CloseFile() { ClearIndex(); if (fFP) { cclose(fFP); fFP = NULL; } }
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; }
SIFLoader::~SIFLoader() { ClearIndex(); if (fFP) cclose(fFP); }
void SDTSAttrReader::Close() { ClearIndex(); oDDFModule.Close(); }
void HashBase::operator<<=(const HashBase& b) { ClearIndex(); hash <<= b.hash; Reindex(); }
void HashBase::Insert(int i, unsigned _hash) { hash.Insert(i, _hash & ~UNSIGNED_HIBIT); ClearIndex(); Reindex(); }
void HashBase::Remove(const int *sorted_list, int count) { hash.Remove(sorted_list, count); ClearIndex(); Reindex(); }
void HashBase::Remove(int i, int count) { hash.Remove(i, count); ClearIndex(); Reindex(); }
void HashBase::Remove(int i) { hash.Remove(i); ClearIndex(); Reindex(); }