1#include <com.badlogic.gdx.utils.BufferUtils.h> 2 3//@line:497 4 5 #include <stdio.h> 6 #include <stdlib.h> 7 #include <string.h> 8 JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_freeMemory(JNIEnv* env, jclass clazz, jobject obj_buffer) { 9 char* buffer = (char*)(obj_buffer?env->GetDirectBufferAddress(obj_buffer):0); 10 11 12//@line:559 13 14 free(buffer); 15 16 17} 18 19JNIEXPORT jobject JNICALL Java_com_badlogic_gdx_utils_BufferUtils_newDisposableByteBuffer(JNIEnv* env, jclass clazz, jint numBytes) { 20 21 22//@line:563 23 24 return env->NewDirectByteBuffer((char*)malloc(numBytes), numBytes); 25 26 27} 28 29static inline jlong wrapped_Java_com_badlogic_gdx_utils_BufferUtils_getBufferAddress 30(JNIEnv* env, jclass clazz, jobject obj_buffer, unsigned char* buffer) { 31 32//@line:567 33 34 return (jlong) buffer; 35 36} 37 38JNIEXPORT jlong JNICALL Java_com_badlogic_gdx_utils_BufferUtils_getBufferAddress(JNIEnv* env, jclass clazz, jobject obj_buffer) { 39 unsigned char* buffer = (unsigned char*)(obj_buffer?env->GetDirectBufferAddress(obj_buffer):0); 40 41 jlong JNI_returnValue = wrapped_Java_com_badlogic_gdx_utils_BufferUtils_getBufferAddress(env, clazz, obj_buffer, buffer); 42 43 44 return JNI_returnValue; 45} 46 47JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_clear(JNIEnv* env, jclass clazz, jobject obj_buffer, jint numBytes) { 48 char* buffer = (char*)(obj_buffer?env->GetDirectBufferAddress(obj_buffer):0); 49 50 51//@line:572 52 53 memset(buffer, 0, numBytes); 54 55 56} 57 58JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_copyJni___3FLjava_nio_Buffer_2II(JNIEnv* env, jclass clazz, jfloatArray obj_src, jobject obj_dst, jint numFloats, jint offset) { 59 unsigned char* dst = (unsigned char*)(obj_dst?env->GetDirectBufferAddress(obj_dst):0); 60 float* src = (float*)env->GetPrimitiveArrayCritical(obj_src, 0); 61 62 63//@line:576 64 65 memcpy(dst, src + offset, numFloats << 2 ); 66 67 env->ReleasePrimitiveArrayCritical(obj_src, src, 0); 68 69} 70 71JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_copyJni___3BILjava_nio_Buffer_2II(JNIEnv* env, jclass clazz, jbyteArray obj_src, jint srcOffset, jobject obj_dst, jint dstOffset, jint numBytes) { 72 unsigned char* dst = (unsigned char*)(obj_dst?env->GetDirectBufferAddress(obj_dst):0); 73 char* src = (char*)env->GetPrimitiveArrayCritical(obj_src, 0); 74 75 76//@line:580 77 78 memcpy(dst + dstOffset, src + srcOffset, numBytes); 79 80 env->ReleasePrimitiveArrayCritical(obj_src, src, 0); 81 82} 83 84JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_copyJni___3CILjava_nio_Buffer_2II(JNIEnv* env, jclass clazz, jcharArray obj_src, jint srcOffset, jobject obj_dst, jint dstOffset, jint numBytes) { 85 unsigned char* dst = (unsigned char*)(obj_dst?env->GetDirectBufferAddress(obj_dst):0); 86 unsigned short* src = (unsigned short*)env->GetPrimitiveArrayCritical(obj_src, 0); 87 88 89//@line:584 90 91 memcpy(dst + dstOffset, src + srcOffset, numBytes); 92 93 env->ReleasePrimitiveArrayCritical(obj_src, src, 0); 94 95} 96 97JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_copyJni___3SILjava_nio_Buffer_2II(JNIEnv* env, jclass clazz, jshortArray obj_src, jint srcOffset, jobject obj_dst, jint dstOffset, jint numBytes) { 98 unsigned char* dst = (unsigned char*)(obj_dst?env->GetDirectBufferAddress(obj_dst):0); 99 short* src = (short*)env->GetPrimitiveArrayCritical(obj_src, 0); 100 101 102//@line:588 103 104 memcpy(dst + dstOffset, src + srcOffset, numBytes); 105 106 env->ReleasePrimitiveArrayCritical(obj_src, src, 0); 107 108} 109 110JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_copyJni___3IILjava_nio_Buffer_2II(JNIEnv* env, jclass clazz, jintArray obj_src, jint srcOffset, jobject obj_dst, jint dstOffset, jint numBytes) { 111 unsigned char* dst = (unsigned char*)(obj_dst?env->GetDirectBufferAddress(obj_dst):0); 112 int* src = (int*)env->GetPrimitiveArrayCritical(obj_src, 0); 113 114 115//@line:592 116 117 memcpy(dst + dstOffset, src + srcOffset, numBytes); 118 119 env->ReleasePrimitiveArrayCritical(obj_src, src, 0); 120 121} 122 123JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_copyJni___3JILjava_nio_Buffer_2II(JNIEnv* env, jclass clazz, jlongArray obj_src, jint srcOffset, jobject obj_dst, jint dstOffset, jint numBytes) { 124 unsigned char* dst = (unsigned char*)(obj_dst?env->GetDirectBufferAddress(obj_dst):0); 125 long long* src = (long long*)env->GetPrimitiveArrayCritical(obj_src, 0); 126 127 128//@line:596 129 130 memcpy(dst + dstOffset, src + srcOffset, numBytes); 131 132 env->ReleasePrimitiveArrayCritical(obj_src, src, 0); 133 134} 135 136JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_copyJni___3FILjava_nio_Buffer_2II(JNIEnv* env, jclass clazz, jfloatArray obj_src, jint srcOffset, jobject obj_dst, jint dstOffset, jint numBytes) { 137 unsigned char* dst = (unsigned char*)(obj_dst?env->GetDirectBufferAddress(obj_dst):0); 138 float* src = (float*)env->GetPrimitiveArrayCritical(obj_src, 0); 139 140 141//@line:600 142 143 memcpy(dst + dstOffset, src + srcOffset, numBytes); 144 145 env->ReleasePrimitiveArrayCritical(obj_src, src, 0); 146 147} 148 149JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_copyJni___3DILjava_nio_Buffer_2II(JNIEnv* env, jclass clazz, jdoubleArray obj_src, jint srcOffset, jobject obj_dst, jint dstOffset, jint numBytes) { 150 unsigned char* dst = (unsigned char*)(obj_dst?env->GetDirectBufferAddress(obj_dst):0); 151 double* src = (double*)env->GetPrimitiveArrayCritical(obj_src, 0); 152 153 154//@line:604 155 156 memcpy(dst + dstOffset, src + srcOffset, numBytes); 157 158 env->ReleasePrimitiveArrayCritical(obj_src, src, 0); 159 160} 161 162JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_copyJni__Ljava_nio_Buffer_2ILjava_nio_Buffer_2II(JNIEnv* env, jclass clazz, jobject obj_src, jint srcOffset, jobject obj_dst, jint dstOffset, jint numBytes) { 163 unsigned char* src = (unsigned char*)(obj_src?env->GetDirectBufferAddress(obj_src):0); 164 unsigned char* dst = (unsigned char*)(obj_dst?env->GetDirectBufferAddress(obj_dst):0); 165 166 167//@line:608 168 169 memcpy(dst + dstOffset, src + srcOffset, numBytes); 170 171 172} 173 174 175//@line:612 176 177 template<size_t n1, size_t n2> void transform(float * const &src, float * const &m, float * const &dst) {} 178 179 template<> inline void transform<4, 4>(float * const &src, float * const &m, float * const &dst) { 180 const float x = src[0], y = src[1], z = src[2], w = src[3]; 181 dst[0] = x * m[ 0] + y * m[ 4] + z * m[ 8] + w * m[12]; 182 dst[1] = x * m[ 1] + y * m[ 5] + z * m[ 9] + w * m[13]; 183 dst[2] = x * m[ 2] + y * m[ 6] + z * m[10] + w * m[14]; 184 dst[3] = x * m[ 3] + y * m[ 7] + z * m[11] + w * m[15]; 185 } 186 187 template<> inline void transform<3, 4>(float * const &src, float * const &m, float * const &dst) { 188 const float x = src[0], y = src[1], z = src[2]; 189 dst[0] = x * m[ 0] + y * m[ 4] + z * m[ 8] + m[12]; 190 dst[1] = x * m[ 1] + y * m[ 5] + z * m[ 9] + m[13]; 191 dst[2] = x * m[ 2] + y * m[ 6] + z * m[10] + m[14]; 192 } 193 194 template<> inline void transform<2, 4>(float * const &src, float * const &m, float * const &dst) { 195 const float x = src[0], y = src[1]; 196 dst[0] = x * m[ 0] + y * m[ 4] + m[12]; 197 dst[1] = x * m[ 1] + y * m[ 5] + m[13]; 198 } 199 200 template<> inline void transform<3, 3>(float * const &src, float * const &m, float * const &dst) { 201 const float x = src[0], y = src[1], z = src[2]; 202 dst[0] = x * m[0] + y * m[3] + z * m[6]; 203 dst[1] = x * m[1] + y * m[4] + z * m[7]; 204 dst[2] = x * m[2] + y * m[5] + z * m[8]; 205 } 206 207 template<> inline void transform<2, 3>(float * const &src, float * const &m, float * const &dst) { 208 const float x = src[0], y = src[1]; 209 dst[0] = x * m[0] + y * m[3] + m[6]; 210 dst[1] = x * m[1] + y * m[4] + m[7]; 211 } 212 213 template<size_t n1, size_t n2> void transform(float * const &v, int const &stride, int const &count, float * const &m, int offset) { 214 for (int i = 0; i < count; i++) { 215 transform<n1, n2>(&v[offset], m, &v[offset]); 216 offset += stride; 217 } 218 } 219 220 template<size_t n1, size_t n2> void transform(float * const &v, int const &stride, unsigned short * const &indices, int const &count, float * const &m, int offset) { 221 for (int i = 0; i < count; i++) { 222 transform<n1, n2>(&v[offset], m, &v[offset]); 223 offset += stride; 224 } 225 } 226 227 inline bool compare(float * const &lhs, float * const & rhs, const unsigned int &size, const float &epsilon) { 228 for (unsigned int i = 0; i < size; i++) 229 if ((*(unsigned int*)&lhs[i] != *(unsigned int*)&rhs[i]) && ((lhs[i] > rhs[i] ? lhs[i] - rhs[i] : rhs[i] - lhs[i]) > epsilon)) 230 return false; 231 return true; 232 } 233 234 long find(float * const &vertex, const unsigned int &size, float * const &vertices, const unsigned int &count, const float &epsilon) { 235 for (unsigned int i = 0; i < count; i++) 236 if (compare(&vertices[i*size], vertex, size, epsilon)) 237 return (long)i; 238 return -1; 239 } 240 241 inline bool compare(float * const &lhs, float * const & rhs, const unsigned int &size) { 242 for (unsigned int i = 0; i < size; i++) 243 if ((*(unsigned int*)&lhs[i] != *(unsigned int*)&rhs[i]) && lhs[i] != rhs[i]) 244 return false; 245 return true; 246 } 247 248 long find(float * const &vertex, const unsigned int &size, float * const &vertices, const unsigned int &count) { 249 for (unsigned int i = 0; i < count; i++) 250 if (compare(&vertices[i*size], vertex, size)) 251 return (long)i; 252 return -1; 253 } 254 255 inline unsigned int calcHash(float * const &vertex, const unsigned int &size) { 256 unsigned int result = 0; 257 for (unsigned int i = 0; i < size; ++i) 258 result += ((*((unsigned int *)&vertex[i])) & 0xffffff80) >> (i & 0x7); 259 return result & 0x7fffffff; 260 } 261 262 long find(float * const &vertex, const unsigned int &size, float * const &vertices, unsigned int * const &hashes, const unsigned int &count) { 263 const unsigned int hash = calcHash(vertex, size); 264 for (unsigned int i = 0; i < count; i++) 265 if (hashes[i] == hash && compare(&vertices[i*size], vertex, size)) 266 return (long)i; 267 return -1; 268 } 269 JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_transformV4M4Jni__Ljava_nio_Buffer_2II_3FI(JNIEnv* env, jclass clazz, jobject obj_data, jint strideInBytes, jint count, jfloatArray obj_matrix, jint offsetInBytes) { 270 unsigned char* data = (unsigned char*)(obj_data?env->GetDirectBufferAddress(obj_data):0); 271 float* matrix = (float*)env->GetPrimitiveArrayCritical(obj_matrix, 0); 272 273 274//@line:707 275 276 transform<4, 4>((float*)data, strideInBytes / 4, count, (float*)matrix, offsetInBytes / 4); 277 278 env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, 0); 279 280} 281 282JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_transformV4M4Jni___3FII_3FI(JNIEnv* env, jclass clazz, jfloatArray obj_data, jint strideInBytes, jint count, jfloatArray obj_matrix, jint offsetInBytes) { 283 float* data = (float*)env->GetPrimitiveArrayCritical(obj_data, 0); 284 float* matrix = (float*)env->GetPrimitiveArrayCritical(obj_matrix, 0); 285 286 287//@line:711 288 289 transform<4, 4>((float*)data, strideInBytes / 4, count, (float*)matrix, offsetInBytes / 4); 290 291 env->ReleasePrimitiveArrayCritical(obj_data, data, 0); 292 env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, 0); 293 294} 295 296JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_transformV3M4Jni__Ljava_nio_Buffer_2II_3FI(JNIEnv* env, jclass clazz, jobject obj_data, jint strideInBytes, jint count, jfloatArray obj_matrix, jint offsetInBytes) { 297 unsigned char* data = (unsigned char*)(obj_data?env->GetDirectBufferAddress(obj_data):0); 298 float* matrix = (float*)env->GetPrimitiveArrayCritical(obj_matrix, 0); 299 300 301//@line:715 302 303 transform<3, 4>((float*)data, strideInBytes / 4, count, (float*)matrix, offsetInBytes / 4); 304 305 env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, 0); 306 307} 308 309JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_transformV3M4Jni___3FII_3FI(JNIEnv* env, jclass clazz, jfloatArray obj_data, jint strideInBytes, jint count, jfloatArray obj_matrix, jint offsetInBytes) { 310 float* data = (float*)env->GetPrimitiveArrayCritical(obj_data, 0); 311 float* matrix = (float*)env->GetPrimitiveArrayCritical(obj_matrix, 0); 312 313 314//@line:719 315 316 transform<3, 4>((float*)data, strideInBytes / 4, count, (float*)matrix, offsetInBytes / 4); 317 318 env->ReleasePrimitiveArrayCritical(obj_data, data, 0); 319 env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, 0); 320 321} 322 323JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_transformV2M4Jni__Ljava_nio_Buffer_2II_3FI(JNIEnv* env, jclass clazz, jobject obj_data, jint strideInBytes, jint count, jfloatArray obj_matrix, jint offsetInBytes) { 324 unsigned char* data = (unsigned char*)(obj_data?env->GetDirectBufferAddress(obj_data):0); 325 float* matrix = (float*)env->GetPrimitiveArrayCritical(obj_matrix, 0); 326 327 328//@line:723 329 330 transform<2, 4>((float*)data, strideInBytes / 4, count, (float*)matrix, offsetInBytes / 4); 331 332 env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, 0); 333 334} 335 336JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_transformV2M4Jni___3FII_3FI(JNIEnv* env, jclass clazz, jfloatArray obj_data, jint strideInBytes, jint count, jfloatArray obj_matrix, jint offsetInBytes) { 337 float* data = (float*)env->GetPrimitiveArrayCritical(obj_data, 0); 338 float* matrix = (float*)env->GetPrimitiveArrayCritical(obj_matrix, 0); 339 340 341//@line:727 342 343 transform<2, 4>((float*)data, strideInBytes / 4, count, (float*)matrix, offsetInBytes / 4); 344 345 env->ReleasePrimitiveArrayCritical(obj_data, data, 0); 346 env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, 0); 347 348} 349 350JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_transformV3M3Jni__Ljava_nio_Buffer_2II_3FI(JNIEnv* env, jclass clazz, jobject obj_data, jint strideInBytes, jint count, jfloatArray obj_matrix, jint offsetInBytes) { 351 unsigned char* data = (unsigned char*)(obj_data?env->GetDirectBufferAddress(obj_data):0); 352 float* matrix = (float*)env->GetPrimitiveArrayCritical(obj_matrix, 0); 353 354 355//@line:731 356 357 transform<3, 3>((float*)data, strideInBytes / 4, count, (float*)matrix, offsetInBytes / 4); 358 359 env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, 0); 360 361} 362 363JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_transformV3M3Jni___3FII_3FI(JNIEnv* env, jclass clazz, jfloatArray obj_data, jint strideInBytes, jint count, jfloatArray obj_matrix, jint offsetInBytes) { 364 float* data = (float*)env->GetPrimitiveArrayCritical(obj_data, 0); 365 float* matrix = (float*)env->GetPrimitiveArrayCritical(obj_matrix, 0); 366 367 368//@line:735 369 370 transform<3, 3>((float*)data, strideInBytes / 4, count, (float*)matrix, offsetInBytes / 4); 371 372 env->ReleasePrimitiveArrayCritical(obj_data, data, 0); 373 env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, 0); 374 375} 376 377JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_transformV2M3Jni__Ljava_nio_Buffer_2II_3FI(JNIEnv* env, jclass clazz, jobject obj_data, jint strideInBytes, jint count, jfloatArray obj_matrix, jint offsetInBytes) { 378 unsigned char* data = (unsigned char*)(obj_data?env->GetDirectBufferAddress(obj_data):0); 379 float* matrix = (float*)env->GetPrimitiveArrayCritical(obj_matrix, 0); 380 381 382//@line:739 383 384 transform<2, 3>((float*)data, strideInBytes / 4, count, (float*)matrix, offsetInBytes / 4); 385 386 env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, 0); 387 388} 389 390JNIEXPORT void JNICALL Java_com_badlogic_gdx_utils_BufferUtils_transformV2M3Jni___3FII_3FI(JNIEnv* env, jclass clazz, jfloatArray obj_data, jint strideInBytes, jint count, jfloatArray obj_matrix, jint offsetInBytes) { 391 float* data = (float*)env->GetPrimitiveArrayCritical(obj_data, 0); 392 float* matrix = (float*)env->GetPrimitiveArrayCritical(obj_matrix, 0); 393 394 395//@line:743 396 397 transform<2, 3>((float*)data, strideInBytes / 4, count, (float*)matrix, offsetInBytes / 4); 398 399 env->ReleasePrimitiveArrayCritical(obj_data, data, 0); 400 env->ReleasePrimitiveArrayCritical(obj_matrix, matrix, 0); 401 402} 403 404static inline jlong wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find__Ljava_nio_Buffer_2IILjava_nio_Buffer_2II 405(JNIEnv* env, jclass clazz, jobject obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jobject obj_vertices, jint verticesOffsetInBytes, jint numVertices, unsigned char* vertex, unsigned char* vertices) { 406 407//@line:747 408 409 return find((float *)&vertex[vertexOffsetInBytes / 4], (unsigned int)(strideInBytes / 4), (float*)&vertices[verticesOffsetInBytes / 4], (unsigned int)numVertices); 410 411} 412 413JNIEXPORT jlong JNICALL Java_com_badlogic_gdx_utils_BufferUtils_find__Ljava_nio_Buffer_2IILjava_nio_Buffer_2II(JNIEnv* env, jclass clazz, jobject obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jobject obj_vertices, jint verticesOffsetInBytes, jint numVertices) { 414 unsigned char* vertex = (unsigned char*)(obj_vertex?env->GetDirectBufferAddress(obj_vertex):0); 415 unsigned char* vertices = (unsigned char*)(obj_vertices?env->GetDirectBufferAddress(obj_vertices):0); 416 417 jlong JNI_returnValue = wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find__Ljava_nio_Buffer_2IILjava_nio_Buffer_2II(env, clazz, obj_vertex, vertexOffsetInBytes, strideInBytes, obj_vertices, verticesOffsetInBytes, numVertices, vertex, vertices); 418 419 420 return JNI_returnValue; 421} 422 423static inline jlong wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find___3FIILjava_nio_Buffer_2II 424(JNIEnv* env, jclass clazz, jfloatArray obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jobject obj_vertices, jint verticesOffsetInBytes, jint numVertices, unsigned char* vertices, float* vertex) { 425 426//@line:751 427 428 return find((float *)&vertex[vertexOffsetInBytes / 4], (unsigned int)(strideInBytes / 4), (float*)&vertices[verticesOffsetInBytes / 4], (unsigned int)numVertices); 429 430} 431 432JNIEXPORT jlong JNICALL Java_com_badlogic_gdx_utils_BufferUtils_find___3FIILjava_nio_Buffer_2II(JNIEnv* env, jclass clazz, jfloatArray obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jobject obj_vertices, jint verticesOffsetInBytes, jint numVertices) { 433 unsigned char* vertices = (unsigned char*)(obj_vertices?env->GetDirectBufferAddress(obj_vertices):0); 434 float* vertex = (float*)env->GetPrimitiveArrayCritical(obj_vertex, 0); 435 436 jlong JNI_returnValue = wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find___3FIILjava_nio_Buffer_2II(env, clazz, obj_vertex, vertexOffsetInBytes, strideInBytes, obj_vertices, verticesOffsetInBytes, numVertices, vertices, vertex); 437 438 env->ReleasePrimitiveArrayCritical(obj_vertex, vertex, 0); 439 440 return JNI_returnValue; 441} 442 443static inline jlong wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find__Ljava_nio_Buffer_2II_3FII 444(JNIEnv* env, jclass clazz, jobject obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jfloatArray obj_vertices, jint verticesOffsetInBytes, jint numVertices, unsigned char* vertex, float* vertices) { 445 446//@line:755 447 448 return find((float *)&vertex[vertexOffsetInBytes / 4], (unsigned int)(strideInBytes / 4), (float*)&vertices[verticesOffsetInBytes / 4], (unsigned int)numVertices); 449 450} 451 452JNIEXPORT jlong JNICALL Java_com_badlogic_gdx_utils_BufferUtils_find__Ljava_nio_Buffer_2II_3FII(JNIEnv* env, jclass clazz, jobject obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jfloatArray obj_vertices, jint verticesOffsetInBytes, jint numVertices) { 453 unsigned char* vertex = (unsigned char*)(obj_vertex?env->GetDirectBufferAddress(obj_vertex):0); 454 float* vertices = (float*)env->GetPrimitiveArrayCritical(obj_vertices, 0); 455 456 jlong JNI_returnValue = wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find__Ljava_nio_Buffer_2II_3FII(env, clazz, obj_vertex, vertexOffsetInBytes, strideInBytes, obj_vertices, verticesOffsetInBytes, numVertices, vertex, vertices); 457 458 env->ReleasePrimitiveArrayCritical(obj_vertices, vertices, 0); 459 460 return JNI_returnValue; 461} 462 463static inline jlong wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find___3FII_3FII 464(JNIEnv* env, jclass clazz, jfloatArray obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jfloatArray obj_vertices, jint verticesOffsetInBytes, jint numVertices, float* vertex, float* vertices) { 465 466//@line:759 467 468 return find((float *)&vertex[vertexOffsetInBytes / 4], (unsigned int)(strideInBytes / 4), (float*)&vertices[verticesOffsetInBytes / 4], (unsigned int)numVertices); 469 470} 471 472JNIEXPORT jlong JNICALL Java_com_badlogic_gdx_utils_BufferUtils_find___3FII_3FII(JNIEnv* env, jclass clazz, jfloatArray obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jfloatArray obj_vertices, jint verticesOffsetInBytes, jint numVertices) { 473 float* vertex = (float*)env->GetPrimitiveArrayCritical(obj_vertex, 0); 474 float* vertices = (float*)env->GetPrimitiveArrayCritical(obj_vertices, 0); 475 476 jlong JNI_returnValue = wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find___3FII_3FII(env, clazz, obj_vertex, vertexOffsetInBytes, strideInBytes, obj_vertices, verticesOffsetInBytes, numVertices, vertex, vertices); 477 478 env->ReleasePrimitiveArrayCritical(obj_vertex, vertex, 0); 479 env->ReleasePrimitiveArrayCritical(obj_vertices, vertices, 0); 480 481 return JNI_returnValue; 482} 483 484static inline jlong wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find__Ljava_nio_Buffer_2IILjava_nio_Buffer_2IIF 485(JNIEnv* env, jclass clazz, jobject obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jobject obj_vertices, jint verticesOffsetInBytes, jint numVertices, jfloat epsilon, unsigned char* vertex, unsigned char* vertices) { 486 487//@line:763 488 489 return find((float *)&vertex[vertexOffsetInBytes / 4], (unsigned int)(strideInBytes / 4), (float*)&vertices[verticesOffsetInBytes / 4], (unsigned int)numVertices, epsilon); 490 491} 492 493JNIEXPORT jlong JNICALL Java_com_badlogic_gdx_utils_BufferUtils_find__Ljava_nio_Buffer_2IILjava_nio_Buffer_2IIF(JNIEnv* env, jclass clazz, jobject obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jobject obj_vertices, jint verticesOffsetInBytes, jint numVertices, jfloat epsilon) { 494 unsigned char* vertex = (unsigned char*)(obj_vertex?env->GetDirectBufferAddress(obj_vertex):0); 495 unsigned char* vertices = (unsigned char*)(obj_vertices?env->GetDirectBufferAddress(obj_vertices):0); 496 497 jlong JNI_returnValue = wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find__Ljava_nio_Buffer_2IILjava_nio_Buffer_2IIF(env, clazz, obj_vertex, vertexOffsetInBytes, strideInBytes, obj_vertices, verticesOffsetInBytes, numVertices, epsilon, vertex, vertices); 498 499 500 return JNI_returnValue; 501} 502 503static inline jlong wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find___3FIILjava_nio_Buffer_2IIF 504(JNIEnv* env, jclass clazz, jfloatArray obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jobject obj_vertices, jint verticesOffsetInBytes, jint numVertices, jfloat epsilon, unsigned char* vertices, float* vertex) { 505 506//@line:767 507 508 return find((float *)&vertex[vertexOffsetInBytes / 4], (unsigned int)(strideInBytes / 4), (float*)&vertices[verticesOffsetInBytes / 4], (unsigned int)numVertices, epsilon); 509 510} 511 512JNIEXPORT jlong JNICALL Java_com_badlogic_gdx_utils_BufferUtils_find___3FIILjava_nio_Buffer_2IIF(JNIEnv* env, jclass clazz, jfloatArray obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jobject obj_vertices, jint verticesOffsetInBytes, jint numVertices, jfloat epsilon) { 513 unsigned char* vertices = (unsigned char*)(obj_vertices?env->GetDirectBufferAddress(obj_vertices):0); 514 float* vertex = (float*)env->GetPrimitiveArrayCritical(obj_vertex, 0); 515 516 jlong JNI_returnValue = wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find___3FIILjava_nio_Buffer_2IIF(env, clazz, obj_vertex, vertexOffsetInBytes, strideInBytes, obj_vertices, verticesOffsetInBytes, numVertices, epsilon, vertices, vertex); 517 518 env->ReleasePrimitiveArrayCritical(obj_vertex, vertex, 0); 519 520 return JNI_returnValue; 521} 522 523static inline jlong wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find__Ljava_nio_Buffer_2II_3FIIF 524(JNIEnv* env, jclass clazz, jobject obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jfloatArray obj_vertices, jint verticesOffsetInBytes, jint numVertices, jfloat epsilon, unsigned char* vertex, float* vertices) { 525 526//@line:771 527 528 return find((float *)&vertex[vertexOffsetInBytes / 4], (unsigned int)(strideInBytes / 4), (float*)&vertices[verticesOffsetInBytes / 4], (unsigned int)numVertices, epsilon); 529 530} 531 532JNIEXPORT jlong JNICALL Java_com_badlogic_gdx_utils_BufferUtils_find__Ljava_nio_Buffer_2II_3FIIF(JNIEnv* env, jclass clazz, jobject obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jfloatArray obj_vertices, jint verticesOffsetInBytes, jint numVertices, jfloat epsilon) { 533 unsigned char* vertex = (unsigned char*)(obj_vertex?env->GetDirectBufferAddress(obj_vertex):0); 534 float* vertices = (float*)env->GetPrimitiveArrayCritical(obj_vertices, 0); 535 536 jlong JNI_returnValue = wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find__Ljava_nio_Buffer_2II_3FIIF(env, clazz, obj_vertex, vertexOffsetInBytes, strideInBytes, obj_vertices, verticesOffsetInBytes, numVertices, epsilon, vertex, vertices); 537 538 env->ReleasePrimitiveArrayCritical(obj_vertices, vertices, 0); 539 540 return JNI_returnValue; 541} 542 543static inline jlong wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find___3FII_3FIIF 544(JNIEnv* env, jclass clazz, jfloatArray obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jfloatArray obj_vertices, jint verticesOffsetInBytes, jint numVertices, jfloat epsilon, float* vertex, float* vertices) { 545 546//@line:775 547 548 return find((float *)&vertex[vertexOffsetInBytes / 4], (unsigned int)(strideInBytes / 4), (float*)&vertices[verticesOffsetInBytes / 4], (unsigned int)numVertices, epsilon); 549 550} 551 552JNIEXPORT jlong JNICALL Java_com_badlogic_gdx_utils_BufferUtils_find___3FII_3FIIF(JNIEnv* env, jclass clazz, jfloatArray obj_vertex, jint vertexOffsetInBytes, jint strideInBytes, jfloatArray obj_vertices, jint verticesOffsetInBytes, jint numVertices, jfloat epsilon) { 553 float* vertex = (float*)env->GetPrimitiveArrayCritical(obj_vertex, 0); 554 float* vertices = (float*)env->GetPrimitiveArrayCritical(obj_vertices, 0); 555 556 jlong JNI_returnValue = wrapped_Java_com_badlogic_gdx_utils_BufferUtils_find___3FII_3FIIF(env, clazz, obj_vertex, vertexOffsetInBytes, strideInBytes, obj_vertices, verticesOffsetInBytes, numVertices, epsilon, vertex, vertices); 557 558 env->ReleasePrimitiveArrayCritical(obj_vertex, vertex, 0); 559 env->ReleasePrimitiveArrayCritical(obj_vertices, vertices, 0); 560 561 return JNI_returnValue; 562} 563 564