소스 검색

Allow for named images.

tags/v0.9.3
Michael Brown 19 년 전
부모
커밋
7bf94b5ad6
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5
    3
      src/core/image.c

+ 5
- 3
src/core/image.c 파일 보기

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…
취소
저장