RE: [AD] Successives calls to fixup_datafile() |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: <alleg-developers@xxxxxxxxxx>
- Subject: RE: [AD] Successives calls to fixup_datafile()
- From: "Robert Ohannessian" <ROhannessian@xxxxxxxxxx>
- Date: Tue, 2 Aug 2005 12:06:35 -0700
- Thread-index: AcWXijLW6UR5fbkdQDWjb11kVdgNxQACtHjQ
- Thread-topic: [AD] Successives calls to fixup_datafile()
That's correct: Allegro can't deal with multiple screen mode switches
and fixing up datafiles.
When you call fixup_datafile, the DATAFILE you loaded is permanently
converted to whatever is the current component ordering for your screen
mode. If you call fixup_datafile again, the function assumes you have a
freshly loaded datafile. It cannot "undo" the previous conversion.
You have two choices: Either call fixup_datafile() just once and hope
that the component ordering and bit depth doesn't change when the screen
mode changes (unlikely). Or, you can reload your datafiles when the
screen mode changes.
-----Original Message-----
From: alleg-developers-admin@xxxxxxxxxx
[mailto:alleg-developers-admin@xxxxxxxxxx] On Behalf Of Omar
Cornut
Sent: Sunday, July 31, 2005 9:25 AM
To: alleg-developers@xxxxxxxxxx
Subject: [AD] Successives calls to fixup_datafile()
Hello,
Are successive calls to fixup_datafile() on a same datafile
supposed to be working?
I have problems in my application, using true-color graphics
loaded from a datafile. My application allows switching video
mode dynamically, one of the common point being to allow to
switch from fullscreen to windowed driver using ALT-ENTER.
Without using fixup_datafile(), I'm getting BGR colors on a RGB
display (B and R components being reversed).
Calling fixup_datafile() after each video mode change, the
first video mode for which its called works, other doesn't.
I can confirm this if I switch back and forth.
eg:
Start with DIRECTX driver, call fixup_datafile()
Colors ok
Switch to DIRECTX_WIN driver, call fixup_datafile()
Colors reversed
Switch back to DIRECTX driver, call fixup_datafile()
Colors ok
Other way:
Start with DIRECTX_WIN driver, call fixup_datafile()
Colors ok
Switch to DIRECTX driver, call fixup_datafile()
Colors reversed
Switch back to DIRECTX_WIN driver, call fixup_datafile()
Colors ok
Running Windows Allegro WIP 4.1.18.
Any idea? I had a quick look at the code and did not find any
"obvious" return due to multiple call. Conversion is always processed,
but with all those pointer table replacement it is a bit confusing to
follow.
Thanks,
Omar
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
--
https://lists.sourceforge.net/lists/listinfo/alleg-developers