void hkvExternalToolPvrTexTool::determineCommandLineParameters(
  const hkvTextureTransformationSettings& settings, const char* sourceFile, const char* targetFile)
{
  // Build the command line argument string
  hkStringBuf sourceFileBuf(sourceFile);
  sourceFileBuf.replace('/', '\\');
  hkStringBuf targetFileBuf(targetFile);
  targetFileBuf.replace('/', '\\');

  hkStringBuf paramBuf;
  paramBuf.appendJoin(" -i \"", sourceFileBuf, "\"");
  paramBuf.appendJoin(" -o \"", targetFileBuf, "\"");

  hkvTextureDataFormat dataFormat = settings.getTargetDataFormat();
  VASSERT_MSG(hkvPvrTexToolFormatStrings[dataFormat].m_format == dataFormat, "PVRTexTool format string lookup is inconsistent with defined texture formats!");
  paramBuf.appendJoin(" -f ", hkvPvrTexToolFormatStrings[dataFormat].m_string);

  switch (settings.getTargetFileFormat())
  {
  case HKV_TEXTURE_FILE_FORMAT_DDS:
    {
      break;
    }
  case HKV_TEXTURE_FILE_FORMAT_ETC:
    {
      paramBuf.append(" -legacypvr");
      break;
    }
  case HKV_TEXTURE_FILE_FORMAT_PVR:
    {
      paramBuf.append(" -legacypvr");
      break;
    }
  }

  if (settings.getCreateMipMaps())
  {
    paramBuf.append(" -m");
    paramBuf.append(" -mfilter cubic");
  }

  if (settings.getTargetWidth() != settings.getSourceWidth() || settings.getTargetHeight() != settings.getSourceHeight())
  {
    paramBuf.appendPrintf(" -r %i,%i", settings.getTargetWidth(), settings.getTargetHeight());
    paramBuf.appendPrintf(" -rfilter cubic");
  }
  
  m_commandLine = paramBuf;
}
void hkvExternalToolPvrTexTool::determineCommandLineParameters(
  const hkvTextureTransformationSettings& settings, const char* sourceFile, const char* targetFile)
{
  // Build the command line argument string
  hkStringBuf sourceFileBuf(sourceFile);
  sourceFileBuf.replace('/', '\\');
  hkStringBuf targetFileBuf(targetFile);
  targetFileBuf.replace('/', '\\');

  hkStringBuf paramBuf;
  paramBuf.appendJoin(" -i \"", sourceFileBuf, "\"");
  paramBuf.appendJoin(" -o \"", targetFileBuf, "\"");

  //TODO: Add ETC2 and PVRTC2 support
  const char* dataFormatStr = NULL;
  switch (settings.getTargetDataFormat())
  {
  case HKV_IMAGE_DATA_FORMAT_PVRTC2:
    dataFormatStr = "PVRTC1_2";
    break;
  case HKV_IMAGE_DATA_FORMAT_PVRTC4:
    dataFormatStr = "PVRTC1_4";
    break;
  case HKV_IMAGE_DATA_FORMAT_ETC1:
    dataFormatStr = "ETC1";
    break;
  }

  if (dataFormatStr != NULL)
  {
    paramBuf.appendJoin(" -f ", dataFormatStr);
  }
  else
  {
    VASSERT_MSG(dataFormatStr != NULL, "Unsupported data format specified!");
  }

  switch (settings.getTargetFileFormat())
  {
  case HKV_IMAGE_FILE_FORMAT_DDS:
    {
      break;
    }
  case HKV_IMAGE_FILE_FORMAT_ETC:
  case HKV_IMAGE_FILE_FORMAT_PVR:
    {
      paramBuf.append(" -legacypvr");
      break;
    }
  }

  if (settings.getCreateMipMaps())
  {
    paramBuf.append(" -m");
    paramBuf.append(" -mfilter cubic");
  }

  if (settings.getTargetWidth() != settings.getSourceWidth() || settings.getTargetHeight() != settings.getSourceHeight())
  {
    paramBuf.appendPrintf(" -r %i,%i", settings.getTargetWidth(), settings.getTargetHeight());
    paramBuf.appendPrintf(" -rfilter cubic");
  }
  
  m_commandLine = paramBuf;
}