Przeglądaj źródła

Allow for named images.

tags/v0.9.3
Michael Brown 18 lat temu
rodzic
commit
7bf94b5ad6
1 zmienionych plików z 5 dodań i 3 usunięć
  1. 5
    3
      src/core/image.c

+ 5
- 3
src/core/image.c Wyświetl plik

@@ -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 );

Ładowanie…
Anuluj
Zapisz