diff --git a/src/celestia/avicapture.cpp b/src/celestia/avicapture.cpp index 75ce9d9ae..71d87635a 100644 --- a/src/celestia/avicapture.cpp +++ b/src/celestia/avicapture.cpp @@ -228,3 +228,8 @@ float AVICapture::getFrameRate() const { return frameRate; } + +int AVICapture::getFrameCount() const +{ + return frameCounter; +} diff --git a/src/celestia/avicapture.h b/src/celestia/avicapture.h index d8640f7b6..cfc21399e 100644 --- a/src/celestia/avicapture.h +++ b/src/celestia/avicapture.h @@ -28,6 +28,7 @@ class AVICapture : public MovieCapture int getWidth() const; int getHeight() const; float getFrameRate() const; + int getFrameCount() const; private: void cleanup(); diff --git a/src/celestia/celestiacore.cpp b/src/celestia/celestiacore.cpp index a707434ba..88cc31f7d 100644 --- a/src/celestia/celestiacore.cpp +++ b/src/celestia/celestiacore.cpp @@ -1350,6 +1350,16 @@ void CelestiaCore::renderOverlay() glPopMatrix(); + glPushMatrix(); + glTranslatef((width + movieWidth) / 2 - emWidth * 5, + (height + movieHeight) / 2 + 2, 0); + float sec = movieCapture->getFrameCount() / + movieCapture->getFrameRate(); + int min = (int) (sec / 60); + sec -= min * 60.0f; + overlay->printf("%3d:%05.2f", min, sec); + glPopMatrix(); + glPushMatrix(); glTranslatef((width - movieWidth) / 2, (height - movieHeight) / 2 - fontHeight - 2, 0); diff --git a/src/celestia/moviecapture.h b/src/celestia/moviecapture.h index 7e4382cb1..bc8050ff2 100644 --- a/src/celestia/moviecapture.h +++ b/src/celestia/moviecapture.h @@ -25,6 +25,7 @@ class MovieCapture virtual bool end() = 0; virtual bool captureFrame() = 0; + virtual int getFrameCount() const = 0; virtual int getWidth() const = 0; virtual int getHeight() const = 0; virtual float getFrameRate() const = 0;