Exemplo n.º 1
0
void Relocate_Image( CEGUI::XMLAttributes &xml_attributes, const std::string &filename_old, const std::string &filename_new, const CEGUI::String &attribute_name /* = "image" */ )
{
	if( xml_attributes.getValueAsString( attribute_name ).compare( filename_old ) == 0 || xml_attributes.getValueAsString( attribute_name ).compare( DATA_DIR "/" GAME_PIXMAPS_DIR "/" + filename_old ) == 0 )
	{
		xml_attributes.remove( attribute_name );
		xml_attributes.add( attribute_name, filename_new );
	}
}
Exemplo n.º 2
0
void ExpatParser::startElement(void* data, const char* element, const char** attr)
{
    CEGUI::XMLHandler* handler = static_cast<XMLHandler*>(data);
    CEGUI::XMLAttributes attrs;

    for(size_t i = 0 ; attr[i] ; i += 2)
        attrs.add((CEGUI::utf8*)attr[i], (CEGUI::utf8*)attr[i+1]);

    handler->elementStart((CEGUI::utf8*)element, attrs);
}