-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathats.cpp
More file actions
84 lines (64 loc) · 1.66 KB
/
ats.cpp
File metadata and controls
84 lines (64 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define ATS_EXPORTS
extern "C" {
#include "atsplugin.h"
}
// Necessary to passthrough the driver's inputs to the train
static int g_brake = 0;
static int g_power = 0;
static int g_reverser = 0;
// The plugin example on the BVE website has `DllMain` defined here.
// For this example, however, it is completely unnecessary.
ATS_API void WINAPI Load() {
// empty function body
}
ATS_API void WINAPI Dispose() {
// empty function body
// [BVE4] Not called when exiting BVE with a route open, untested on 5+
}
ATS_API int WINAPI GetPluginVersion() {
return ATS_VERSION;
}
ATS_API void WINAPI SetVehicleSpec(ATS_VEHICLESPEC specs) {
(void) specs;
}
ATS_API void WINAPI Initialize(int brake) {
(void) brake;
}
ATS_API ATS_HANDLES WINAPI Elapse(ATS_VEHICLESTATE state, int panel[], int sound[]) {
(void) state;
(void) panel;
(void) sound;
return ATS_HANDLES { g_brake, g_power, g_reverser, 0 };
}
ATS_API void WINAPI SetPower(int notch) {
g_power = notch;
}
ATS_API void WINAPI SetBrake(int notch) {
g_brake = notch;
}
ATS_API void WINAPI SetReverser(int pos) {
g_reverser = pos;
}
ATS_API void WINAPI KeyDown(int atsKeyCode) {
(void) atsKeyCode;
}
ATS_API void WINAPI KeyUp(int atsKeyCode) {
(void) atsKeyCode;
}
ATS_API void WINAPI HornBlow(int atsHornBlowIndex) {
(void) atsHornBlowIndex;
}
ATS_API void WINAPI DoorOpen() {
// empty function body
}
ATS_API void WINAPI DoorClose() {
// empty function body
}
ATS_API void WINAPI SetSignal(int signal) {
(void) signal;
}
ATS_API void WINAPI SetBeaconData(ATS_BEACONDATA beaconData) {
(void) beaconData;
}