]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/devil/devilloader.cpp
Add some state checking to ImageLoader
[libs/gui.git] / source / graphics / devil / devilloader.cpp
index 131b6ba1dcfbcebbf1bda7d4e50589dd42ca6033..423b108a5bf6ad13d960099c03070cfe2e30b96b 100644 (file)
@@ -74,8 +74,6 @@ std::string error_string(ILenum err)
 namespace Msp {
 namespace Graphics {
 
-ImageLoader::Register<DevilLoader> DevilLoader::reg;
-
 DevilLoader::DevilLoader(IO::Seekable &i):
        io(i)
 {
@@ -103,7 +101,7 @@ bool DevilLoader::detect(const string &sig)
        return type!=IL_TYPE_UNKNOWN;
 }
 
-void DevilLoader::load(Image::Data &data)
+void DevilLoader::load_(Image::Data &data)
 {
        ilSetRead(0, 0, eof, get, read, seek, tell);
        ilBindImage(id);
@@ -128,9 +126,9 @@ void DevilLoader::load(Image::Data &data)
        data.height = ilGetInteger(IL_IMAGE_HEIGHT);
        data.stride = data.width*ilGetInteger(IL_IMAGE_BYTES_PER_PIXEL);
        unsigned data_size = data.stride*data.height;
-       data.data = new char[data_size];
+       data.pixels = new char[data_size];
        ILubyte *il_data = ilGetData();
-       copy(il_data, il_data+data_size, data.data);
+       copy(il_data, il_data+data_size, data.pixels);
 
        ilBindImage(0);
        ilResetRead();