1 | /********************************************************************** <BR>
|
---|
2 | This file is part of Crack dot Com's free source code release of
|
---|
3 | Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
|
---|
4 | information about compiling & licensing issues visit this URL</a>
|
---|
5 | <PRE> If that doesn't help, contact Jonathan Clark at
|
---|
6 | golgotha_source@usa.net (Subject should have "GOLG" in it)
|
---|
7 | ***********************************************************************/
|
---|
8 |
|
---|
9 | #ifdef _SATURN
|
---|
10 | extern "C"
|
---|
11 | {
|
---|
12 |
|
---|
13 | #include "sgl.h"
|
---|
14 |
|
---|
15 | };
|
---|
16 | #endif
|
---|
17 |
|
---|
18 | #include "time/time.hh"
|
---|
19 |
|
---|
20 |
|
---|
21 | i4_time_class::i4_time_class()
|
---|
22 | {
|
---|
23 | w32 *sec_usec=(w32 *)private_data;
|
---|
24 |
|
---|
25 | sec_usec[0]=Smpc_Status->rtc.second +
|
---|
26 | Smpc_Status->rtc.minute*60 +
|
---|
27 | Smpc_Status->rtc.hour*60*60;
|
---|
28 | sec_usec[1]=0;
|
---|
29 | }
|
---|
30 |
|
---|
31 |
|
---|
32 |
|
---|
33 | bool i4_time_class::operator <(const i4_time_class &other) const
|
---|
34 | {
|
---|
35 | w32 *me_t=(w32 *)private_data;
|
---|
36 | w32 *other_t=(w32 *)other.private_data;
|
---|
37 | return (other_t[0]<me_t[0] || (other_t[0]==me_t[0] && other_t[1]<me_t[1]));
|
---|
38 | }
|
---|
39 |
|
---|
40 |
|
---|
41 |
|
---|
42 | bool i4_time_class::operator >(const i4_time_class &other) const
|
---|
43 | {
|
---|
44 | w32 *me_t=(w32 *)private_data;
|
---|
45 | w32 *other_t=(w32 *)other.private_data;
|
---|
46 | return (other_t[0]>me_t[0] || (other_t[0]==me_t[0] && other_t[1]>me_t[1]));
|
---|
47 | }
|
---|
48 |
|
---|
49 |
|
---|
50 | sw32 i4_time_class::milli_diff(const i4_time_class &past_time) const
|
---|
51 | {
|
---|
52 | w32 *me_t=(w32 *)private_data;
|
---|
53 | w32 *past_t=(w32 *)past_time.private_data;
|
---|
54 |
|
---|
55 | return ((sw32)me_t[1]-(sw32)past_t[1])/1000+(me_t[0]-past_t[0])*1000;
|
---|
56 | }
|
---|
57 |
|
---|