javauis/m3g_qt/src/jni/sprite3d.inl
changeset 35 85266cc22c7f
equal deleted inserted replaced
26:dc7c549001d5 35:85266cc22c7f
       
     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 
       
    18 #include "javax_microedition_m3g_Sprite3D.h"
       
    19 
       
    20 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Sprite3D__1setImage
       
    21 (JNIEnv* aEnv, jclass, jint aHandle, jint aHImage)
       
    22 {
       
    23     M3G_DO_LOCK
       
    24     m3gSetSpriteImage((M3GSprite)aHandle, (M3GImage)aHImage);
       
    25     M3G_DO_UNLOCK(aEnv)
       
    26 }
       
    27 
       
    28 JNIEXPORT jboolean JNICALL Java_javax_microedition_m3g_Sprite3D__1isScaled
       
    29 (JNIEnv* aEnv, jclass, jint aHandle)
       
    30 {
       
    31     M3G_DO_LOCK
       
    32     jboolean scaled = (jboolean)m3gIsScaledSprite((M3GSprite)aHandle);
       
    33     M3G_DO_UNLOCK(aEnv)
       
    34     return scaled;
       
    35 }
       
    36 
       
    37 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Sprite3D__1getImage
       
    38 (JNIEnv* aEnv, jclass, jint aHandle)
       
    39 {
       
    40     M3G_DO_LOCK
       
    41     jint image = (M3Guint)m3gGetSpriteImage((M3GSprite)aHandle);
       
    42     M3G_DO_UNLOCK(aEnv)
       
    43     return image;
       
    44 }
       
    45 
       
    46 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Sprite3D__1ctor
       
    47 (JNIEnv* aEnv, jclass, jint aM3g, jboolean aScaled, jint aHImage, jint aHAppearance)
       
    48 {
       
    49     M3G_DO_LOCK
       
    50     jint handle = (M3Guint)m3gCreateSprite((M3GInterface)aM3g, aScaled, (M3GImage)aHImage, (M3GAppearance)aHAppearance);
       
    51     M3G_DO_UNLOCK(aEnv)
       
    52     return handle;
       
    53 }
       
    54 
       
    55 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Sprite3D__1getAppearance
       
    56 (JNIEnv* aEnv, jclass, jint aHandle)
       
    57 {
       
    58     M3G_DO_LOCK
       
    59     jint appearence = (M3Guint)m3gGetSpriteAppearance((M3GSprite)aHandle);
       
    60     M3G_DO_UNLOCK(aEnv)
       
    61     return appearence;
       
    62 }
       
    63 
       
    64 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Sprite3D__1getCrop
       
    65 (JNIEnv* aEnv, jclass, jint aHandle, jint aWhich)
       
    66 {
       
    67     M3G_DO_LOCK
       
    68     jint crop = (jint)m3gGetCrop((M3GSprite)aHandle, aWhich);
       
    69     M3G_DO_UNLOCK(aEnv)
       
    70     return crop;
       
    71 }
       
    72 
       
    73 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Sprite3D__1setCrop
       
    74 (JNIEnv* aEnv, jclass, jint aHandle, jint aCropX, jint aCropY, jint aWidth, jint aHeight)
       
    75 {
       
    76     M3G_DO_LOCK
       
    77     m3gSetCrop((M3GSprite)aHandle, aCropX, aCropY, aWidth, aHeight);
       
    78     M3G_DO_UNLOCK(aEnv)
       
    79 }
       
    80 
       
    81 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Sprite3D__1setAppearance
       
    82 (JNIEnv* aEnv, jclass, jint aHandle, jint aHAppearance)
       
    83 {
       
    84     M3G_DO_LOCK
       
    85     m3gSetSpriteAppearance((M3GSprite)aHandle, (M3GAppearance)aHAppearance);
       
    86     M3G_DO_UNLOCK(aEnv)
       
    87 }