www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/30/08:31:18

From: snoky AT ms2 DOT accmail DOT com DOT tw (bzan)
Newsgroups: comp.os.msdos.djgpp
Subject: Question of timer routine for Allegro
Date: Sat, 30 May 1998 11:43:37 GMT
Organization: SEEDNET InterNetNews News System
Lines: 25
Message-ID: <356ff0dd.2237065@news.seed.net.tw>
NNTP-Posting-Host: t204-128.dialup.seed.net.tw
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

hi all,
I'd finished a little game yesterday, using Allegro 3.0 for DJGPP.
In this game, I installed my own time handler to show the game time on
screen, and it works. Today I play it for test, and then I found a
wondering problem in it, ie. the timer of my game seem to run slower
than actually it does. I'm not sure if are the problems from my
program, or Allegro?
the following codes is a piece of my program:

void GameTimer ()
{  
   char buffer[10];

   sprintf (buffer, "%02d:%02d", sec / 60, sec % 60); 
   textout (screen, font, buffer, 480, 215, 1);
   sec++;          // sec is a volatile int variable
}
END_OF_FUNCTION (GameTimer);

I make sure that I'd locked all variables and functions which are
necessary. Please help me checking it out where the problem is.
Thanks in advance.

Yen-ting Chou

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019