OLD | NEW |
1 #include "jni/context.h" | 1 #include "jni/context.h" |
2 #include "jni/dart_host.h" | 2 #include "jni/dart_host.h" |
3 #include "jni/eventloop.h" | 3 #include "jni/eventloop.h" |
4 #include "jni/graphics.h" | 4 #include "jni/graphics.h" |
5 #include "jni/input_service.h" | 5 #include "jni/input_service.h" |
6 #include "jni/vm_glue.h" | 6 #include "jni/vm_glue.h" |
7 | 7 |
8 SoundService* psound_service; | 8 SoundService* psound_service; |
9 | 9 |
10 void android_main(android_app* application) { | 10 void android_main(android_app* application) { |
11 Timer timer; | 11 Timer timer; |
12 Graphics graphics(application, &timer); | 12 Graphics graphics(application, &timer); |
13 VMGlue vmGlue(&graphics); | 13 VMGlue vmGlue(&graphics); |
14 InputService inputService(application, &vmGlue, | 14 InputService inputService(application, &vmGlue, |
15 graphics.width(), graphics.height()); | 15 graphics.width(), graphics.height()); |
16 SoundService sound_service(application); | 16 SoundService sound_service(application); |
17 psound_service = &sound_service; | 17 psound_service = &sound_service; |
18 Context context; | 18 Context context; |
19 context = { &graphics, &inputService, psound_service, &timer, &vmGlue }; | 19 context = { &graphics, &inputService, psound_service, &timer, &vmGlue }; |
20 EventLoop eventLoop(application); | 20 EventLoop eventLoop(application); |
21 DartHost host(&context); | 21 DartHost host(&context); |
22 eventLoop.Run(&host, &context); | 22 eventLoop.Run(&host, &context); |
23 } | 23 } |
24 | 24 |
25 int32_t PlayBackground(const char* path) { | 25 void PlayBackground(const char* path) { |
26 psound_service->PlayBackground(path); | 26 psound_service->PlayBackground(path); |
27 } | 27 } |
28 | 28 |
29 void StopBackground() { | 29 void StopBackground() { |
30 psound_service->StopBackground(); | 30 psound_service->StopBackground(); |
31 } | 31 } |
32 | |
33 | |
OLD | NEW |