diff --git a/doomsday/engine/portable/include/sys_reslocator.h b/doomsday/engine/portable/include/sys_reslocator.h index 100988af0f..05cbcb1c23 100644 --- a/doomsday/engine/portable/include/sys_reslocator.h +++ b/doomsday/engine/portable/include/sys_reslocator.h @@ -61,6 +61,7 @@ typedef enum { RT_WAD, RT_DED, RT_PNG, + RT_JPG, RT_TGA, RT_PCX, RT_DMD, diff --git a/doomsday/engine/portable/src/image.cpp b/doomsday/engine/portable/src/image.cpp index df1036294e..8d86f1e837 100644 --- a/doomsday/engine/portable/src/image.cpp +++ b/doomsday/engine/portable/src/image.cpp @@ -146,9 +146,8 @@ boolean Image_Load(image_t* img, const char* format, DFile* file) GL_InitImage(img); // Load the file contents to a memory buffer. - int pos = DFile_Tell(file); QByteArray data; - data.resize(DFile_Length(file) - pos); + data.resize(DFile_Length(file) - initPos); DFile_Read(file, reinterpret_cast(data.data()), data.size()); QImage image = QImage::fromData(data, format).rgbSwapped(); diff --git a/doomsday/engine/portable/src/sys_reslocator.c b/doomsday/engine/portable/src/sys_reslocator.c index 684fcde142..2e07d2b9ec 100644 --- a/doomsday/engine/portable/src/sys_reslocator.c +++ b/doomsday/engine/portable/src/sys_reslocator.c @@ -90,6 +90,7 @@ static const resourcetypeinfo_t typeInfo[NUM_RESOURCE_TYPES] = { /* RT_WAD */ { RC_PACKAGE, {"wad", 0} }, /* RT_DED */ { RC_DEFINITION, {"ded", 0} }, /* RT_PNG */ { RC_GRAPHIC, {"png", 0} }, + /* RT_JPG */ { RC_GRAPHIC, {"jpg", 0} }, /* RT_TGA */ { RC_GRAPHIC, {"tga", 0} }, /* RT_PCX */ { RC_GRAPHIC, {"pcx", 0} }, /* RT_DMD */ { RC_MODEL, {"dmd", 0} }, @@ -108,7 +109,7 @@ static const resourcetypeinfo_t typeInfo[NUM_RESOURCE_TYPES] = { static const resourcetype_t searchTypeOrder[RESOURCECLASS_COUNT][MAX_TYPEORDER] = { /* RC_PACKAGE */ { RT_ZIP, RT_WAD, 0 }, // Favor ZIP over WAD. /* RC_DEFINITION */ { RT_DED, 0 }, // Only DED files. - /* RC_GRAPHIC */ { RT_PNG, RT_TGA, RT_PCX, 0 }, // Favour quality. + /* RC_GRAPHIC */ { RT_PNG, RT_TGA, RT_JPG, RT_PCX, 0 }, // Favour quality. /* RC_MODEL */ { RT_DMD, RT_MD2, 0 }, // Favour DMD over MD2. /* RC_SOUND */ { RT_WAV, 0 }, // Only WAV files. /* RC_MUSIC */ { RT_OGG, RT_MP3, RT_WAV, RT_MOD, RT_MID, 0 },