Exemplo n.º 1
0
QString UBWidgetUniboardAPI::createMimeText(bool downloaded, const QString &mimeType, const QString &fileName)
{
    QString mimeXml;
    QXmlStreamWriter writer(&mimeXml);
    writer.setAutoFormatting(true);
    writer.writeStartDocument();
    writer.writeStartElement(tMainSection);

    writer.writeTextElement(tReady, boolToStr(downloaded));

    if (downloaded) {
        if (!mimeType.isEmpty()) {
            writer.writeTextElement(tType, mimeType);  //writing type of element
        }
        if (!QFile::exists(fileName)) {
            qDebug() << "file" << fileName << "doesn't exist";
            return QString();
        }

        QString relatedFileName = fileName;
        relatedFileName = relatedFileName.remove(mGraphicsWidget->getOwnFolder().toLocalFile() + "/");
        writer.writeTextElement(tPath, relatedFileName);   //writing path to created object
    }

    writer.writeEndElement();
    writer.writeEndDocument();

    return mimeXml;
}
Exemplo n.º 2
0
void dumpImageDesc(const GifImageDesc &desc) {
  _tprintf(_T("ImageDesc:Rect(%d,%d,%d,%d), interlaced:%s\n")
          ,desc.Left, desc.Top, desc.Width, desc.Height
          ,boolToStr(desc.Interlace)
        );
  dumpColorMap(desc.ColorMap);
}
Exemplo n.º 3
0
void dumpColorMap(ColorMapObject *map) {
  if(map == NULL) {
    _tprintf(_T("ColorMap=NULL\n"));
  } else {
    _tprintf(_T("ColorMap:ColorCount:%d, BitsPerPixel:%d, SortFlag:%s\n")
            ,map->ColorCount, map->BitsPerPixel, boolToStr(map->SortFlag));
  }
}
MenuStateGraphicInfo::MenuStateGraphicInfo(Program *program, MainMenu *mainMenu):
	MenuState(program, mainMenu, "info")
{
	Lang &lang= Lang::getInstance();

	containerName = "GraphicInfo";
	buttonReturn.registerGraphicComponent(containerName,"buttonReturn");
	buttonReturn.init(100, 540, 125);

	buttonReturn.setText(lang.getString("Return"));

	labelInfo.registerGraphicComponent(containerName,"labelInfo");
	labelInfo.init(0, 730);

	labelMoreInfo.registerGraphicComponent(containerName,"labelMoreInfo");
	labelMoreInfo.init(0, 520);
	labelMoreInfo.setFont(CoreData::getInstance().getDisplayFontSmall());
	labelMoreInfo.setFont3D(CoreData::getInstance().getDisplayFontSmall3D());

	labelInternalInfo.registerGraphicComponent(containerName,"labelInternalInfo");
	labelInternalInfo.init(300, 730);
	labelInternalInfo.setFont(CoreData::getInstance().getDisplayFontSmall());
	labelInternalInfo.setFont3D(CoreData::getInstance().getDisplayFontSmall3D());

	GraphicComponent::applyAllCustomProperties(containerName);

	Renderer &renderer= Renderer::getInstance();

	string glInfo= renderer.getGlInfo();
	string glMoreInfo= renderer.getGlMoreInfo();
	labelInfo.setText(glInfo);
	labelMoreInfo.setText(glMoreInfo);

	string strInternalInfo = "";
	strInternalInfo += "VBOSupported: " + boolToStr(getVBOSupported());
	if(getenv("MEGAGLEST_FONT") != NULL) {
		char *tryFont = getenv("MEGAGLEST_FONT");
		strInternalInfo += "\nMEGAGLEST_FONT: " + string(tryFont);
	}
	strInternalInfo += "\nforceLegacyFonts: " + boolToStr(Font::forceLegacyFonts);
	strInternalInfo += "\nrenderText3DEnabled: " + boolToStr(Renderer::renderText3DEnabled);
	strInternalInfo += "\nuseTextureCompression: " + boolToStr(Texture::useTextureCompression);
	strInternalInfo += "\nfontIsRightToLeft: " + boolToStr(Font::fontIsRightToLeft);
	strInternalInfo += "\nscaleFontValue: " + floatToStr(Font::scaleFontValue);
	strInternalInfo += "\nscaleFontValueCenterHFactor: " + floatToStr(Font::scaleFontValueCenterHFactor);
	strInternalInfo += "\nlangHeightText: " + Font::langHeightText;
	strInternalInfo += "\nAllowAltEnterFullscreenToggle: " + boolToStr(Window::getAllowAltEnterFullscreenToggle());
	strInternalInfo += "\nTryVSynch: " + boolToStr(Window::getTryVSynch());
	strInternalInfo += "\nVERBOSE_MODE_ENABLED: " + boolToStr(SystemFlags::VERBOSE_MODE_ENABLED);
	labelInternalInfo.setText(strInternalInfo);
}
String CreateIndexData::toString() const {
  String result = _T("CreateIndexData:\n");
  result += format(_T("  Indexname  :<%s>\n"), m_indexName.cstr());
  result += format(_T("  Tablename  :<%s>\n"), m_tableName.cstr());
  result += format(_T("  Unique     :%s\n"  ), boolToStr(m_unique));
  result += format(_T("  ColumnCount:%zd\n" ), m_columns.size());
  for(size_t i = 0; i < m_columns.size(); i++) {
    const IndexColumnName &col = m_columns[i];
    result += format(_T("    ColName[%zd]:<%s> <%c>\n"), i,col.m_colName.cstr(),col.m_asc ? 'A':'D');
  }
  return result;
}
void MenuStateGraphicInfo::reloadUI() {
	Lang &lang= Lang::getInstance();

	console.resetFonts();
	buttonReturn.setText(lang.getString("Return"));

	labelMoreInfo.setFont(CoreData::getInstance().getDisplayFontSmall());
	labelMoreInfo.setFont3D(CoreData::getInstance().getDisplayFontSmall3D());

	labelInternalInfo.setFont(CoreData::getInstance().getDisplayFontSmall());
	labelInternalInfo.setFont3D(CoreData::getInstance().getDisplayFontSmall3D());

	Renderer &renderer= Renderer::getInstance();

	string glInfo= renderer.getGlInfo();
	string glMoreInfo= renderer.getGlMoreInfo();
	labelInfo.setText(glInfo);
	labelMoreInfo.setText(glMoreInfo);

	string strInternalInfo = "";
	strInternalInfo += "VBOSupported: " + boolToStr(getVBOSupported());
	if(getenv("MEGAGLEST_FONT") != NULL) {
		char *tryFont = getenv("MEGAGLEST_FONT");
		strInternalInfo += "\nMEGAGLEST_FONT: " + string(tryFont);
	}
	strInternalInfo += "\nforceLegacyFonts: " + boolToStr(Font::forceLegacyFonts);
	strInternalInfo += "\nrenderText3DEnabled: " + boolToStr(Renderer::renderText3DEnabled);
	strInternalInfo += "\nuseTextureCompression: " + boolToStr(Texture::useTextureCompression);
	strInternalInfo += "\nfontIsRightToLeft: " + boolToStr(Font::fontIsRightToLeft);
	strInternalInfo += "\nscaleFontValue: " + floatToStr(Font::scaleFontValue);
	strInternalInfo += "\nscaleFontValueCenterHFactor: " + floatToStr(Font::scaleFontValueCenterHFactor);
	strInternalInfo += "\nlangHeightText: " + Font::langHeightText;
	strInternalInfo += "\nAllowAltEnterFullscreenToggle: " + boolToStr(Window::getAllowAltEnterFullscreenToggle());
	strInternalInfo += "\nTryVSynch: " + boolToStr(Window::getTryVSynch());
	strInternalInfo += "\nVERBOSE_MODE_ENABLED: " + boolToStr(SystemFlags::VERBOSE_MODE_ENABLED);
	labelInternalInfo.setText(strInternalInfo);

	GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
}
Exemplo n.º 7
0
string PlayerStats::getStats() const {
	string result = "";

	Lang &lang= Lang::getInstance();
	string controlString = "";

	if(personalityType == fpt_Observer) {
		controlString= GameConstants::OBSERVER_SLOTNAME;
	}
	else {
		switch(control) {
		case ctCpuEasy:
			controlString= lang.getString("CpuEasy");
			break;
		case ctCpu:
			controlString= lang.getString("Cpu");
			break;
		case ctCpuUltra:
			controlString= lang.getString("CpuUltra");
			break;
		case ctCpuMega:
			controlString= lang.getString("CpuMega");
			break;
		case ctNetwork:
			controlString= lang.getString("Network");
			break;
		case ctHuman:
			controlString= lang.getString("Human");
			break;

		case ctNetworkCpuEasy:
			controlString= lang.getString("NetworkCpuEasy");
			break;
		case ctNetworkCpu:
			controlString= lang.getString("NetworkCpu");
			break;
		case ctNetworkCpuUltra:
			controlString= lang.getString("NetworkCpuUltra");
			break;
		case ctNetworkCpuMega:
			controlString= lang.getString("NetworkCpuMega");
			break;

		default:
			printf("Error control = %d\n",control);
			assert(false);
			break;
		};
	}

	if((control != ctHuman && control != ctNetwork) ||
			(control == ctNetwork && playerLeftBeforeEnd == true)) {
		controlString += " x " + floatToStr(resourceMultiplier,1);
	}

	result += playerName + " (" + controlString + ") ";
	if(control == ctNetwork && playerLeftBeforeEnd==true ) {
		result += "player left before end ";
	}
	result += "faction: " + factionTypeName + " ";
	result += "Team: " + intToStr(teamIndex) + " ";
	result += "victory: " + boolToStr(victory) + " ";
	result += "# kills: " + intToStr(kills) + " ";
	result += "# enemy kills: " + intToStr(enemykills) + " ";
	result += "# deaths: " + intToStr(deaths) + "\n";
	result += "# units produced: " + intToStr(unitsProduced) + " ";
	result += "# resources harvested: " + intToStr(resourcesHarvested);

	return result;
}
Exemplo n.º 8
0
void dumpGCBBlock(const ExtensionBlock &ep) {
  GraphicsControlBlock gcb;
  CHECKGIFOK(DGifExtensionToGCB(ep.ByteCount, ep.Bytes, &gcb));
  _tprintf(_T("GraphicsControlBlock : Dispose:%d, Delay:%d, Transparent color:%d, Userinput:%s\n")
         ,gcb.DisposalMode, gcb.DelayTime, gcb.TransparentColor, boolToStr(gcb.UserInputFlag));
}