Thread: Project Carrot
View Single Post
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

May 9, 2013, 05:09 PM
Violet CLM is offline
Reply With Quote
Zero speed layers are used from time to time for HUDish effects... look at e.g. Tomb Rabbit or Another Story, though those naturally assume a 640x480 resolution.

Here's what deactivating does, using some very verbose names:
Code:
object.pointerToBehaviorFunction = NULL;
//The object is no longer is counted as active,
and its location in memory may be overwritten at any later time.
if (object.wasCreatedDirectlyFromTheLayer4EventMap()) {
    eventMap[object.xTileOfCreation, object.yTileOfCreation] = object.eventID;
    //e.g. 158 for a peach, whatever. For the most part this is
    //redundant, but it does mean that when an object created
    //directly from the event map changes event ID, e.g. a spring
    //crate changing into a green spring, that change will be
    //permanent even if the object is later deactivated.
    setEventMapBit(object.xTileOfCreation, object.yTileOfCreation, 11, false);
    //The event map, of course, is a series of thirty-two bit slots
    //for each tile in layer 4. The first eight bits are used for the
    //event ID. The next three are used for the difficulty and the
    //"Illuminate Surroundings" checkbox. The bit after that is
    //whether the the object created by the event at that tile
    //has already been created or not: setting it to false tells JJ2
    //that the next time that tile comes into active memory, the
    //object should be created, since it hasn't been created already.
}
__________________