Irrlicht loadFromFile alternative

Create issue
Issue #406 wontfix
Former user created an issue

Automatic migration. Original reporter: "makofierce"

A much faster alternative when loading Irrlicht textures; may not be correct in all cases.

void IrrlichtTexture::loadFromFile(const String& filename, const String& resourceGroup) {

Get and check existence of the "CEGUI::System" object. System* sys = System::getSingletonPtr(); if (!sys) CEGUI_THROW(RendererException("IrrlichtTexture::loadFromFile: " "CEGUI::System object has not been created!"));

CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton ().getResourceProvider ()); std::string mystring = rp->getResourceGroupDirectory ("imagesets").c_str(); mystring.append (filename.c_str());

d_texture = d_driver.getTexture(mystring.c_str()); d_size.d_width = (float)d_texture->getOriginalSize().Width; d_size.d_height = (float)d_texture->getOriginalSize().Height; d_dataSize.d_width = (float)d_texture->getOriginalSize().Width; d_dataSize.d_height = (float)d_texture->getOriginalSize().Height; d_texelScaling.d_x = 1/((float)d_texture->getOriginalSize().Width); d_texelScaling.d_y = 1/((float)d_texture->getOriginalSize().Height); d_textureNumber += 1; return; }

Reproducibility: always

Comments (2)

  1. Lukas Meindl

    Can't accept this contributions without assertment that it works in all cases, or at least info as to when it does not work etc.

  2. Log in to comment