diff options
| author | jussi | 2022-09-22 20:25:18 +0300 |
|---|---|---|
| committer | jussi | 2022-09-22 20:25:18 +0300 |
| commit | 0fad8239b626678980f7f8093c0602acbe5c817b (patch) | |
| tree | 2c6f9f3fcf0f873c89d231d512fe1c006e9f7074 /src/models.c | |
| parent | e5f437d05e8277861ea85e6c8d2ede32c4be32ef (diff) | |
| download | reilua-enhanced-0fad8239b626678980f7f8093c0602acbe5c817b.tar.gz reilua-enhanced-0fad8239b626678980f7f8093c0602acbe5c817b.tar.bz2 reilua-enhanced-0fad8239b626678980f7f8093c0602acbe5c817b.zip | |
v0.3.
Diffstat (limited to 'src/models.c')
| -rw-r--r-- | src/models.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/models.c b/src/models.c index 3028459..bc84f6c 100644 --- a/src/models.c +++ b/src/models.c @@ -567,7 +567,7 @@ Note! Could be replaced something like "DrawPlaneTextureRec" - Success return true */ int lmodelDrawQuad3DTexture( lua_State *L ) { - if ( !lua_istable( L, -3 ) || !lua_istable( L, -2 ) || !lua_istable( L, -1 ) ) { + if ( !lua_isnumber( L, -4 ) || !lua_istable( L, -3 ) || !lua_istable( L, -2 ) || !lua_istable( L, -1 ) ) { TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_DrawQuad3DTexture( texture, Vector3{} vertices, Vector2{} texCoords, Color color )" ); lua_pushboolean( L, false ); return 1; @@ -605,6 +605,10 @@ int lmodelDrawQuad3DTexture( lua_State *L ) { lua_pop( L, 1 ); } lua_pop( L, 1 ); + + //TODO Normals. maybe something like Vector3Normalize(Vector3CrossProduct(Vector3Subtract(vB, vA), Vector3Subtract(vC, vA))); + + /* Texture. */ size_t texId = lua_tointeger( L, -1 ); if ( !validSourceTexture( texId ) ) { @@ -612,12 +616,10 @@ int lmodelDrawQuad3DTexture( lua_State *L ) { return 1; } - // Draw. + /* Draw. */ rlCheckRenderBatchLimit( 4 ); rlSetTexture( texturesGetSourceTexture( texId )->id ); - //TODO Normals. maybe something like Vector3Normalize(Vector3CrossProduct(Vector3Subtract(vB, vA), Vector3Subtract(vC, vA))); - rlBegin( RL_QUADS ); rlColor4ub( color.r, color.g, color.b, color.a ); @@ -1091,7 +1093,8 @@ int lmodelsGenMeshCustom( lua_State *L ) { /* > success = RL_UpdateMesh( Mesh{} ) -Update mesh vertex data in GPU. ( Mainly intented to be used with custom meshes ) +Update mesh vertex data in GPU. +Note! Mainly intented to be used with custom meshes. - Failure return false - Success return true |
