diff src/main.c @ 44:f0073a47c31d

Fix various warnings.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 06 Aug 2013 00:04:37 +0300
parents 5770a4c85961
children d85542c96791
line wrap: on
line diff
--- a/src/main.c	Tue Aug 06 00:04:30 2013 +0300
+++ b/src/main.c	Tue Aug 06 00:04:37 2013 +0300
@@ -1404,7 +1404,8 @@
 
 void stbi_flip_y(int w, int h, int comp, stbi_uc *data)
 {
-   size_t y, i, stride = w * comp;
+   int y;
+   size_t i, stride = w * comp;
    uint8 *out = data;
 
    for (y = 0; y < (h>>1); ++y) {
@@ -1455,7 +1456,7 @@
 
 GLuint LoadTexture(const char* pFilename, int invert)
 {
-    if(!load_textures) return;
+    if(!load_textures) return 0;
 
     if (strcmp(pFilename,"") == 0) return 99999;
     printf(" - LoadTexture(\"%s\")", pFilename);
@@ -1526,18 +1527,16 @@
     {
         int texIndex = 0;
         aiReturn texFound = AI_SUCCESS;
-
         aiString path;  // filename
 
         while (texFound == AI_SUCCESS)
         {
             texFound = scene->mMaterials[m]->GetTexture(aiTextureType_DIFFUSE, texIndex, &path);
-            GLuint texnum = LoadTexture(path.data, 0);
-            textureIdMap[path.data] = texnum;
+            textureIdMap[path.data] = LoadTexture(path.data, 0);
             texIndex++;
         }
     }
-    //return success;
+
     return true;
 }
 
@@ -1700,7 +1699,7 @@
     if(AI_SUCCESS == mtl->GetTexture(aiTextureType_DIFFUSE, texIndex, &texPath))
     {
     //bind texture
-    GLuint texId = textureIdMap.at(texPath.data);
+    GLuint texId = (GLuint) textureIdMap.at(texPath.data);
     if (texId != 99999) glBindTexture(GL_TEXTURE_2D, texId);
     }