SDL_DetectPalette(SDL_Palette *pal, SDL_bool *is_opaque, SDL_bool *has_alpha_channel)
{
    int i;

    {
        SDL_bool all_opaque = SDL_TRUE;
        for (i = 0; i < pal->ncolors; i++) {
            Uint8 alpha_value = pal->colors[i].a;
            if (alpha_value != SDL_ALPHA_OPAQUE) {
                all_opaque = SDL_FALSE;
                break;
            }
        }

        if (all_opaque) {
            /* Palette is opaque, with an alpha channel */
            *is_opaque = SDL_TRUE;
            *has_alpha_channel = SDL_TRUE;
            return;
        }
    }

    {
        SDL_bool all_transparent = SDL_TRUE;
        for (i = 0; i < pal->ncolors; i++) {
            Uint8 alpha_value = pal->colors[i].a;
            if (alpha_value != SDL_ALPHA_TRANSPARENT) {
                all_transparent = SDL_FALSE;
                break;
            }
        }

        if (all_transparent) {
            /* Palette is opaque, without an alpha channel */
            *is_opaque = SDL_TRUE;
            *has_alpha_channel = SDL_FALSE;
            return;
        }
    }

    /* Palette has alpha values */
    *is_opaque = SDL_FALSE;
    *has_alpha_channel = SDL_TRUE;
}
SDL_DetectPalette(SDL_Palette *pal, SDL_bool *is_opaque, SDL_bool *has_alpha_channel)
{
    int i;

    {
        SDL_bool all_opaque = SDL_TRUE;
        for (i = 0; i < pal->ncolors; i++) {
            Uint8 alpha_value = pal->colors[i].a;
            if (alpha_value != SDL_ALPHA_OPAQUE) {
                all_opaque = SDL_FALSE;
                break;
            }
        }

        if (all_opaque) {
             
            *is_opaque = SDL_TRUE;
            *has_alpha_channel = SDL_TRUE;
            return;
        }
    }

    {
        SDL_bool all_transparent = SDL_TRUE;
        for (i = 0; i < pal->ncolors; i++) {
            Uint8 alpha_value = pal->colors[i].a;
            if (alpha_value != SDL_ALPHA_TRANSPARENT) {
                all_transparent = SDL_FALSE;
                break;
            }
        }

        if (all_transparent) {
             
            *is_opaque = SDL_TRUE;
            *has_alpha_channel = SDL_FALSE;
            return;
        }
    }

     
    *is_opaque = SDL_FALSE;
    *has_alpha_channel = SDL_TRUE;
}