jorio / CroMagRally

The wildest racing game since man invented the wheel!
https://pangeasoft.net/cromag
Other
118 stars 13 forks source link

Linux PPC: Graphics Issues #11

Closed chzigotzky closed 7 months ago

chzigotzky commented 2 years ago

Hi All,

First, many thanks for this game and thanks a lot for the big endian changes!

I was able to compile it on MintPPC and Void PPC today. It works but there are some graphics issues.

Cro-Mac-Rally2

Cro-Mac-Rally1

System:

I use the git version. (git clone --recurse-submodules https://github.com/jorio/CroMagRally)

Any ideas because of the graphics issues?

Thanks, Christian

jorio commented 2 years ago

Looks like your GL driver incorrectly handles GL_RGB to GL_RGB5_A1 conversions. In ReadMaterialTextureMap (bg3d.c), try forcing a straightforward GL_RGB to GL_RGB conversion like this:

            /* COPY BASIC INFO */

    if (data->numMipmaps == 0)                    // see if this is the first texture
    {
        data->width              = textureHeader.width;
        data->height             = textureHeader.height;
        data->pixelSrcFormat     = textureHeader.srcPixelFormat;        // internal format
        data->pixelDstFormat     = textureHeader.dstPixelFormat;        // vram format

        if (data->pixelSrcFormat == GL_RGB)        // <------- ADD THIS
            data->pixelDstFormat = GL_RGB;         // <------- ADD THIS
    }
chzigotzky commented 2 years ago

It works! Thanks a lot!!!!!! :-)

Cro-Mag-Rally-Linux-Power-PC-2

Cro-Mag-Rally-Linux-Power-PC-1

tobhe commented 7 months ago

I encountered the same bug under OpenBSD on a PowerBook G4. The change you suggested helped. Is there any chance we could get this fixed in tree?

jorio commented 7 months ago

OK, I'll mainline this fix and I'll make a maintenance release soon.

jorio commented 7 months ago

The fix is in CMR 3.0.1. Feel free to reopen if you encounter more graphics issues.