I've made a little program that stores the data of my sprite structure
into a data file format. (all of the following in C)
The problem occurs in another program that loads it back into memory
and displays it. Since the data involved is no more than 2kb, I'm
suprised to get stack collision with heap errors on a real Mac SE (with
4 megs RAM). The error doesn't occur in the Basilisk II emulator for
Pc, which emulates a Performa class mac (understandly, since I set it
at 32 megs RAM). It also doesn't occur in mini-vMac for Pc, which
emulates a Mac Plus with 4 megs RAM.
The problem vanished on the real Mac SE once I removed the calls
MaxApplZone() and 3 calls of MoreMasters().
I want to understand how loading less than 2kb of data can produce such
a mac bomb (Type 28 error).
Specifics:
the Sprite structure contains the following
short numberFrames; (number of frames)
Rect theRect; (bounding rect for the sprite)
BitMapHandle buffh; (Handle to a bitmap that stores the background
behind the sprite to be drawn; can remain NULL if I choose not to use
that feature when the sprite is declared and assigned)
BitMapHandle frames;
BitMapHandle masks; (both point to an array (number of elements:
numberFrames) of BitMaps. frames point to the actual b&w bitmaps that
constitute the graphics, while masks are generated from frames during
the assignment of the Sprite.
What do you recommend I do? Do you think it would help if I call
CompactMem in a few places in the function that loads the data from the
file to the Sprite in memory?
into a data file format. (all of the following in C)
The problem occurs in another program that loads it back into memory
and displays it. Since the data involved is no more than 2kb, I'm
suprised to get stack collision with heap errors on a real Mac SE (with
4 megs RAM). The error doesn't occur in the Basilisk II emulator for
Pc, which emulates a Performa class mac (understandly, since I set it
at 32 megs RAM). It also doesn't occur in mini-vMac for Pc, which
emulates a Mac Plus with 4 megs RAM.
The problem vanished on the real Mac SE once I removed the calls
MaxApplZone() and 3 calls of MoreMasters().
I want to understand how loading less than 2kb of data can produce such
a mac bomb (Type 28 error).
Specifics:
the Sprite structure contains the following
short numberFrames; (number of frames)
Rect theRect; (bounding rect for the sprite)
BitMapHandle buffh; (Handle to a bitmap that stores the background
behind the sprite to be drawn; can remain NULL if I choose not to use
that feature when the sprite is declared and assigned)
BitMapHandle frames;
BitMapHandle masks; (both point to an array (number of elements:
numberFrames) of BitMaps. frames point to the actual b&w bitmaps that
constitute the graphics, while masks are generated from frames during
the assignment of the Sprite.
What do you recommend I do? Do you think it would help if I call
CompactMem in a few places in the function that loads the data from the
file to the Sprite in memory?