[Bug 37398] Urban Assault black screen when using software renderer and DDSCAPS_SYSTEMMEMORY

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Feb 15 15:03:42 CST 2016


https://bugs.winehq.org/show_bug.cgi?id=37398

--- Comment #12 from Sergey Isakov <isakov-sl at bk.ru> ---
(In reply to Erich E. Hoover from comment #10)
> This is actually to get the primary surface to work, without the patch (on
> current git) I get:
> fixme:d3d_surface:surface_convert_format Cannot find a conversion function
> from format WINED3DFMT_P8_UINT to WINED3DFMT_B5G6R5_UNORM.

Implementing this conversion I got the game somehow working in software mode.
~~~~
static void convert_p8_r5g6b5(const BYTE *src, BYTE *dst,
                              DWORD src_pitch, DWORD dst_pitch, unsigned int
width, unsigned int height,
                              const struct wined3d_palette *palette)
{
    unsigned int x, y;
    const BYTE *src_row;
    WORD *dst_row;
    WORD grey = 0x0821;

    for (y = 0; y < height; ++y)
    {
        src_row = &src[src_pitch * y];
        dst_row = (WORD *)&dst[dst_pitch * y];
        for (x = 0; x < width; ++x)
        {
            BYTE src_color = src_row[x];
            if (palette) {
                dst_row[x] =  (palette->colors[src_color].rgbRed << 11)
                            | (palette->colors[src_color].rgbGreen << 5)
                            |  palette->colors[src_color].rgbBlue;
            } else {
                dst_row[x] = grey * src_color;
            }
        }
    }
}
~~~~

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list