29 |
#include <ctype.h> |
#include <ctype.h> |
30 |
#include <stdio.h> |
#include <stdio.h> |
31 |
#include <stdlib.h> |
#include <stdlib.h> |
32 |
#include "base/timer.h" |
#include "base/base.h" |
33 |
#include "event/date.h" |
#include "event/date.h" |
34 |
#include "event/manager.h" |
#include "event/manager.h" |
35 |
#include "event/time_event.h" |
#include "event/time_event.h" |
40 |
u_int32 date::Time = 0; |
u_int32 date::Time = 0; |
41 |
|
|
42 |
// how many game cycles make one second of game time |
// how many game cycles make one second of game time |
43 |
float date::Scale = 10.0; |
float date::Scale = 5.0; |
44 |
|
|
45 |
// number of game time seconds before a time event will be raised |
// number of game time seconds before a time event will be raised |
46 |
u_int16 date::Resolution = 1; |
u_int16 date::Resolution = 1; |
52 |
// Increase gametime |
// Increase gametime |
53 |
void date::update () |
void date::update () |
54 |
{ |
{ |
55 |
// fts contains the number of cycles that passed since the last |
// frames_missed contains the number of cycles that have been |
56 |
// call to date::update |
// skipped during the last call to date::update |
57 |
Ticks += 1; // + timer::frames_missed (); |
Ticks += 1 + base::Timer.frames_missed (); |
58 |
|
|
59 |
// check whether to trigger time events |
// check whether to trigger time events |
60 |
while (Ticks >= Scale) |
while (Ticks >= Scale) |