diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2009-06-01 15:54:21 +0100 |
---|---|---|
committer | Jakob Bornecrantz <jakob@vmware.com> | 2009-06-01 15:54:21 +0100 |
commit | 0dddb4b5b20db4a6d0d8ee5ac6ae81c99062ad68 (patch) | |
tree | f12dd52e2987ad9fad14ac6b370774c9e0efd003 | |
parent | 3675a8c99ed32dbf6ea18be3a4d5a89371fe0ede (diff) |
Add compressed texture icons
-rw-r--r-- | res/dxt1_rgb.png | bin | 0 -> 398 bytes | |||
-rw-r--r-- | res/dxt1_rgba.png | bin | 0 -> 388 bytes | |||
-rw-r--r-- | res/dxt3_rgba.png | bin | 0 -> 444 bytes | |||
-rw-r--r-- | res/dxt5_rgba.png | bin | 0 -> 433 bytes | |||
-rw-r--r-- | src/main.c | 5 | ||||
-rw-r--r-- | src/texture.c | 18 |
6 files changed, 20 insertions, 3 deletions
diff --git a/res/dxt1_rgb.png b/res/dxt1_rgb.png Binary files differnew file mode 100644 index 0000000..32ff6b1 --- /dev/null +++ b/res/dxt1_rgb.png diff --git a/res/dxt1_rgba.png b/res/dxt1_rgba.png Binary files differnew file mode 100644 index 0000000..84ccd3d --- /dev/null +++ b/res/dxt1_rgba.png diff --git a/res/dxt3_rgba.png b/res/dxt3_rgba.png Binary files differnew file mode 100644 index 0000000..4f5fb09 --- /dev/null +++ b/res/dxt3_rgba.png diff --git a/res/dxt5_rgba.png b/res/dxt5_rgba.png Binary files differnew file mode 100644 index 0000000..46b5935 --- /dev/null +++ b/res/dxt5_rgba.png @@ -222,6 +222,11 @@ static void icon_setup(struct program *p) icon_add("res/rgb.png", "rgb", p); icon_add("res/rgb.png", "bgr", p); + icon_add("res/dxt1_rgb.png", "dxt1_rgb", p); + icon_add("res/dxt1_rgba.png", "dxt1_rgba", p); + icon_add("res/dxt3_rgba.png", "dxt3_rgba", p); + icon_add("res/dxt5_rgba.png", "dxt5_rgba", p); + icon_add("res/screen.png", "screen", p); icon_add("res/shader_on_normal.png", "shader_on_normal", p); diff --git a/src/texture.c b/src/texture.c index cdd7e0c..f1455a0 100644 --- a/src/texture.c +++ b/src/texture.c @@ -394,6 +394,7 @@ static void texture_action_read_info(struct rbug_event *e, struct rbug_proto_texture_info_reply *info; struct texture_action_read *action; uint32_t serial = 0; + GdkPixbuf *buf = NULL; info = (struct rbug_proto_texture_info_reply *)header; action = (struct texture_action_read *)e; @@ -407,9 +408,8 @@ static void texture_action_read_info(struct rbug_event *e, } if (pf_layout(info->format) == PIPE_FORMAT_LAYOUT_RGBAZS) { - GdkPixbuf *buf = NULL; - int swz = (info->format >> 2) & 0xFFF; + if (!swz) ; else if (swz == _PIPE_FORMAT_RGBA) @@ -432,9 +432,21 @@ static void texture_action_read_info(struct rbug_event *e, else if (swz == _PIPE_FORMAT_Z000) buf = icon_get("z24x8", p); - gtk_tree_store_set(p->main.treestore, &action->iter, COLUMN_PIXBUF, buf, -1); + } else if (pf_layout(info->format) == PIPE_FORMAT_LAYOUT_DXT) { + + if (info->format == PIPE_FORMAT_DXT1_RGB) + buf = icon_get("dxt1_rgb", p); + else if (info->format == PIPE_FORMAT_DXT1_RGBA) + buf = icon_get("dxt1_rgba", p); + else if (info->format == PIPE_FORMAT_DXT3_RGBA) + buf = icon_get("dxt3_rgba", p); + else if (info->format == PIPE_FORMAT_DXT5_RGBA) + buf = icon_get("dxt5_rgba", p); + } + gtk_tree_store_set(p->main.treestore, &action->iter, COLUMN_PIXBUF, buf, -1); + /* no longer interested in this action */ if (!action->running || p->texture.read != action) goto error; |