Exemple #1
0
GR2ImportImpl::GR2ImportImpl(GR2Importer *owner) : o(owner), gr2(NULL), GrannyConvertFileToRaw(NULL), wtm(true)
{
   string granny2 = GetSetting<string>("Granny2Loc");
   gr2 = GetModuleHandle("granny2.dll");
   if (gr2 == NULL)
      gr2 = LoadLibrary(granny2.c_str());
   if (gr2 == NULL)
      gr2 = LoadLibrary("granny2.dll");
   if (gr2 == NULL)
      throw runtime_error(FormatString("Unable to locate file: granny2.dll"));
   GrannyConvertFileToRaw = (fnGrannyConvertFileToRaw)GetProcAddress(gr2, "_GrannyConvertFileToRaw@8");
   if (GrannyConvertFileToRaw == NULL)
      throw runtime_error(FormatString("Unable to locate entry point: GrannyConvertFileToRaw"));

   ParamBlockDesc2 *params = GetNWN2ImportDesc()->GetParamBlockDescByName("parameters");
   boneMatch = TokenizeString(params->GetStr(IMP_PB_BONEMATCH), ";", true);
   faceBoneMatch = TokenizeString(params->GetStr(IMP_PB_FACEBONEMATCH), ";", true);
   clearAnimation = TRUE;

	enableScale = owner->GetIniValue<BOOL>(MDBImport, "EnableScale", 1);
	scaleFactor = owner->GetIniValue<float>(MDBImport, "ScaleFactor", 100.f);
	enableAnimation = owner->GetIniValue<BOOL>(GR2Import, "EnableAnimation", 0);
}