Re: [AD] Proposal for new branch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Peter Wang wrote:

Angelo Mottola wrote:

And when I press a key to continue and the 3 timers are started, they seem to start ok, but after a while they're not in sync as they should... Is this happening also under Linux?

Ah, crap, you're right.  I'll see what I can do.


I have attached a fix, but I don't know if it's acceptable to change the TIMERS_PER_SECOND constant. Since its not mentioned in the docs, I think it'd be okay.

Peter
Index: include/allegro/alcompat.h
===================================================================
RCS file: /cvsroot/alleg/allegro/include/allegro/alcompat.h,v
retrieving revision 1.17.2.1
diff -u -r1.17.2.1 alcompat.h
--- include/allegro/alcompat.h	27 Aug 2004 08:55:45 -0000	1.17.2.1
+++ include/allegro/alcompat.h	27 Aug 2004 16:51:05 -0000
@@ -230,7 +230,7 @@
 
 
 /* the old timer API */
-#define TIMERS_PER_SECOND     1193181L
+#define TIMERS_PER_SECOND     1000000L
 #define SECS_TO_TIMER(x)      ((long)(x) * TIMERS_PER_SECOND)
 #define MSEC_TO_TIMER(x)      ((long)(x) * (TIMERS_PER_SECOND / 1000))
 #define BPS_TO_TIMER(x)       (TIMERS_PER_SECOND / (long)(x))
Index: src/timer.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/timer.c,v
retrieving revision 1.17.2.2
diff -u -r1.17.2.2 timer.c
--- src/timer.c	27 Aug 2004 12:47:03 -0000	1.17.2.2
+++ src/timer.c	27 Aug 2004 16:51:06 -0000
@@ -26,7 +26,7 @@
 
 
 
-#define TIMER_TO_MSEC(x)  ((long)((x) / 1193.181))
+#define TIMER_TO_MSEC(x)  ((long)((x) / 1000.0))
 
 /* list of active timer handlers */
 typedef struct TIMER_QUEUE


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/