Browse Source

Allow for named images.

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
7bf94b5ad6
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      src/core/image.c

+ 5
- 3
src/core/image.c View File

49
 int register_image ( struct image *image ) {
49
 int register_image ( struct image *image ) {
50
 	static unsigned int imgindex = 0;
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
 	/* Add to image list */
58
 	/* Add to image list */
57
 	list_add_tail ( &image->list, &images );
59
 	list_add_tail ( &image->list, &images );

Loading…
Cancel
Save