History

I think I'm very close to a PR...

Zach Fox committed 10 years ago

Commit 152e0ae1 parent 045dfff1 file · +7 −8Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

interface/src/Application.cpp+7−8
@@ -5430,7 +5430,7 @@ void Application::toggleLogDialog() { · 5429 unmodified lines
54305430 }
54315431
54325432 #define SNAPSNOT_ANIMATED_WIDTH (900)
5433−#define SNAPSNOT_ANIMATED_FRAMERATE_FPS (20)
5433+#define SNAPSNOT_ANIMATED_FRAMERATE_FPS (50)
54345434 #define SNAPSNOT_ANIMATED_FRAME_DELAY (100/SNAPSNOT_ANIMATED_FRAMERATE_FPS)
54355435 #define SNAPSNOT_ANIMATED_DURATION_SECS (3)
54365436 #define SNAPSNOT_ANIMATED_NUM_FRAMES (SNAPSNOT_ANIMATED_DURATION_SECS * SNAPSNOT_ANIMATED_FRAMERATE_FPS)
@@ -5480,6 +5480,8 @@ void Application::takeSnapshot(bool notify, const QString& format, float aspectR · 43 unmodified lines
54805480 // If this is the last frame...
54815481 if (qApp->_currentAnimatedSnapshotFrame == SNAPSNOT_ANIMATED_NUM_FRAMES)
54825482 {
5483+ // Reset the current frame number
5484+ qApp->_currentAnimatedSnapshotFrame = 0;
54835485 // Stop the snapshot QTimer
54845486 animatedSnapshotTimer.stop();
54855487 // Write out the end of the GIF
@@ -5493,23 +5495,20 @@ void Application::takeSnapshot(bool notify, const QString& format, float aspectR · 7 unmodified lines
54935495 // Get a screenshot from the display, then scale the screenshot down,
54945496 // then convert it to the image format the GIF library needs,
54955497 // then save all that to the QImage named "frame"
5496− QImage* frame = new QImage(qApp->getActiveDisplayPlugin()->getScreenshot(aspectRatio));
5497− *frame = frame->scaledToWidth(SNAPSNOT_ANIMATED_WIDTH).convertToFormat(QImage::Format_RGBA8888);
5498+ QImage frame(qApp->getActiveDisplayPlugin()->getScreenshot(aspectRatio));
5499+ frame = frame.scaledToWidth(SNAPSNOT_ANIMATED_WIDTH).convertToFormat(QImage::Format_RGBA8888);
54985500
54995501 // If this is the first frame...
55005502 if (qApp->_currentAnimatedSnapshotFrame == 0)
55015503 {
55025504 // Write out the header and beginning of the GIF file
5503− GifBegin(&(qApp->_animatedSnapshotGifWriter), cstr, frame->width(), frame->height(), SNAPSNOT_ANIMATED_FRAME_DELAY*2, 8, false);
5505+ GifBegin(&(qApp->_animatedSnapshotGifWriter), cstr, frame.width(), frame.height(), SNAPSNOT_ANIMATED_FRAME_DELAY*2, 8, false);
55045506 }
55055507
55065508 // Write the frame to the gif
5507− GifWriteFrame(&(qApp->_animatedSnapshotGifWriter), (uint8_t*)frame->bits(), frame->width(), frame->height(), SNAPSNOT_ANIMATED_FRAME_DELAY*2, 8, false);
5509+ GifWriteFrame(&(qApp->_animatedSnapshotGifWriter), (uint8_t*)frame.bits(), frame.width(), frame.height(), SNAPSNOT_ANIMATED_FRAME_DELAY*2, 8, false);
55085510 // Increment the current snapshot frame count
55095511 qApp->_currentAnimatedSnapshotFrame++;
5510−
5511− // Free the dynamic memory
5512− delete frame;
55135512 });
55145513
55155514 // Start the animatedSnapshotTimer QTimer