/* Handle the "attached" event by starting our timer. */ static void Attached(AG_Event *event) { Animal *animal = AG_SELF(); AG_ScheduleTimeout(animal, &animal->time, 1000); }
// // EnableJoystickUpdates // void Xbox::EnableJoystickUpdates(bool enable) { AG_LockTimeouts(NULL); if(enable) { if(!AG_TimeoutIsScheduled(NULL, &JoyUpdateTimeout)) AG_ScheduleTimeout(NULL, &JoyUpdateTimeout, 5); } else { if(AG_TimeoutIsScheduled(NULL, &JoyUpdateTimeout)) AG_DelTimeout(NULL, &JoyUpdateTimeout); } AG_UnlockTimeouts(NULL); }