summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-02-26 20:30:52 +0000
committerSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-02-26 20:30:52 +0000
commit75e62cb364a9c682f648ed486ff6b6828022ba88 (patch)
treee712f186125754e19a4c01f567baf3c248f485b9 /gui
parentb96e8eb13a9eb9331b5ffb0f5653ad0215a6736c (diff)
downloadpcsxr-75e62cb364a9c682f648ed486ff6b6828022ba88.tar.gz
.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@83178 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'gui')
-rwxr-xr-xgui/MemcardDlg.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/gui/MemcardDlg.c b/gui/MemcardDlg.c
index 90725d9d..0b2b3492 100755
--- a/gui/MemcardDlg.c
+++ b/gui/MemcardDlg.c
@@ -82,25 +82,33 @@ static void AddColumns(GtkTreeView *treeview) {
gtk_tree_view_append_column(treeview, column);
}
-static GdkPixbuf *SetIcon(GtkWidget *dialog, short *icon, int i) {
- GdkPixbuf *result;
+static GdkPixbuf *SetIcon(GtkWidget *dialog, short *icon, int scale) {
+ GdkPixbuf *gdkpixbuf;
+ GdkPixbuf *gdkpixbuf2;
guchar *dest_pixels;
- u32 x, y, c;
-
- result = gdk_pixbuf_new(GDK_COLORSPACE_RGB, 0, 8, 32, 32);
- dest_pixels = gdk_pixbuf_get_pixels(result);
-
- for (y = 0; y < 32; y++) {
- for (x = 0; x < 32; x++) {
- c = icon[(y >> 1) * 16 + (x >> 1)];
+ u32 x, y;
+ u16 c;
+
+ gdkpixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, 0, 8, 16, 16);
+ dest_pixels = gdk_pixbuf_get_pixels(gdkpixbuf);
+
+ for (y = 0; y < 16; y++) {
+ for (x = 0; x < 16; x++) {
+ c = icon[y * 16 + x];
dest_pixels[0] = (c & 0x001f) << 3;
dest_pixels[1] = (c & 0x03e0) >> 2;
dest_pixels[2] = (c & 0x7c00) >> 7;
dest_pixels += 3;
}
}
-
- return result;
+
+ if(scale != 1) {
+ gdkpixbuf2 = gdk_pixbuf_scale_simple(gdkpixbuf, 16 * scale, 16 * scale, GDK_INTERP_NEAREST);
+ g_object_unref(gdkpixbuf);
+ return gdkpixbuf2;
+ }
+
+ return gdkpixbuf;
}
static gchar* MCDStatusToChar(McdBlock *Info) {