]> git.lizzy.rs Git - shadowclad.git/commitdiff
Fix code defects from GCC warnings
authoroutfrost <kotlet.bahn@gmail.com>
Wed, 25 Dec 2019 11:21:22 +0000 (12:21 +0100)
committeroutfrost <kotlet.bahn@gmail.com>
Wed, 25 Dec 2019 11:21:22 +0000 (12:21 +0100)
src/main.c
src/player.h
src/render.c

index 262860be339667556fbfdaa126840e29c9f7a25e..a7f0c62375b9cb55527b435a83dc68087b42f1d7 100644 (file)
@@ -4,6 +4,7 @@
 #include "level.h"
 #include "logger.h"
 #include "performance.h"
+#include "player.h"
 #include "render.h"
 #include "ui.h"
 
index 19898d58b57381985598944d894e331f44d914ab..4b0317cc82de4d08d21a87891ebe98b3cb960ea6 100644 (file)
@@ -12,6 +12,7 @@ typedef struct {
 Character playerCharacter;
 Vector3D playerPos;
 
+void initPlayer();
 void spawnPlayer();
 
 #endif
index 27190c697b078ec4a3029ac653613a94b2c590b3..56b0a9f732b05ee3b3586951dee8096dffe843a0 100644 (file)
@@ -132,14 +132,14 @@ static void drawAsset3D(const Asset3D* asset3D) {
        glMatrixMode(GL_MODELVIEW);
        glColor3f(0.5f, 1.0f, 0.0f);
        
-       for (int meshIndex = 0; meshIndex < asset3D->numMeshes; ++meshIndex) {
+       for (size_t meshIndex = 0; meshIndex < asset3D->numMeshes; ++meshIndex) {
                const Mesh mesh = asset3D->meshes[meshIndex];
                glBindTexture(GL_TEXTURE_2D,
                              asset3D->materials[mesh.materialIndex].textureId);
                bool hasNormals = mesh.normals != NULL;
                bool hasTextureCoords = mesh.textureCoords != NULL;
                
-               for (int faceIndex = 0; faceIndex < mesh.numFaces; ++faceIndex) {
+               for (size_t faceIndex = 0; faceIndex < mesh.numFaces; ++faceIndex) {
                        const Face face = mesh.faces[faceIndex];
                        
                        GLenum faceMode;
@@ -152,7 +152,7 @@ static void drawAsset3D(const Asset3D* asset3D) {
                        
                        glBegin(faceMode);
                        
-                       for (int i = 0; i < face.numIndices; ++i) {
+                       for (size_t i = 0; i < face.numIndices; ++i) {
                                unsigned int vertIndex = face.indices[i];
                                if (hasNormals) {
                                        if (hasTextureCoords) {