graphic_info[i].bitmap = graphic_info[i].bitmaps[IMG_BITMAP_STANDARD];
}
-static void InitGlobalAnimImages()
+void InitImageTextures()
{
int i, j, k;
if (graphic == IMG_UNDEFINED)
continue;
- // create textures from images for fast GPU blitting, if possible
- CreateImageTextures(graphic);
+ // (re)create textures from images for fast GPU blitting, if possible
+ ReCreateImageTextures(graphic);
}
}
}
print_timestamp_time("InitFontGraphicInfo");
InitGlobalAnimGraphicInfo(); /* initialize global animation config */
print_timestamp_time("InitGlobalAnimGraphicInfo");
- InitGlobalAnimImages(); /* initialize global animation images */
- print_timestamp_time("InitGlobalAnimImages");
+
+ InitImageTextures(); /* create textures for certain images */
+ print_timestamp_time("InitImageTextures");
InitGraphicInfo_EM(); /* graphic mapping for EM engine */
print_timestamp_time("InitGraphicInfo_EM");
void InitGfxBuffers();
void InitGadgets();
+void InitImageTextures();
void DisplayExitMessage(char *, va_list);
setString(&img_info->leveldir, leveldir_current->identifier);
}
-void CreateImageTextures(int pos)
+static void CreateImageTexturesExt(int pos, boolean force)
{
ImageInfo *img_info = getImageInfoEntryFromImageID(pos);
- if (img_info == NULL || img_info->contains_textures)
+ if (img_info == NULL || (img_info->contains_textures && !force))
return;
CreateBitmapTextures(img_info->bitmaps);
img_info->contains_textures = TRUE;
}
+void CreateImageTextures(int pos)
+{
+ CreateImageTexturesExt(pos, FALSE);
+}
+
+void ReCreateImageTextures(int pos)
+{
+ CreateImageTexturesExt(pos, TRUE);
+}
+
void ScaleImage(int pos, int zoom_factor)
{
ImageInfo *img_info = getImageInfoEntryFromImageID(pos);
void ReloadCustomImages();
void CreateImageWithSmallImages(int, int, int);
void CreateImageTextures(int);
+void ReCreateImageTextures(int);
void ScaleImage(int, int);
void FreeAllImages();
if (bitmap == NULL)
return;
+ if (bitmap->texture)
+ SDL_DestroyTexture(bitmap->texture);
+ if (bitmap->texture_masked)
+ SDL_DestroyTexture(bitmap->texture_masked);
+
bitmap->texture = SDLCreateTextureFromSurface(bitmap->surface);
bitmap->texture_masked = SDLCreateTextureFromSurface(bitmap->surface_masked);
#endif
// printf("::: init_video_buffer\n");
InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen);
+ InitImageTextures();
}
if (init_gadgets_and_toons)