void Core_LoadCallback(void * reserved)
{
	ResetGlobals ();

	OBSESerializationInterface* intfc = &g_OBSESerializationInterface;
	UInt32 type, version, length;

	while (intfc->GetNextRecordInfo(&type, &version, &length))
	{
		switch (type)
		{
		case 'STVS':
		case 'STVR':
		case 'STVE':
		case 'ARVS':
		case 'ARVR':
		case 'ARVE':
		case 'MODS':	
			break;		// processed during preload
		case 'GLOB':
			ReadGlobals (intfc, length);
			break;
		default:
			_MESSAGE("Unhandled chunk type in LoadCallback: %d", type);
			continue;
		}
	}
}
void Core_PreloadCallback(void * reserved)
{
	// this is invoked only if at least one other plugin registers a preload callback
	
	// reset refID fixup table. if save made prior to 0019, this will remain empty
	s_numPreloadMods = 0;	// no need to zero out table - unloaded mods will be set to 0xFF below

	OBSESerializationInterface* intfc = &g_OBSESerializationInterface;

	g_ArrayMap.Preload();
	g_StringMap.Preload();

	UInt32 type, version, length;

	while (intfc->GetNextRecordInfo(&type, &version, &length)) {
		switch (type) {
			case 'MODS':
				// as of 0019 mod list stored in co-save
				ReadModListFromCoSave(intfc);
				break;
			case 'STVS':
				if (!s_numPreloadMods) {
					// pre-0019 co-save doesn't contain mod list, read from .ess instead
					ReadModListFromSaveGame((const char*)reserved);
				}

				g_StringMap.Load(intfc);
				break;
			case 'ARVS':
				if (!s_numPreloadMods) {
					// pre-0019 co-save doesn't contain mod list, read from .ess instead
					ReadModListFromSaveGame((const char*)reserved);
				}

				g_ArrayMap.Load(intfc);
				break;
			default:
				break;
		}
	}
}