ScummVM API documentation
clock.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef LASTEXPRESS_CLOCK_H
23 #define LASTEXPRESS_CLOCK_H
24 
25 #include "common/scummsys.h"
26 
27 namespace LastExpress {
28 
29 class LastExpressEngine;
30 
31 struct Seq;
32 struct Sprite;
33 
34 class Clock {
35 public:
36  Clock(LastExpressEngine *engine);
37  ~Clock();
38 
39  void startClock(int32 time);
40  void endClock();
41  void eraseAllSprites();
42  void setClock(int32 time);
43  void stopClock(int32 time);
44  void turnOnClock(bool draw);
45  void drawHands(int32 time);
46  void drawTrainPosition(int32 time);
47  void tickClock();
48  bool statusClock();
49  int32 getTimeShowing();
50  int32 getTimeTo();
51 
52  // Debugger
53  void showCurrentTime();
54 
55 private:
56  LastExpressEngine *_engine;
57 
58  int32 _timeTo = 0;
59  int32 _timeShowing = 0;
60  int32 _clockTickDelta = 0;
61 
62  Seq *_seqMinutes = nullptr;
63  Seq *_seqHour = nullptr;
64  Seq *_seqSun = nullptr;
65  Seq *_seqDate = nullptr;
66  Seq *_seqLine1 = nullptr;
67  Seq *_seqLine2 = nullptr;
68 
69  Sprite *_clockHour = nullptr;
70  Sprite *_clockMinutes = nullptr;
71  Sprite *_clockSun = nullptr;
72  Sprite *_clockDate = nullptr;
73  Sprite *_trainLine1 = nullptr;
74  Sprite *_trainLine2 = nullptr;
75 
76  int32 _trainLineTimes[31] = {
77  1037700, 1148400, 1170900, 1228500, 1303200, 1335600,
78  1359900, 1367100, 1490400, 1539000, 1563300, 1656000,
79  1713600, 1739700, 1809900, 1852200, 1984500, 2049300,
80  2075400, 2101500, 2154600, 2268000, 2383200, 2418300,
81  2551500, 2952000, 3205800, 3492000, 3690000, 4320900,
82  4941000
83  };
84 
85  int32 _trainCitiesIndex[31] = {
86  0, 9, 11, 16, 21, 25,
87  35, 37, 40, 53, 56, 60,
88  63, 66, 68, 73, 84, 89,
89  97, 100, 104, 111, 120, 124,
90  132, 148, 157, 165, 174, 198,
91  210
92  };
93 };
94 
95 } // End of namespace LastExpress
96 
97 #endif // LASTEXPRESS_CLOCK_H
Definition: lastexpress.h:523
Definition: archive.h:29
Definition: clock.h:34
Definition: lastexpress.h:212
Definition: lastexpress.h:159