X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=33b677954947107346e76e69d65f778027d1e2f6;hb=c3e0f340f3ba490911b5e1dce7d9902b01afc207;hp=6763d611a6d9ac384dc0228337f934afe45fcc39;hpb=b275388df382d188bdce63b9e68783cb7139fc11;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 6763d611..33b67795 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1150,10 +1150,12 @@ void FadeSkipNextFadeOut(void) static Bitmap *getBitmapFromGraphicOrDefault(int graphic, int default_graphic) { + if (graphic == IMG_UNDEFINED) + return NULL; + boolean redefined = getImageListEntryFromImageID(graphic)->redefined; - return (graphic == IMG_UNDEFINED ? NULL : - graphic_info[graphic].bitmap != NULL || redefined ? + return (graphic_info[graphic].bitmap != NULL || redefined ? graphic_info[graphic].bitmap : graphic_info[default_graphic].bitmap); } @@ -9658,6 +9660,8 @@ void ChangeViewportPropertiesIfNeeded(void) { // printf("::: init_video_buffer\n"); + FreeAllImageTextures(); // needs old renderer to free the textures + InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen); InitImageTextures(); }