浏览代码

Allow for named images.

tags/v0.9.3
Michael Brown 18 年前
父节点
当前提交
7bf94b5ad6
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5
    3
      src/core/image.c

+ 5
- 3
src/core/image.c 查看文件

@@ -49,9 +49,11 @@ static struct image_type image_types_end[0]
49 49
 int register_image ( struct image *image ) {
50 50
 	static unsigned int imgindex = 0;
51 51
 
52
-	/* Create image name */
53
-	snprintf ( image->name, sizeof ( image->name ), "img%d",
54
-		   imgindex++ );
52
+	/* Create image name if it doesn't already have one */
53
+	if ( ! image->name[0] ) {
54
+		snprintf ( image->name, sizeof ( image->name ), "img%d",
55
+			   imgindex++ );
56
+	}
55 57
 
56 58
 	/* Add to image list */
57 59
 	list_add_tail ( &image->list, &images );

正在加载...
取消
保存