| 612 | |
| 613 | |
| 614 | int LuaOpenGL::Map1(lua_State* L) { |
| 615 | CheckDrawingEnabled(L, __FUNCTION__); |
| 616 | if (lua_gettop(L) != 6) { // NOTE: required for ParseFloatArray() |
| 617 | return 0; |
| 618 | } |
| 619 | const GLenum target = (GLenum)luaL_checkint(L, 1); |
| 620 | const GLfloat u1 = luaL_checkfloat(L, 2); |
| 621 | const GLfloat u2 = luaL_checkfloat(L, 3); |
| 622 | const GLint stride = luaL_checkint(L, 4); |
| 623 | const GLint order = luaL_checkint(L, 5); |
| 624 | |
| 625 | const int dataSize = GetMap1TargetDataSize(target); |
| 626 | if (dataSize <= 0) { |
| 627 | return 0; |
| 628 | } |
| 629 | if ((order <= 0) || (stride != dataSize)) { |
| 630 | return 0; |
| 631 | } |
| 632 | const int fullSize = (order * dataSize); |
| 633 | float* points = new float[fullSize]; |
| 634 | if (ParseFloatArray(L, points, fullSize) == fullSize) { |
| 635 | glMap1f(target, u1, u2, stride, order, points); |
| 636 | } |
| 637 | delete[] points; |
| 638 | return 0; |
| 639 | } |
| 640 | |
| 641 | |
| 642 | int LuaOpenGL::Map2(lua_State* L) { |
nothing calls this directly
no test coverage detected