1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 #include "javax_microedition_m3g_AnimationController.h" |
|
18 |
|
19 JNIEXPORT jfloat JNICALL Java_javax_microedition_m3g_AnimationController__1getPosition |
|
20 (JNIEnv* aEnv, jclass, jint aHController, jint aWorldTime) |
|
21 { |
|
22 M3G_DO_LOCK |
|
23 jfloat position = (jfloat)m3gGetPosition((M3GAnimationController)aHController, aWorldTime); |
|
24 M3G_DO_UNLOCK(aEnv) |
|
25 return position; |
|
26 } |
|
27 |
|
28 JNIEXPORT void JNICALL Java_javax_microedition_m3g_AnimationController__1setWeight |
|
29 (JNIEnv* aEnv, jclass, jint aHController, jfloat aWeight) |
|
30 { |
|
31 M3G_DO_LOCK |
|
32 m3gSetWeight((M3GAnimationController)aHController, aWeight); |
|
33 M3G_DO_UNLOCK(aEnv) |
|
34 } |
|
35 |
|
36 JNIEXPORT void JNICALL Java_javax_microedition_m3g_AnimationController__1setActiveInterval |
|
37 (JNIEnv* aEnv, jclass, jint aHController, jint aWorldTimeMin, jint aWorldTimeMax) |
|
38 { |
|
39 M3G_DO_LOCK |
|
40 m3gSetActiveInterval((M3GAnimationController)aHController, aWorldTimeMin, aWorldTimeMax); |
|
41 M3G_DO_UNLOCK(aEnv) |
|
42 } |
|
43 |
|
44 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_AnimationController__1getActiveIntervalStart |
|
45 (JNIEnv* aEnv, jclass, jint aHController) |
|
46 { |
|
47 M3G_DO_LOCK |
|
48 jint start = (jint)m3gGetActiveIntervalStart((M3GAnimationController)aHController); |
|
49 M3G_DO_UNLOCK(aEnv) |
|
50 return start; |
|
51 } |
|
52 |
|
53 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_AnimationController__1ctor |
|
54 (JNIEnv* aEnv, jclass, jint aM3g) |
|
55 { |
|
56 M3G_DO_LOCK |
|
57 jint handle = (jint)m3gCreateAnimationController((M3GInterface)aM3g); |
|
58 M3G_DO_UNLOCK(aEnv) |
|
59 return handle; |
|
60 } |
|
61 |
|
62 JNIEXPORT void JNICALL Java_javax_microedition_m3g_AnimationController__1setPosition |
|
63 (JNIEnv* aEnv, jclass, jint aHController, jfloat aTime, jint aWorldTime) |
|
64 { |
|
65 M3G_DO_LOCK |
|
66 m3gSetPosition((M3GAnimationController)aHController, aTime, aWorldTime); |
|
67 M3G_DO_UNLOCK(aEnv) |
|
68 } |
|
69 |
|
70 JNIEXPORT void JNICALL Java_javax_microedition_m3g_AnimationController__1setSpeed |
|
71 (JNIEnv* aEnv, jclass, jint aHController, jfloat aFactor, jint aWorldTime) |
|
72 { |
|
73 M3G_DO_LOCK |
|
74 m3gSetSpeed((M3GAnimationController)aHController, aFactor, aWorldTime); |
|
75 M3G_DO_UNLOCK(aEnv) |
|
76 } |
|
77 |
|
78 JNIEXPORT jfloat JNICALL Java_javax_microedition_m3g_AnimationController__1getSpeed |
|
79 (JNIEnv* aEnv, jclass, jint aHController) |
|
80 { |
|
81 M3G_DO_LOCK |
|
82 jfloat speed = (jfloat)m3gGetSpeed((M3GAnimationController)aHController); |
|
83 M3G_DO_UNLOCK(aEnv) |
|
84 return speed; |
|
85 } |
|
86 |
|
87 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_AnimationController__1getActiveIntervalEnd |
|
88 (JNIEnv* aEnv, jclass, jint aHController) |
|
89 { |
|
90 M3G_DO_LOCK |
|
91 jint end = (jint)m3gGetActiveIntervalEnd((M3GAnimationController)aHController); |
|
92 M3G_DO_UNLOCK(aEnv) |
|
93 return end; |
|
94 } |
|
95 |
|
96 JNIEXPORT jfloat JNICALL Java_javax_microedition_m3g_AnimationController__1getWeight |
|
97 (JNIEnv* aEnv, jclass, jint aHController) |
|
98 { |
|
99 M3G_DO_LOCK |
|
100 jfloat weight = (jfloat)m3gGetWeight((M3GAnimationController)aHController); |
|
101 M3G_DO_UNLOCK(aEnv) |
|
102 return weight; |
|
103 } |
|
104 |
|
105 /* M3G 1.1 JNI Calls*/ |
|
106 |
|
107 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_AnimationController__1getRefWorldTime |
|
108 (JNIEnv* aEnv, jclass, jint aHController) |
|
109 { |
|
110 M3G_DO_LOCK |
|
111 jint time = (jint)m3gGetRefWorldTime((M3GAnimationController)aHController); |
|
112 M3G_DO_UNLOCK(aEnv) |
|
113 return time; |
|
114 } |
|