Amulets & Armor
v1.02
Open Source Game
|
Sliding Wall/Door System. More...
Data Structures | |
struct | T_sliderHandleStruct |
struct | T_sliderTag |
Typedefs | |
typedef struct T_sliderTag | T_slider |
Functions | |
T_void | SliderCancel (T_word32 sliderId) |
T_void | SliderDestroy (T_word32 sliderId) |
E_Boolean | SliderExist (T_word32 sliderId) |
T_void | SliderFinish (T_void) |
T_void | SliderInitialize (T_void) |
T_void | SliderReverse (T_word32 sliderId, T_word16 newActivity) |
T_void | SliderStart (T_word32 sliderId, T_sword32 start, T_sword32 end, T_sword32 time, T_sliderEventHandler handler, T_word16 finalActivity) |
Sliding Wall/Door System.
Opening doors and walls is a big part of the game, so we made a system called Sliders that work on these. This information tracks the state of the sliding action, but the sectors keep all the real data.
typedef struct T_sliderTag T_slider |
SliderCancel stops a slider that is in progress. The slider is noted for canceling and on the next call to ScheduleUpdateEvents, it will be removed/deleted.
NOTE: Don't call this routine unless you KNOWN a slider is still active. A bomb will occur if there is no slider.
sliderId | – Slider to cancel. |
SliderExist checks to see if the given slider exists.
sliderId | – Slider to cancel. |
SliderFinish is to be called when the system is done and no longer needs sliders. All remaining sliders are discarded from memory.
NOTE: Make sure that no calls to ScheduleUpdateEvents occur again after SliderFinish is executed. This insures that no remaining scheduled items with callbacks to the slider module are called.
SliderInitialize is called to start up the slider system. No other routines can be called until this first step is taken.
NOTE: All other slider routines will bomb unless this is called. Also, you must call SliderFinish before calling this routine again.
SliderReverse changes the direction that a slider is going to back its original value. If a different value is wanted, just use SliderCancel and SliderStart than this routine. In addition, an option new final activity can be supplied.
NOTE: Don't call this routine unless you KNOWN a slider is still active. A bomb will occur if there is no slider.
sliderId | – Slider to cancel. |
newActivity | – New activity to run, or 0x8000 for no change. Also, a value of -1 (0xFFFF) sets up a non-activity. |
T_void SliderStart | ( | T_word32 | sliderId, |
T_sword32 | start, | ||
T_sword32 | end, | ||
T_sword32 | time, | ||
T_sliderEventHandler | handler, | ||
T_word16 | finalActivity | ||
) |
SliderStart is called to add another slider event to the slider list. A slider is an event that occurs over several points in time and will range over a start and end value over a given period of time. Each time the slider changes the value, a callback routine is called to handle the new value. In addition, a optional script activity can be called once the sliding value has reached its goal value. In addition, a unique ID is passed to the routine. Should there exist a slider already in existance, the slider will redirect its direction and go to the new value.
sliderId | – Unique ID |
start | – Starting value |
end | – Ending value |
time | – Time to take to change |
handler | – Callback routine for each value change |
finalActivity | – Activity to call when done 0xFFFF = none. |