Author: baby-guest
Date: 2007-07-03 12:36:25 +0000 (Tue, 03 Jul 2007)
New Revision: 3201

Modified:
   software/ui/src/pkgbrowser.cpp
Log:
Added support for jpeg screenshots



Modified: software/ui/src/pkgbrowser.cpp
===================================================================
--- software/ui/src/pkgbrowser.cpp      2007-07-03 10:29:29 UTC (rev 3200)
+++ software/ui/src/pkgbrowser.cpp      2007-07-03 12:36:25 UTC (rev 3201)
@@ -30,6 +30,7 @@
 #include <sys/stat.h>
 
 #include <FL/Fl_PNG_Image.H>
+#include <FL/Fl_JPEG_Image.H>
 
 PackageBrowser::PackageBrowser(int x, int y, int w, int h, const char *l)
        : VersatileBrowser(x, y, w, h, l)
@@ -62,18 +63,31 @@
                else if (snprintf(filename, PATH_MAX, "%s/%s.jpg", 
THUMBNAILSDIR, (const char *)data) &&
                        stat(filename, &fileinfo) == 0)
                {
-                       img = new Fl_PNG_Image(FILE_NO_SCREENSHOT);
+                       img = new Fl_JPEG_Image(filename);
+                       printf("  JPEG Screenshot : \"%s\"\n", filename);
                }
                else if (snprintf(filename, PATH_MAX, "%s/%s.jpeg", 
THUMBNAILSDIR, (const char *)data) &&
                        stat(filename, &fileinfo) == 0)
                {
-                       img = new Fl_PNG_Image(FILE_NO_SCREENSHOT);
+                       img = new Fl_JPEG_Image(filename);
+                       printf("  JPEG Screenshot : \"%s\"\n", filename);
                }
                else
                {
+                       img = NULL;
+               }
+               if (img && !img->count())
+               {
+                       printf("  Wrong Screenshot.\n");
+                       delete img;
+                       img = NULL;
+               }
+               if (!img)
+               {
                        strncpy(filename, FILE_NO_SCREENSHOT, PATH_MAX);
                        img = new Fl_PNG_Image(FILE_NO_SCREENSHOT);
                }
+
                Fl_Group *highest_parent=parent();
                while (highest_parent->parent()) highest_parent = 
highest_parent->parent();
                GamesUI *ui = highest_parent ? 
(GamesUI*)(highest_parent->user_data()) : NULL;


_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-games-commits

Reply via email to