benmbrennan / mupen64plus

Automatically exported from code.google.com/p/mupen64plus
0 stars 0 forks source link

Screenshots won't capture past 100 images #291

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Describe your system:
 - Linux distribution: Ubuntu 9.04
 - Machine type: 64-bit
 - Mupen64Plus version: 1.5
 - Plugins used: Rice's Video Plugin 1.5, JttL's SDL Audio 1.5, blight's
SDL input plugin 0.0.10.0, and Hacktarus/Azimer hle rsp plugin

Describe the problem:
After taking 100 screenshots, the program would not capture any more until
I moved the images to a different directory.  For example, while playing
Beetle Adventure Racing, the final screenshot captured was
beetle_adventure_rac-099.png.  After that, no more images would be captured
and no error was reported on screen or in the console.

Like I said though, I was able to move all those screenshots to a different
directory while playing the game, and I was able to restart the counter
over at 000.

Original issue reported on code.google.com by hansamu...@gmail.com on 22 Oct 2009 at 4:29

GoogleCodeExporter commented 9 years ago
Seems more logical that the images should be named from 0 to 999 since it is 
padding
the index up to 3 digits. This patch should take care of that, but I don't know 
the
impact of this when you start approaching 1000 screen shots for a game. It will 
be a
lot of fopen for one screen shot.

Index: opengl/screenshot.cpp
===================================================================
--- opengl/screenshot.cpp   (revision 1416)
+++ opengl/screenshot.cpp   (working copy)
@@ -175,7 +175,7 @@

     // look for a file
     int i;
-    for (i = 0; i < 100; i++)
+    for (i = 0; i < 1000; i++)
     {
         sprintf(filename, "%s-%03i.png", filepath, i);
         FILE *pFile = fopen(filename, "r");
@@ -183,7 +183,7 @@
             break;
         fclose(pFile);
     }
-    if (i == 100) return;
+    if (i == 1000) return;

     // get the SDL surface and find the width and height
     SDL_Surface *pSurf = SDL_GetVideoSurface();

Original comment by olejl77@gmail.com on 24 Oct 2009 at 10:55

GoogleCodeExporter commented 9 years ago
That undoubtedly works just fine, but it doesn't solve the big problem in my 
opinion.
 Does it really have to try and find the smallest available number every time it
wants to take a screenshot? Is there some way we can keep a static number 
attached to
the ROM and just increment off that?  I'm assuming that's your concern about 
all the
fopens for each shot.

Original comment by hansamu...@gmail.com on 24 Oct 2009 at 4:07

GoogleCodeExporter commented 9 years ago

Original comment by richard...@gmail.com on 14 Jan 2010 at 5:01

GoogleCodeExporter commented 9 years ago

Original comment by richard...@gmail.com on 20 Jan 2010 at 4:09

GoogleCodeExporter commented 9 years ago
This is now fixed in an efficient manner, with support for up to 1000 
screenshots per
ROM.

Original comment by richard...@gmail.com on 27 Jan 2010 at 4:35

GoogleCodeExporter commented 9 years ago
Thanks for working on this, great to see the project active!

Original comment by hansamu...@gmail.com on 27 Jan 2010 at 6:12