Ejemplo n.º 1
0
/* Designate Texture File
   Close the curren texture file (if any) and open one with the given
   base name.
 */
bool trpgwImageHelper::DesignateTextureFile(int id)
{
    // Close the current texture file
    if (texFile)
        delete texFile;

    texFile = NULL;

    // Open one with the given base name
    char filename[1024];
    sprintf(filename, "%s" PATHSEPERATOR "texFile_%d.txf", dir, id);
    texFile = GetNewWAppFile(ness, filename);
    if (!texFile->isValid())
        return false;

    texFileIDs.push_back(id);

    sprintf(filename, "%s" PATHSEPERATOR "geotypFile_%d.txf", dir, id);
    geotypFile = GetNewWAppFile(ness, filename);
    if (!geotypFile->isValid())
        return false;

    geotypFileIDs.push_back(id);


    return true;
}
Ejemplo n.º 2
0
/* Increment Texture File.
   Close the current texture file (if any) and open the next one.
*/
trpgwAppFile * trpgwImageHelper::IncrementTextureFile(bool geotyp)
{
    char filename[1024];
    trpgwAppFile *thefile = texFile;
	
    if(geotyp && separateGeoTypical) {
        thefile = geotypFile;
		sprintf(filename,"%s" PATHSEPERATOR "geotypFile_%d.txf",dir,static_cast<int>(geotypFileIDs.size()));
    }
    else {
		sprintf(filename,"%s" PATHSEPERATOR "texFile_%d.txf",dir,static_cast<int>(texFileIDs.size()));
    }

    // Closes the current texture file
    if (thefile)  delete thefile;
    thefile = NULL;

    // Open the next one	
    thefile = GetNewWAppFile(ness,filename,true);
    if (!thefile->isValid())
        return NULL;
    if(geotyp && separateGeoTypical) {
        geotypFileIDs.push_back(geotypFileIDs.size());
        geotypFile = thefile;
    }
    else {
        texFileIDs.push_back(texFileIDs.size());
        texFile = thefile;
    }
    return thefile;
}
Ejemplo n.º 3
0
/* Designate Tile File
   Close the current tile file (if any) and open one with the
   given base name.  This is used for regenerate.
 */
bool trpgwArchive::DesignateTileFile(int id)
{
    if (tileMode != TileLocal)
        return false;

    // Close the current tile file
    if (tileFile)
    {
        delete tileFile;
        tileFile = NULL;
    }

    // Open a named on
    char filename[1024];
    sprintf(filename, "%s" PATHSEPERATOR "tileFile_%d.tpf", dir, id);
    tileFile = GetNewWAppFile(ness, filename);
    if (!tileFile->isValid())
        return false;

    // Add another TileFiles entry
    tileFiles.resize(tileFiles.size() + 1);
    tileFiles[tileFiles.size() - 1].id = id;

    return true;
}
Ejemplo n.º 4
0
/* Increment Tile File.
   Close the current tile file (if any) and open the next one.
   Also update the records we're keeping of which tiles went in
   which files.
 */
bool trpgwArchive::IncrementTileFile()
{
    if (tileMode != TileLocal)
        return false;

    // Closes the current tile file
    if (tileFile)
    {
        delete tileFile;
        tileFile = NULL;
    }

    // Open the next one
    char filename[1024];
    sprintf(filename, "%s" PATHSEPERATOR "tileFile_%d.tpf", dir, tileFileCount++);
    tileFile = GetNewWAppFile(ness, filename, true);
    if (!tileFile->isValid())
        return false;

    // Add another TileFiles entry
    tileFiles.resize(tileFiles.size() + 1);
    tileFiles[tileFiles.size() - 1].id = tileFiles.size() - 1;

    return true;
}