#SaveCel weirdness
<< … run it a few times with varying sized cels:
main() {
if (CelExists()) {
SaveCel("TRIAL.CEL");
LoadCel("TRIAL.CEL");
} }
>>
Looks like you've found another example of weird results associated with
cels.
Have these happened to you (As you noted some occur only with large cels).
– If after using "Element/Cel" in the optics menu you attempt to
re-enter Optics without a cel in the cel buffer, Animator will
abend.
– If you use "Cel/Release" you will be asked if you really want to
delete … A false warning. No file is deleted, only the copy in
memory is released.
– If while in the Animated Cel screen you load a cel and then delete
the file from the disk (using Cel/Browse/Delete), you will not be
able to continue using that cel, though still present on the
screen. You will not be able to save it either. It's gone forever!
(All that was visible was one frame of the cel)
– If that happens to you, make sure you don't need to use the Animated Cel
screen any
more because after leaving that screen you will not be allowed to
re-enter it during that session (unless …)
– Also, be prepared to be greeted with a mysterious "File not found
… name misspelled?" message the next time you start Animator.
Having developed programs under the pressure of deadlines, I think I
know the origin of these and other problems with cels. The following
is MY (unconfirned) theory.
Consider the following scenerio. A successor to the original animator
is being architected. Three items are at the top of the list:
1. Increasing the 320×200 resolution limit.
2. Capability to play high resolution animations at full speed
3. Animated (multi-frame) cels
The first item increases the amount of storage needed. Virtual memory
(disk) cannot be used because of the second item. Memory is the only
candidate.
The third item, animated-cels, requires capability to process two
animations simultaneouslty, potentially requiring additional
memory.
Someone mentions that the new "dos extenders" would make it possible
to remove the resolution limitation from Animator altogether, by
allowing applications to access more memory.
Reducing memory requirements becomes critical. No problem, says the
individual that probalbly also came up with the Swap disk concept for
3DS, cels do not have to be played at full speed and cel data can be
accessed from the hard disk as needed.
The approach however required "exception handling." A no-no in
software development. Cel files were not going to be handled like the
other files. Therefore the problems.
It's a theory anyway.
But do a test, time the time it takes to "load" a multi-meg
animation, both as a flic and as a cel. You'll see the difference.
Most of the cel remains on the disk, and takes no time to load.
You can see attempts at handling cels files differently here and
there. For example, notice that in the animated cel screen it is
possible to load, or save a cel, but there is no way to deleting a
cel.
Oris there? Proper handling of exceiptions is sure to be overlooked
by someone. The current cel can be deleted by first selecting
"Browse" in the "Cel" dropdown menu as mentioned before.
When you delete the current cel from the disk you simultaneously
delete it from memory (virtual memory, but memory none-the-less).
<it's my first time I've had to send large Cels> And only large cels
use the disk for virtual memory. Maybe the POCO implementation didn't
handle the exception correctly either.
<Is this problem reproducible on your system> Yes
<have you seen this before, and are you aware of any fixes or
workaround? > I think youd have to save the cel as a flic by first
pasting it on an empty flic.
<By the way, here's a gem I wrote last week when I discovered that
(itoa) is not available in POCO language… integer to ASCII. There's
(atoi), but no reversal. This works beautifully:>
Neat! Saved it with my other useful Poco programs.
< Just got an article off to Barbara too. Are you writing any for next
issue? >
I just couldn't find the time. It would have taken me away from a
really exciting job: writing sample code for the script extension
modules. I'll be uploading some animations soon.
What did you write about?
Ed K