Exemplo n.º 1
0
//---------------------------------------------------------------------------
bool doScene(
	hkRootLevelContainer* container, 
	const RCParams& params, 
	const StringSet& options,
	const char* outFile
	)
{
	HkxSceneToolParams sceneParams;
	sceneParams.bVerbose = params.bVerbose;
	sceneParams.bMergeMeshesByMaterial = true;
	sceneParams.outFile = outFile;

	std::string stem(outFile);
	stem = stem.substr(0, stem.find_last_of("\\/")+1);

	std::string outDir;
	for (StringSet::const_iterator it = options.begin(); it != options.end(); ++it)
	{
		if (strstr(it->c_str(), "--outputDir"))
		{
			outDir = it->substr(it->find_first_of('=')+1);
			break;
		}
	}

	if (!outDir.length())
	{
		outDir = ".\\";
	}

	// first make sure they exist
	_mkdir(stem.c_str());
	_mkdir((stem+outDir).c_str());

	sceneParams.outDir = outDir.c_str();

	HkxSceneTool sceneTool(sceneParams);
	sceneTool.initialize(container);

	if (sceneTool.process())
	{
	}

	return true;
}
Exemplo n.º 2
0
void ParsMapFiles()
{
    char fn[512];
    //char id_filename[64];
    char id[10];
    StringSet failedPaths;
    for (unsigned int i = 0; i < map_count; ++i)
    {
        sprintf(id, "%03u", map_ids[i].id);
        sprintf(fn, "World\\Maps\\%s\\%s.wdt", map_ids[i].name, map_ids[i].name);
        WDTFile WDT(fn, map_ids[i].name);
        if (WDT.init(id, map_ids[i].id))
        {
            printf("Processing Map %u\n[", map_ids[i].id);
            for (int x = 0; x < 64; ++x)
            {
                for (int y = 0; y < 64; ++y)
                {
                    if (ADTFile* ADT = WDT.GetMap(x, y))
                    {
                        //sprintf(id_filename,"%02u %02u %03u",x,y,map_ids[i].id);//!!!!!!!!!
                        ADT->init(map_ids[i].id, x, y, failedPaths);
                        delete ADT;
                    }
                }
                printf("#");
                fflush(stdout);
            }
            printf("]\n");
        }
    }

    if (!failedPaths.empty())
    {
        printf("Warning: Some models could not be extracted, see below\n");
        for (StringSet::const_iterator itr = failedPaths.begin(); itr != failedPaths.end(); ++itr)
            printf("Could not find file of model %s\n", itr->c_str());
        printf("A few not found models can be expected and are not alarming.\n");
    }
}
Exemplo n.º 3
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void Picker::Config::dump() const {
	printf("Configuration:\n");
	printf("amplitude group                  %s\n",     amplitudeGroup.c_str());
	printf("testMode                         %s\n",     test ? "true":"false");
	printf("offline                          %s\n",     offline ? "true":"false");
	printf("useAllStreams                    %s\n",     useAllStreams ? "true":"false");
	printf("calculateAmplitudes              %s\n",     calculateAmplitudes ? "true":"false");
	printf("calculateAmplitudeTypes          ");
	if ( amplitudeList.empty() )
		printf("[]\n");
	else {
		for ( StringSet::const_iterator it = amplitudeList.begin();
		      it != amplitudeList.end(); ++it ) {
			if ( it != amplitudeList.begin() )
				printf(", ");
			printf("%s", it->c_str());
		}
		printf("\n");
	}
	printf("interpolateGaps                  %s\n",     interpolateGaps ? "true":"false");
	printf("maxGapLength                     %.2f s\n", maxGapLength);
	printf("defaultFilter                    %s\n",     defaultFilter.c_str());
	printf("defaultTriggerOnThreshold        %.2f\n",   defaultTriggerOnThreshold);
	printf("defaultTriggerOffThreshold       %.2f\n",   defaultTriggerOffThreshold);
	//printf("minDuration                      %.2f\n",   minDuration);
	//printf("maxDuration                      %.2f\n",   maxDuration);
	printf("triggerDeadTime                  %.2fs\n", triggerDeadTime);
	printf("amplitudeMaxTimeWindow           %.2fs\n", amplitudeMaxTimeWindow);
	printf("amplitudeMinOffset               %.2fs\n", amplitudeMinOffset);
	printf("defaultTimeCorrection            %.2fs\n", defaultTimeCorrection);
	printf("ringBufferSize                   %.0fs\n", ringBufferSize);
	printf("leadTime                         %.0fs\n", leadTime);
	printf("initTime                         %.0fs\n", initTime);
	printf("pickerType                       %s\n",     pickerType.c_str());
	printf("secondaryPickerType              %s\n",     secondaryPickerType.c_str());
	printf("sendDetections                   %s\n",     sendDetections ? "true" : "false");
}
Exemplo n.º 4
0
void ExtractGameobjectModels()
{
    printf("\n");
    printf("Extracting GameObject models...\n");
    DBCFile dbc("DBFilesClient\\GameObjectDisplayInfo.dbc");
    if (!dbc.open())
    {
        printf("Fatal error: Invalid GameObjectDisplayInfo.dbc file format!\n");
        exit(1);
    }

    std::string basepath = szWorkDirWmo;
    basepath += "/";
    std::string path;
    StringSet failedPaths;

    FILE* model_list = fopen((basepath + "temp_gameobject_models").c_str(), "wb");

    for (DBCFile::Iterator it = dbc.begin(); it != dbc.end(); ++it)
    {
        path = it->getString(1);

        if (path.length() < 4)
            continue;

        fixnamen((char*)path.c_str(), path.size());
        char* name = GetPlainName((char*)path.c_str());
        fixname2(name, strlen(name));

        char* ch_ext = GetExtension(name);
        if (!ch_ext)
            continue;

        strToLower(ch_ext);

        bool result = false;
        if (!strcmp(ch_ext, ".wmo"))
        {
            result = ExtractSingleWmo(path);
        }
        else if (!strcmp(ch_ext, ".mdl"))
        {
            // TODO: extract .mdl files, if needed
            continue;
        }
        else //if (!strcmp(ch_ext, ".mdx") || !strcmp(ch_ext, ".m2"))
        {
            result = ExtractSingleModel(path, failedPaths);
        }

        if (result)
        {
            uint32 displayId = it->getUInt(0);
            uint32 path_length = strlen(name);
            fwrite(&displayId, sizeof(uint32), 1, model_list);
            fwrite(&path_length, sizeof(uint32), 1, model_list);
            fwrite(name, sizeof(char), path_length, model_list);
        }
    }

    fclose(model_list);

    if (!failedPaths.empty())
    {
        printf("Warning: Some models could not be extracted, see below\n");
        for (StringSet::const_iterator itr = failedPaths.begin(); itr != failedPaths.end(); ++itr)
            printf("Could not find file of model %s\n", itr->c_str());
        printf("A few of these warnings are expected to happen, so be not alarmed!\n");
    }

    printf("Done!\n");
}
Exemplo n.º 5
0
void ExtractGameobjectModels(int iCoreNumber, const void *szRawVMAPMagic)
{
    printf("\n");
    printf("Extracting GameObject models...\n");
    DBCFile dbc("DBFilesClient\\GameObjectDisplayInfo.dbc");
    if (!dbc.open())
    {
        printf("Fatal error: Invalid GameObjectDisplayInfo.dbc file format!\n");
        exit(1);
    }

    std::string basepath = szWorkDirWmo;
    basepath += "/";
    std::string path;
    StringSet failedPaths;

    FILE* model_list = fopen((basepath + "temp_gameobject_models").c_str(), "wb");

    for (DBCFile::Iterator it = dbc.begin(); it != dbc.end(); ++it)
    {
        path = it->getString(1);

        if (path.length() < 4)
            { continue; }

        string name;

        string ch_ext = GetExtension(path);
        if (ch_ext.empty())
            { continue; }

        bool result = false;
        if (ch_ext == "wmo")
        {
            name = GetUniformName(path);
            result = ExtractSingleWmo(path, iCoreNumber, szRawVMAPMagic);
        }
        else
        {
            result = ExtractSingleModel(path, name, failedPaths, iCoreNumber, szRawVMAPMagic);
        }

        if (result && FileExists((basepath + name).c_str()))
        {
            uint32 displayId = it->getUInt(0);
            uint32 path_length = name.length();
            fwrite(&displayId, sizeof(uint32), 1, model_list);
            fwrite(&path_length, sizeof(uint32), 1, model_list);
            fwrite(name.c_str(), sizeof(char), path_length, model_list);
        }
    }

    fclose(model_list);

    if (!failedPaths.empty())
    {
        printf("\n Warning: Some models could not be extracted, see below\n");
        for (StringSet::const_iterator itr = failedPaths.begin(); itr != failedPaths.end(); ++itr)
            { printf(" Could not find file of model %s\n", itr->c_str()); }
        printf("\n A few of these warnings are expected to happen, so be not alarmed!\n");
    }

    printf("\n Asset Extraction Complete !\n");
}