X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ftiming.cpp;fp=src%2Ftiming.cpp;h=2246e47d4830f1caf4f1b3a27c3cd4c394edad94;hb=8dafbf94c7bc84dae635f9dabfc9be5424e49e68;hp=e7ac35f69fc63d1a33d49cbde607fa38acf03845;hpb=e3ad811139308bfe8a818cf5e42e7553785fea82;p=stargem2 diff --git a/src/timing.cpp b/src/timing.cpp old mode 100755 new mode 100644 index e7ac35f..2246e47 --- a/src/timing.cpp +++ b/src/timing.cpp @@ -1,10 +1,10 @@ // // System time handlers // -// by James L. Hammons +// by James Hammons // (C) 2005 Underground Software // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ @@ -20,119 +20,111 @@ #include #include "log.h" -#define EVENT_LIST_SIZE 512 +#define EVENT_LIST_SIZE 512 // NOTE ABOUT TIMING SYSTEM DATA STRUCTURES: - -// A queue won't work for this system because we can't guarantee that an event will go -// in with a time that is later than the ones already queued up. So we just use a simple -// list. - -// Although if we used an insertion sort we could, but it wouldn't work for adjusting -// times... +// +// A queue won't work for this system because we can't guarantee that an event +// will go in with a time that is later than the ones already queued up. So we +// just use a simple list. +// +// Although if we used an insertion sort we could, but it wouldn't work for +// adjusting times... // [In that case, we could pull the event out, close the gap, then do insertion sort] struct Event { - bool valid; - double eventTime; - void (* timerCallback)(void); + bool valid; + double eventTime; + void (* timerCallback)(void); }; - static Event eventList[EVENT_LIST_SIZE]; static uint32_t nextEvent; - void InitializeEventList(void) { - for(uint32_t i=0; i