sdl12-compat: surface: 1.2 colorkeys were ignored if the surface had an alpha channel.

From bd3be23cf9f952ec13d5654cc1dc9c4e3801ff69 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Sun, 14 May 2023 00:37:16 -0400
Subject: [PATCH] surface: 1.2 colorkeys were ignored if the surface had an
 alpha channel.

Without this, the main menu on tuxfootball is wrong, since it's trying
to draw white text from an RGBA surface with a white colorkey set. Since
classic 1.2 would ignore the colorkey, this worked, but SDL2 still honors
the colorkey to discard pixels before alpha-blending what's left.

Fixes #265.
---
 src/SDL12_compat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index edbe98a87..f29e98f47 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -6590,6 +6590,10 @@ SDL_SetColorKey(SDL12_Surface *surface12, Uint32 flag12, Uint32 key)
 
     if (addkey) {
         surface12->flags |= SDL12_SRCCOLORKEY;
+        /* you could set a color key on a 1.2 surface that had an alpha channel, but it would be ignored during blits. */
+        if (surface12->format->Amask) {
+            SDL20_SetColorKey(surface12->surface20, SDL_FALSE, key);
+        }
     } else {
         surface12->flags &= ~SDL12_SRCCOLORKEY;
     }