usage: gbmvfsa [-l] [-p] [-s] [-t] [-P] n1 n2 n3 fspec{,opt} flags: -l loop indefinately -p set palette only once, assume same -s single step the frames -t annotate each frame with its title -P display palette bar n1 n2 n3 for ( f=n1; f<n2; f+=n3 ) fspec printf(fspec, f); filespecs are of the form fn.ext bitmap formats and options as before
This program can be used display an animation consisting of a collection of individual bitmap frames.
It displays the animation to the OS/2 Full Screen 320x200 at 8bpp VGA screen mode. Because of this, GBMVFSA is limited to displaying bitmaps of 320x200 or less, and they must be 8bpp. Also, all the bitmaps must be the same size.
If all the bitmaps share the same palette (presumably enforced by
using GBMCPAL) then specify the -p
option.
If the bitmaps have different palettes then visual artifacts can be produced. This is because for each new frame, the palette is changed, and then the screen bitmap bits are changed. Thus there is a small window in which the old bits are displayed with the new palette. At this time I know of no architected way to synchronise the changes to occur with the vertical retrace, using the OS/2 Vio API.
One way to avoid the problem is to have each bitmap use 128 colours. Even bitmaps would use palette entrys 0 - 127, and palette entries 128 - 255 would contain the previous pictures palette. Similarly in reverse for odd bitmaps.
GBMCPAL (from the base GBM package) provides an attempt at solving the
problem.
Its rofreq
and romcut
options reorder palette
entries to try to minimise changes between successive frames.
This significantly reduces flicker.
In most cases, flicker can be totally eliminated.
The important thing to note is that it is not GBMVFSA's job to solve this problem, it is the job of the bitmap generating program.
For example, here is what I did to make a spinning globe animation.
First I traced a largish number of individual bitmap frames using my
raytracer, RT.
I wrote these out under the names globeNNN.tif
where
NNN
is 000
, 010
, 020
,
... 350
(ie: the angle of rotation in degrees).
I used the ,lzw
option to get the files
written LZW encoded to reduce the disk space requirements.
Then to map the data to a common palette, I used GBMCPAL :-
gbmcpal -m freq6:6:6:256 0 360 10 globe%03d.tif globe%03d.bmp
To display the animation under OS/2, using fullscreen VGA, I use :-
gbmvfsa -l -p 0 360 10 globe%03d.bmp
Obviously there are file formats specifically for holding animations, and algorithms for having animations where palette entries vary from frame to frame, but the simple example above is ok for many purposes.
As the program runs, certain keys can be used :-
Space advances a single frame - steps back one frame 0 .. 9 moves to 0/10 .. 9/10 of the way through s enters single step mode g resumes continuous play t toggles titleing on/off p toggles palette display on/off Esc,q,x quits
Just unzip the GBMOS2PM package and copy the gbmvfsa.exe
,
file into a directory somewhere.
If you've already got the GBMOS2 package installed into a directory, you might as well put this new file in there too.
GBMVFSA needs gbm.dll
which is part of the GBMOS2 package.
Either copy it into the same directory as gbmvfsa.exe
or to
a directory defined in LIBPATH in the CONFIG.SYS.