diff options
| author | Joshua Reisenauer <[email protected]> | 2016-06-01 20:17:39 -0700 |
|---|---|---|
| committer | Joshua Reisenauer <[email protected]> | 2016-06-01 20:17:39 -0700 |
| commit | ae6adb173b0a89abd5185436029691ae33c1a727 (patch) | |
| tree | 1e5932f1df42368983844ca16f2c2ddba9cd4b3d /src/models.c | |
| parent | 90e1ed2b5e54a9b6c69be3dd2b71d1e4f3632c33 (diff) | |
| parent | 17878550b1e2dde44fcd1e668c92ca2d96680a28 (diff) | |
| download | raylib-ae6adb173b0a89abd5185436029691ae33c1a727.tar.gz raylib-ae6adb173b0a89abd5185436029691ae33c1a727.zip | |
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'src/models.c')
| -rw-r--r-- | src/models.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/models.c b/src/models.c index 8c5ed914..15565c98 100644 --- a/src/models.c +++ b/src/models.c @@ -26,16 +26,16 @@ #include "raylib.h" #if defined(PLATFORM_ANDROID) - #include "utils.h" // Android fopen function map + #include "utils.h" // Android fopen function map #endif -#include <stdio.h> // Standard input/output functions, used to read model files data -#include <stdlib.h> // Declares malloc() and free() for memory management -#include <string.h> // Required for strcmp() -#include <math.h> // Used for sin, cos, tan +#include <stdio.h> // Required for: FILE, fopen(), fclose(), fscanf(), feof(), rewind(), fgets() +#include <stdlib.h> // Required for: malloc(), free() +#include <string.h> // Required for: strcmp() +#include <math.h> // Required for: sin(), cos() -#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2 -#include "raymath.h" // Required for data type Matrix and Matrix functions +#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2 +#include "raymath.h" // Matrix data type and Matrix functions //---------------------------------------------------------------------------------- // Defines and Macros @@ -605,7 +605,7 @@ Model LoadModel(const char *fileName) // TODO: Initialize default data for model in case loading fails, maybe a cube? - if (strcmp(GetExtension(fileName),"obj") == 0) model.mesh = LoadOBJ(fileName); + if (strcmp(GetExtension(fileName), "obj") == 0) model.mesh = LoadOBJ(fileName); else TraceLog(WARNING, "[%s] Model extension not recognized, it can't be loaded", fileName); if (model.mesh.vertexCount == 0) TraceLog(WARNING, "Model could not be loaded"); @@ -764,7 +764,7 @@ Material LoadMaterial(const char *fileName) { Material material = { 0 }; - if (strcmp(GetExtension(fileName),"mtl") == 0) material = LoadMTL(fileName); + if (strcmp(GetExtension(fileName), "mtl") == 0) material = LoadMTL(fileName); else TraceLog(WARNING, "[%s] Material extension not recognized, it can't be loaded", fileName); return material; @@ -779,8 +779,7 @@ Material LoadDefaultMaterial(void) material.texDiffuse = GetDefaultTexture(); // White texture (1x1 pixel) //material.texNormal; // NOTE: By default, not set //material.texSpecular; // NOTE: By default, not set - - material.colTint = WHITE; // Tint color + material.colDiffuse = WHITE; // Diffuse color material.colAmbient = WHITE; // Ambient color material.colSpecular = WHITE; // Specular color @@ -1298,7 +1297,7 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota //Matrix matModel = MatrixMultiply(model.transform, matTransform); // Transform to world-space coordinates model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); - model.material.colTint = tint; + model.material.colDiffuse = tint; // TODO: Multiply tint color by diffuse color? rlglDrawMesh(model.mesh, model.material, model.transform); } |
