Skip to content

Commit

Permalink
libgui: Recognize BMP images; fixed instanced drawing of ModelDrawable
Browse files Browse the repository at this point in the history
Model instances still don't support rendering passes, though.
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent f9e0ae5 commit 4945367
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion doomsday/libs/gui/src/graphics/glbuffer.cpp
Expand Up @@ -560,7 +560,15 @@ void GLBuffer::drawInstanced(GLBuffer const &instanceAttribs, duint first, dint
{
#if defined (DENG_HAVE_INSTANCES)

if (!isReady() || !instanceAttribs.isReady() || !GLProgram::programInUse()) return;
if (!isReady() || !instanceAttribs.isReady() || !GLProgram::programInUse())
{
#if defined (DENG2_DEBUG)
qDebug() << "[GLBuffer] isReady:" << isReady()
<< "instAttr isReady:" << instanceAttribs.isReady()
<< "progInUse:" << GLProgram::programInUse();
#endif
return;
}

// Mark the current target changed.
GLState::current().target().markAsChanged();
Expand Down
3 changes: 2 additions & 1 deletion doomsday/libs/gui/src/graphics/image.cpp
Expand Up @@ -990,7 +990,8 @@ bool Image::recognize(File const &file)
{
String const ext = file.extension().toLower();
return (ext == ".tga" || ext == ".pcx" || ext == ".png" || ext == ".jpg" ||
ext == ".jpeg" || ext == ".gif" || ext == ".tiff" || ext == ".ico");
ext == ".jpeg" || ext == ".gif" || ext == ".tiff" || ext == ".ico" ||
ext == ".bmp");
}

} // namespace de
2 changes: 2 additions & 0 deletions doomsday/libs/gui/src/graphics/modeldrawable.cpp
Expand Up @@ -1401,7 +1401,9 @@ DENG2_PIMPL(ModelDrawable)

preDraw(animation);
setDrawProgram(program);
drawProgram->beginUse();
glData.materials.at(0)->buffer->drawInstanced(attribs);
drawProgram->endUse();
postDraw();
}

Expand Down

0 comments on commit 4945367

Please sign in to comment.