From: outfrost Date: Wed, 25 Dec 2019 11:21:22 +0000 (+0100) Subject: Fix code defects from GCC warnings X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=82e2f4e1a31dcd118d99263ebb26919aa06582c5;p=shadowclad.git Fix code defects from GCC warnings --- diff --git a/src/main.c b/src/main.c index 262860b..a7f0c62 100644 --- a/src/main.c +++ b/src/main.c @@ -4,6 +4,7 @@ #include "level.h" #include "logger.h" #include "performance.h" +#include "player.h" #include "render.h" #include "ui.h" diff --git a/src/player.h b/src/player.h index 19898d5..4b0317c 100644 --- a/src/player.h +++ b/src/player.h @@ -12,6 +12,7 @@ typedef struct { Character playerCharacter; Vector3D playerPos; +void initPlayer(); void spawnPlayer(); #endif diff --git a/src/render.c b/src/render.c index 27190c6..56b0a9f 100644 --- a/src/render.c +++ b/src/render.c @@ -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) {