aboutsummaryrefslogtreecommitdiff
path: root/src/models.c
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-03-06 02:05:16 +0100
committerraysan5 <raysan5@gmail.com>2016-03-06 02:05:16 +0100
commitc9d22c7a14a84b24a94f876c9e438c621b4bf420 (patch)
treeabf4f2ec17f6773207dd7f2487c7a6cafbee2445 /src/models.c
parent893facdf6d81a430f5291407afac0e70627d0f0d (diff)
downloadraylib-c9d22c7a14a84b24a94f876c9e438c621b4bf420.tar.gz
raylib-c9d22c7a14a84b24a94f876c9e438c621b4bf420.zip
Redesign to use Material type -IN PROGRESS-
Requires Shader access functions review
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/models.c b/src/models.c
index ee5e57c7..a1590424 100644
--- a/src/models.c
+++ b/src/models.c
@@ -551,10 +551,7 @@ Model LoadModel(const char *fileName)
// NOTE: At this point we have all vertex, texcoord, normal data for the model in mesh struct
- if (mesh.vertexCount == 0)
- {
- TraceLog(WARNING, "Model could not be loaded");
- }
+ if (mesh.vertexCount == 0) TraceLog(WARNING, "Model could not be loaded");
else
{
// NOTE: model properties (transform, texture, shader) are initialized inside rlglLoadModel()
@@ -627,17 +624,8 @@ void UnloadModel(Model model)
// Link a texture to a model
void SetModelTexture(Model *model, Texture2D texture)
{
- if (texture.id <= 0)
- {
- // Use default white texture (use mesh color)
- model->texture.id = whiteTexture; // OpenGL 1.1
- model->shader.texDiffuseId = whiteTexture; // OpenGL 3.3 / ES 2.0
- }
- else
- {
- model->texture = texture;
- model->shader.texDiffuseId = texture.id;
- }
+ if (texture.id <= 0) model->material.texDiffuse.id = whiteTexture; // Use default white texture
+ else model->material.texDiffuse = texture;
}
static Mesh GenMeshHeightmap(Image heightmap, Vector3 size)