📄 m3gindexbuffer.c
字号:
/*****************************************************************************
*
* Filename:
* ---------
* IndexBuffer.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_IndexBuffer_getIndexCountImpl()
{
st_m3g_trianglestriparray* handle = (st_m3g_trianglestriparray*)KNI_GetParameterAsInt(1);
//KNI_ReturnInt((jint)3*handle->triangle_count);
KNI_ReturnInt((jint)M3G_TriangleStripArray_getIndexCount(handle));
}
KNIEXPORT KNI_RETURNTYPE_VOID
Java_javax_microedition_m3g_IndexBuffer_getIndicesImpl()
{
st_m3g_trianglestriparray* handle = (st_m3g_trianglestriparray*)KNI_GetParameterAsInt(1);
KNI_StartHandles(1);
KNI_DeclareHandle(indices_handle);
KNI_GetParameterAsObject(2, indices_handle);
#if FAST_KNI && defined(CLDCHI)
if(*indices_handle==NULL || handle==NULL) {
KNI_ThrowNew("java/lang/NullPointerException", "NULL indices");
} else {
jint_array* indices = (jint_array*)*indices_handle;
if(indices->length < 3*handle->triangle_count) {
KNI_ThrowNew("java/lang/IllegalArgumentException", "invalid indices");
} else {
M3G_TriangleStripArray_getIndices(handle, indices->elements); }
}
#else
ASSERT(0);
#endif /* FAST_KNI */
KNI_EndHandles();
KNI_ReturnVoid();
}
#endif /* #ifdef SUPPORT_JSR_184 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -