diff --git a/doomsday/client/include/busymode.h b/doomsday/client/include/busymode.h index bff6a065b9..667b6f9e27 100644 --- a/doomsday/client/include/busymode.h +++ b/doomsday/client/include/busymode.h @@ -43,6 +43,10 @@ boolean BusyMode_IsWorkerThread(uint threadId); /// @return @c true if the current thread is the busy task worker. boolean BusyMode_InWorkerThread(void); +#ifdef __CLIENT__ +boolean BusyMode_IsTransitionAnimated(void); +#endif + /// @return Current busy task, else @c NULL. BusyTask* BusyMode_CurrentTask(void); diff --git a/doomsday/client/src/busymode.cpp b/doomsday/client/src/busymode.cpp index f3eb6a8613..0b7595a15c 100644 --- a/doomsday/client/src/busymode.cpp +++ b/doomsday/client/src/busymode.cpp @@ -230,6 +230,13 @@ static int runTask(BusyTask* task) #endif } +#ifdef __CLIENT__ +boolean BusyMode_IsTransitionAnimated(void) +{ + return busyWillAnimateTransition; +} +#endif + static void preBusySetup(int initialMode) { #ifdef __CLIENT__ diff --git a/doomsday/client/src/ui/widgets/busywidget.cpp b/doomsday/client/src/ui/widgets/busywidget.cpp index f97a05a336..839a2d640b 100644 --- a/doomsday/client/src/ui/widgets/busywidget.cpp +++ b/doomsday/client/src/ui/widgets/busywidget.cpp @@ -144,15 +144,22 @@ bool BusyWidget::handleEvent(Event const &) void BusyWidget::grabTransitionScreenshot() { - GLTexture::Size size(rule().width().valuei() / 2, - rule().height().valuei() / 2); + //GLTexture::Size size(rule().width().valuei() / 2, + // rule().height().valuei() / 2); + + Rectanglei grabRect = Rectanglei::fromSize(root().window().canvas().size()); + + if(BusyMode_IsTransitionAnimated()) + { + // Animation transitions are drawn only inside LegacyWidget, so just + // grab that portion of the screen. + grabRect = root().window().game().rule().recti(); + } // Grab the game view's rectangle, as that's where the transition will be drawn. - GLuint grabbed = root().window().grabAsTexture( - root().window().game().rule().recti(), - ClientWindow::GrabHalfSized); + GLuint grabbed = root().window().grabAsTexture(grabRect, ClientWindow::GrabHalfSized); - d->transitionTex.reset(new GLTexture(grabbed, size)); + d->transitionTex.reset(new GLTexture(grabbed, grabRect.size() / 2)); d->uTex = *d->transitionTex; } diff --git a/doomsday/libgui/src/canvaswindow.cpp b/doomsday/libgui/src/canvaswindow.cpp index 7870584280..2b54db2a53 100644 --- a/doomsday/libgui/src/canvaswindow.cpp +++ b/doomsday/libgui/src/canvaswindow.cpp @@ -231,7 +231,7 @@ duint CanvasWindow::grabAsTexture(Rectanglei const &area, GrabMode mode) const QSize size; if(mode == GrabHalfSized) { - size = QSize(width()/2, height()/2); + size = QSize(area.width()/2, area.height()/2); } return d->canvas->grabAsTexture( QRect(area.left(), area.top(), area.width(), area.height()), size);