summaryrefslogtreecommitdiff
path: root/src/models.c
diff options
context:
space:
mode:
authorjussi2023-05-01 18:23:36 +0300
committerjussi2023-05-01 18:23:36 +0300
commitacc56fc7c2bedde6eced005eab0a37b6281b9a23 (patch)
tree6298f7eeee27469f20d6d992c93118aa162b49a8 /src/models.c
parent8b6337446dd79faf226ea9df40d4d06d81c38436 (diff)
downloadreilua-enhanced-acc56fc7c2bedde6eced005eab0a37b6281b9a23.tar.gz
reilua-enhanced-acc56fc7c2bedde6eced005eab0a37b6281b9a23.tar.bz2
reilua-enhanced-acc56fc7c2bedde6eced005eab0a37b6281b9a23.zip
Texture now can be either Texture or RenderTexture. No need to change texture source anymore.
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/models.c b/src/models.c
index 6b0ff0a..3f69001 100644
--- a/src/models.c
+++ b/src/models.c
@@ -665,7 +665,7 @@ int lmodelDrawQuad3DTexture( lua_State *L ) {
//TODO Normals. maybe something like Vector3Normalize(Vector3CrossProduct(Vector3Subtract(vB, vA), Vector3Subtract(vC, vA)));
- if ( !validSourceTexture( texId ) ) {
+ if ( !validTexture( texId, TEXTURE_TYPE_ALL ) ) {
lua_pushboolean( L, false );
return 1;
}
@@ -1138,7 +1138,6 @@ int lmodelsGenMeshCustom( lua_State *L ) {
}
lua_pop( L, 1 );
}
-
bool dynamic = lua_toboolean( L, 2 );
UploadMesh( &mesh, dynamic );
@@ -1575,7 +1574,7 @@ int lmodelsCreateMaterial( lua_State *L ) {
if ( strcmp( "texture", (char*)lua_tostring( L, -2 ) ) == 0 && lua_isnumber( L, -1 ) ) {
size_t texId = lua_tointeger( L, -1 );
- if ( !validSourceTexture( texId ) ) {
+ if ( !validTexture( texId, TEXTURE_TYPE_ALL ) ) {
lua_pushboolean( L, false );
return 1;
}
@@ -1669,7 +1668,7 @@ int lmodelsSetMaterialTexture( lua_State *L ) {
int mapType = lua_tointeger( L, 2 );
size_t texId = lua_tointeger( L, 3 );
- if ( !validMaterial( materialId ) || !validSourceTexture( texId ) ) {
+ if ( !validMaterial( materialId ) || !validTexture( texId, TEXTURE_TYPE_ALL ) ) {
lua_pushboolean( L, false );
return 1;
}
@@ -2014,7 +2013,7 @@ int lmodelsDrawBillboard( lua_State *L ) {
float size = lua_tonumber( L, 4 );
Color tint = uluaGetColorIndex( L, 5 );
- if ( !validSourceTexture( texId ) || !validCamera3D( cameraId ) ) {
+ if ( !validTexture( texId, TEXTURE_TYPE_ALL ) || !validCamera3D( cameraId ) ) {
lua_pushboolean( L, false );
return 1;
}
@@ -2046,7 +2045,7 @@ int lmodelsDrawBillboardRec( lua_State *L ) {
Vector2 size = uluaGetVector2Index( L, 5 );
Color tint = uluaGetColorIndex( L, 6 );
- if ( !validSourceTexture( texId ) || !validCamera3D( cameraId ) ) {
+ if ( !validTexture( texId, TEXTURE_TYPE_ALL ) || !validCamera3D( cameraId ) ) {
lua_pushboolean( L, false );
return 1;
}