moved code to separate function
authorHolger Schemel <info@artsoft.org>
Wed, 6 Dec 2023 19:54:59 +0000 (20:54 +0100)
committerHolger Schemel <info@artsoft.org>
Wed, 6 Dec 2023 19:54:59 +0000 (20:54 +0100)
src/libgame/system.c
src/libgame/system.h

index 2fad22274b84e09fc5bdac61421b860f511265ab..c1abb8a41ab1d11d7d43f34f5c128dea14694e99 100644 (file)
@@ -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;
 }
index b41948012af532ee4155c464b7138f6b146f5f7a..d00c47ba1c3e14d2d1557169024626b0578b7a16 100644 (file)
@@ -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);