aboutsummaryrefslogtreecommitdiff
path: root/src/models.c
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2015-01-08 20:32:30 +0100
committerRay <raysan5@gmail.com>2015-01-08 20:32:30 +0100
commite37ef10595867e4f189fff0f87db5e6fdfcfc4d0 (patch)
tree0410f5604cc3cfc036f6c1f3ac4333ac33726660 /src/models.c
parentfad81f36e4cfd37901caad8555c49c41ac65aaee (diff)
parent4a7e522d4bb376d2277895d1d99eb0382f8bbefb (diff)
downloadraylib-e37ef10595867e4f189fff0f87db5e6fdfcfc4d0.tar.gz
raylib-e37ef10595867e4f189fff0f87db5e6fdfcfc4d0.zip
Merge pull request #14 from raysan5/master
Integrate master into develop branch
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/models.c b/src/models.c
index e8e4f635..f61f79f5 100644
--- a/src/models.c
+++ b/src/models.c
@@ -711,7 +711,7 @@ Model LoadHeightmap(Image heightmap, float maxHeight)
vData.vertices = (float *)malloc(vData.vertexCount * 3 * sizeof(float));
vData.normals = (float *)malloc(vData.vertexCount * 3 * sizeof(float));
vData.texcoords = (float *)malloc(vData.vertexCount * 2 * sizeof(float));
- vData.colors = (unsigned char *)malloc(vData.vertexCount * 4 * sizeof(unsigned char));
+ vData.colors = (unsigned char *)malloc(vData.vertexCount * 4 * sizeof(unsigned char)); // Not used...
int vCounter = 0; // Used to count vertices float by float
int tcCounter = 0; // Used to count texcoords float by float
@@ -795,9 +795,9 @@ Model LoadHeightmap(Image heightmap, float maxHeight)
}
// Fill color data
+ // NOTE: Not used any more... just one plain color defined at DrawModel()
for (int i = 0; i < (4*vData.vertexCount); i++) vData.colors[i] = 255;
-
// NOTE: At this point we have all vertex, texcoord, normal data for the model in vData struct
Model model = rlglLoadModel(vData);
@@ -1071,9 +1071,10 @@ Model LoadCubicmap(Image cubesmap)
vData.vertices = (float *)malloc(vData.vertexCount * 3 * sizeof(float));
vData.normals = (float *)malloc(vData.vertexCount * 3 * sizeof(float));
vData.texcoords = (float *)malloc(vData.vertexCount * 2 * sizeof(float));
- vData.colors = (unsigned char *)malloc(vData.vertexCount * 4 * sizeof(unsigned char));
+ vData.colors = (unsigned char *)malloc(vData.vertexCount * 4 * sizeof(unsigned char)); // Not used...
// Fill color data
+ // NOTE: Not used any more... just one plain color defined at DrawModel()
for (int i = 0; i < (4*vData.vertexCount); i++) vData.colors[i] = 255;
int fCounter = 0;
@@ -1510,6 +1511,7 @@ static VertexData LoadOBJ(const char *fileName)
if (numTexCoords == 0) for (int i = 0; i < (2*vData.vertexCount); i++) vData.texcoords[i] = 0.0f;
// NOTE: We set all vertex colors to white
+ // NOTE: Not used any more... just one plain color defined at DrawModel()
for (int i = 0; i < (4*vData.vertexCount); i++) vData.colors[i] = 255;
// Now we can free temp mid* arrays