Przeglądaj źródła

[image] Revert "clear LOADED flag" patch

Clearing the LOADED flag actually prevents users from doing clever things
such as loading an image, then loading a patch image, then executing the
first image.  (image_exec() checks for IMAGE_LOADED, so this sequence of
operations will fail if the LOADED flag gets cleared.)

This reverts commit 14c080020f.
tags/v0.9.4
Michael Brown 16 lat temu
rodzic
commit
4f2861a376
1 zmienionych plików z 1 dodań i 10 usunięć
  1. 1
    10
      src/core/image.c

+ 1
- 10
src/core/image.c Wyświetl plik

156
 struct image * find_image ( const char *name ) {
156
 struct image * find_image ( const char *name ) {
157
 	struct image *image;
157
 	struct image *image;
158
 
158
 
159
-	for_each_image ( image ) {
159
+	list_for_each_entry ( image, &images, list ) {
160
 		if ( strcmp ( image->name, name ) == 0 )
160
 		if ( strcmp ( image->name, name ) == 0 )
161
 			return image;
161
 			return image;
162
 	}
162
 	}
172
  * @ret rc		Return status code
172
  * @ret rc		Return status code
173
  */
173
  */
174
 static int image_load_type ( struct image *image, struct image_type *type ) {
174
 static int image_load_type ( struct image *image, struct image_type *type ) {
175
-	struct image *tmp_image;
176
 	int rc;
175
 	int rc;
177
 
176
 
178
 	/* Check image is actually loadable */
177
 	/* Check image is actually loadable */
179
 	if ( ! type->load )
178
 	if ( ! type->load )
180
 		return -ENOEXEC;
179
 		return -ENOEXEC;
181
 
180
 
182
-	/* Clear the loaded flag on all images; loading this image
183
-	 * will invalidate any previous loads.  (Even if loading
184
-	 * fails, the previously loaded image may still have been
185
-	 * partially overwritten.)
186
-	 */
187
-	for_each_image ( tmp_image )
188
-		tmp_image->flags &= ~IMAGE_LOADED;
189
-
190
 	/* Try the image loader */
181
 	/* Try the image loader */
191
 	if ( ( rc = type->load ( image ) ) != 0 ) {
182
 	if ( ( rc = type->load ( image ) ) != 0 ) {
192
 		DBGC ( image, "IMAGE %p could not load as %s: %s\n",
183
 		DBGC ( image, "IMAGE %p could not load as %s: %s\n",

Ładowanie…
Anuluj
Zapisz