⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m3ganimationcontroller.c

📁 java 1.1 gemini 08_16
💻 C
字号:
/*******************************************************************************
 *  Modification Notice:
 *  --------------------------
 *  This software is modified by MediaTek Inc. and the information contained
 *  herein is confidential. The software may not be copied and the information
 *  contained herein may not be used or disclosed except with the written
 *  permission of MediaTek Inc. (C) 2001
 *
 *******************************************************************************/

/*****************************************************************************
 *
 * Filename:
 * ---------
 *  AnimationController.c
 *
 * Project:
 * --------
 *   Maui_Software
 *
 * Description:
 * ------------
 *   
 *
 * Author:
 * -------
 * -------
 *
 *============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *------------------------------------------------------------------------------
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *============================================================================
 ****************************************************************************/

/*************************************************************************
 * Include Header Files
 *************************************************************************/
#include "m3g.h"

#ifdef SUPPORT_JSR_184
/*************************************************************************
 * Function Definition
 *************************************************************************/ 
KNIEXPORT KNI_RETURNTYPE_INT
Java_javax_microedition_m3g_AnimationController_create()
{
	st_m3g_animationcontroller* handle; 
	
	ENTER_M3D_CS;	
	handle = M3G_AnimationController_new();
	LEAVE_M3D_CS;
	
	if (handle == NULL) KNI_ThrowNew("java/lang/NullPointerException", "null handle");
	
	KNI_ReturnInt((jint)handle);
}

KNIEXPORT KNI_RETURNTYPE_INT
Java_javax_microedition_m3g_AnimationController_getActiveIntervalEndImpl()
{
	st_m3g_animationcontroller* handle = (st_m3g_animationcontroller*)KNI_GetParameterAsInt(1);
	//KNI_ReturnInt(handle->activeinterval_end);
	KNI_ReturnInt(M3G_AnimationController_getActiveIntervalEnd(handle));
	
}

KNIEXPORT KNI_RETURNTYPE_FLOAT
Java_javax_microedition_m3g_AnimationController_getPositionImpl()
{
	st_m3g_animationcontroller* handle = (st_m3g_animationcontroller*)KNI_GetParameterAsInt(1);
	jint world_time = KNI_GetParameterAsInt(2);
	
	KNI_ReturnFloat(M3G_AnimationController_getPosition(handle, world_time));	
}

KNIEXPORT KNI_RETURNTYPE_FLOAT
Java_javax_microedition_m3g_AnimationController_getSpeedImpl()
{
	st_m3g_animationcontroller* handle = (st_m3g_animationcontroller*)KNI_GetParameterAsInt(1);
	//KNI_ReturnFloat(handle->speed);	
	KNI_ReturnFloat(M3G_AnimationController_getSpeed(handle));
}
KNIEXPORT KNI_RETURNTYPE_INT
Java_javax_microedition_m3g_AnimationController_getActiveIntervalStartImpl()
{
	st_m3g_animationcontroller* handle = (st_m3g_animationcontroller*)KNI_GetParameterAsInt(1);
	//KNI_ReturnInt(handle->activeinterval_start);
    KNI_ReturnInt(M3G_AnimationController_getActiveIntervalStart(handle));
}
	
KNIEXPORT KNI_RETURNTYPE_FLOAT	
Java_javax_microedition_m3g_AnimationController_getWeightImpl()
{
	st_m3g_animationcontroller* handle = (st_m3g_animationcontroller*)KNI_GetParameterAsInt(1);
	//KNI_ReturnFloat(handle->weight);
	KNI_ReturnFloat(M3G_AnimationController_getWeight(handle));
}
	
KNIEXPORT KNI_RETURNTYPE_VOID	
Java_javax_microedition_m3g_AnimationController_setActiveIntervalImpl()
{
	st_m3g_animationcontroller* handle = (st_m3g_animationcontroller*)KNI_GetParameterAsInt(1);
	jint start = KNI_GetParameterAsInt(2);
	jint end = KNI_GetParameterAsInt(3);
	
	kal_trace(TRACE_GROUP_6, FUNC_J2ME_M3G_SETACTIVEINTERVAL, handle, start, end);

	if (start > end) {
		KNI_ThrowNew("java/lang/IllegalArgumentException", "invalid interval");			
	} else {
		if (M3G_AnimationController_setActiveInterval(handle, start, end) != M3G_SUCCESS) {
			KNI_ThrowNew("java/lang/IllegalArgumentException", "invalid interval");
		}
	}
	
	KNI_ReturnVoid();	
}

KNIEXPORT KNI_RETURNTYPE_VOID	
Java_javax_microedition_m3g_AnimationController_setPositionImpl()
{
	st_m3g_animationcontroller* handle = (st_m3g_animationcontroller*)KNI_GetParameterAsInt(1);
	jfloat sequence_time = KNI_GetParameterAsFloat(2);
	jint world_time = KNI_GetParameterAsInt(3);
	
	kal_trace(TRACE_GROUP_6, FUNC_J2ME_M3G_SETPOSITION, handle, sequence_time, world_time);

	if (M3G_AnimationController_setPosition(handle, sequence_time, world_time) != M3G_SUCCESS) {
		KNI_ThrowNew("java/lang/IllegalArgumentException", "invalid position");		
	}
	
	KNI_ReturnVoid();
}
	
KNIEXPORT KNI_RETURNTYPE_VOID	
Java_javax_microedition_m3g_AnimationController_setSpeedImpl()
{
	st_m3g_animationcontroller* handle = (st_m3g_animationcontroller*)KNI_GetParameterAsInt(1);
	jfloat speed = KNI_GetParameterAsFloat(2);
	jint world_time = KNI_GetParameterAsInt(3);
	
	kal_trace(TRACE_GROUP_6, FUNC_J2ME_M3G_SETSPEED, handle, speed, world_time);

	if (M3G_AnimationController_setSpeed(handle, speed, world_time) != M3G_SUCCESS) {
		KNI_ThrowNew("java/lang/IllegalArgumentException", "invalid speed");
	}

	KNI_ReturnVoid();
}	
  
KNIEXPORT KNI_RETURNTYPE_VOID	
Java_javax_microedition_m3g_AnimationController_setWeightImpl()
{
	st_m3g_animationcontroller* handle = (st_m3g_animationcontroller*)KNI_GetParameterAsInt(1);
	jfloat weight = KNI_GetParameterAsFloat(2);
	
	kal_trace(TRACE_GROUP_6, FUNC_J2ME_M3G_SETWEIGHT, handle, (int)weight);

	if (weight < 0) {
		KNI_ThrowNew("java/lang/IllegalArgumentException", "invalid weight");
	} else {
		if (M3G_AnimationController_setWeight(handle, weight) != M3G_SUCCESS) {		
			KNI_ThrowNew("java/lang/IllegalArgumentException", "invalid weight");
		}
	}
	
	KNI_ReturnVoid();	
}
KNIEXPORT KNI_RETURNTYPE_INT
Java_javax_microedition_m3g_AnimationController_getRefWorldTimeImpl()
{
	st_m3g_animationcontroller* handle = (st_m3g_animationcontroller*)KNI_GetParameterAsInt(1);
	//KNI_ReturnInt(handle->reference_worldtime);
	KNI_ReturnInt(M3G_AnimationController_getRefWorldTime(handle));
}
#endif /* #ifdef SUPPORT_JSR_184 */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -