diff options
| author | jussi | 2022-02-22 19:09:57 +0200 |
|---|---|---|
| committer | jussi | 2022-02-22 19:09:57 +0200 |
| commit | 30ae308c9b26b18096f3f993f4b6ad50ea6bfd76 (patch) | |
| tree | 4d44d290e078ff09ff848134d3e0f31ca9c5134d /src/models.c | |
| parent | a7f58b3261565b59e508c659ae3a7f1964a5bad5 (diff) | |
| download | reilua-enhanced-30ae308c9b26b18096f3f993f4b6ad50ea6bfd76.tar.gz reilua-enhanced-30ae308c9b26b18096f3f993f4b6ad50ea6bfd76.tar.bz2 reilua-enhanced-30ae308c9b26b18096f3f993f4b6ad50ea6bfd76.zip | |
Documentation, heightmap example and custom begin and end draw.
Diffstat (limited to 'src/models.c')
| -rw-r--r-- | src/models.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/models.c b/src/models.c index 17683b8..f105991 100644 --- a/src/models.c +++ b/src/models.c @@ -939,7 +939,14 @@ int lmodelsGenMeshHeightmap( lua_State *L ) { } Vector3 size = uluaGetVector3( L ); lua_pop( L, 1 ); - Image *heightmap = state->images[ lua_tointeger( L, -1 ) ]; + size_t imageId = lua_tointeger( L, -1 ); + + if ( !validImage( imageId ) ) { + lua_pushboolean( L, false ); + return 1; + } + + Image *heightmap = state->images[ imageId ]; int i = 0; for ( i = 0; i < state->meshCount; i++ ) { @@ -1112,7 +1119,7 @@ int lmodelsDrawMesh( lua_State *L ) { return 1; } -/* TODO Needs shader to work. Test it when we have shaders. */ +/* TODO Not testet. */ /* > success = RL_DrawMeshInstanced( Mesh mesh, Material material, Matrix{} transforms, int instances ) |
