From: Holger Schemel Date: Wed, 6 Dec 2023 19:54:59 +0000 (+0100) Subject: moved code to separate function X-Git-Tag: 4.3.8.0~9 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=3eeac0d62d19cbdd926ed329ffb70a3105a94d27;p=rocksndiamonds.git moved code to separate function --- diff --git a/src/libgame/system.c b/src/libgame/system.c index 2fad2227..c1abb8a4 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -599,15 +599,20 @@ void FreeBitmap(Bitmap *bitmap) free(bitmap); } +void ResetBitmapAlpha(Bitmap *bitmap) +{ + bitmap->alpha[0][0] = -1; + bitmap->alpha[0][1] = -1; + bitmap->alpha[1][0] = -1; + bitmap->alpha[1][1] = -1; + bitmap->alpha_next_blit = -1; +} + Bitmap *CreateBitmapStruct(void) { Bitmap *new_bitmap = checked_calloc(sizeof(Bitmap)); - new_bitmap->alpha[0][0] = -1; - new_bitmap->alpha[0][1] = -1; - new_bitmap->alpha[1][0] = -1; - new_bitmap->alpha[1][1] = -1; - new_bitmap->alpha_next_blit = -1; + ResetBitmapAlpha(new_bitmap); return new_bitmap; } diff --git a/src/libgame/system.h b/src/libgame/system.h index b4194801..d00c47ba 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -2009,6 +2009,7 @@ void InitVideoDefaults(void); void InitVideoDisplay(void); void CloseVideoDisplay(void); void InitVideoBuffer(int, int, int, boolean); +void ResetBitmapAlpha(Bitmap *); Bitmap *CreateBitmapStruct(void); Bitmap *CreateBitmap(int, int, int); void ReCreateBitmap(Bitmap **, int, int);