Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Allegro 4: red/blue swapped after screen mode change

This thread is locked; no one can reply to it. rss feed Print
Allegro 4: red/blue swapped after screen mode change
Andrew Gillett
Member #15,868
January 2015

See screenshot. The red and blue channels have been swapped, excluding the green background which is drawn using clear_to_color. The sprites are drawn with draw_rle_sprite. This happens only very occasionally, after changing screen mode. The color depth is set to 32 bit at the start of the program and never changes. I have not found a way to consistently repro this.

bamccaig
Member #7,536
July 2006
avatar

Just FYI, you can embed images in the page using markdown (or XHTML) syntax:

[https://d1cxvcw9gjxu2x.cloudfront.net/attachments/612067]

becomes

{"name":"612067","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/6\/764a192fc1b651b0f1bc5f05bac07f1a.png","w":1920,"h":1080,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/6\/764a192fc1b651b0f1bc5f05bac07f1a"}612067

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Allegro 4 isn't smart enough to automatically convert your bitmaps when the display format changes, so it has to do software conversion or no conversion at all, and simply because the display order is swapped, the colors will be swapped.

Simple remedy - reload all your images when changing display modes.

Andrew Gillett
Member #15,868
January 2015

The weird thing is this only happens rarely. Regarding reloading images, does this mean I also have to reload any datafiles containing images?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Go to: