diff --git a/src/hardware/hw_md2load.c b/src/hardware/hw_md2load.c index 84b1bc53..ddf89f8d 100644 --- a/src/hardware/hw_md2load.c +++ b/src/hardware/hw_md2load.c @@ -233,6 +233,8 @@ typedef struct // Load the model model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat) { + FILE *f; + model_t *retModel = NULL; md2header_t *header; @@ -247,6 +249,10 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat) const float WUNITS = 1.0f; float dataScale = WUNITS; + md2triangle_t *tris; + md2texcoord_t *texcoords; + md2frame_t *frames; + int t; // MD2 currently does not work with tinyframes, so force useFloat = true @@ -263,7 +269,7 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat) useFloat = true; - FILE *f = fopen(fileName, "rb"); + f = fopen(fileName, "rb"); if (!f) return NULL; @@ -316,9 +322,9 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat) // float dataScale = WUNITS; // Tris and ST are simple structures that can be straight-copied - md2triangle_t *tris = (md2triangle_t*)&buffer[header->offsetTris]; - md2texcoord_t *texcoords = (md2texcoord_t*)&buffer[header->offsetST]; - md2frame_t *frames = (md2frame_t*)&buffer[header->offsetFrames]; + tris = (md2triangle_t*)&buffer[header->offsetTris]; + texcoords = (md2texcoord_t*)&buffer[header->offsetST]; + frames = (md2frame_t*)&buffer[header->offsetFrames]; // Read in textures retModel->numMaterials = header->numSkins; diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 3410ed3e..f7f9dd5b 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -1827,12 +1827,13 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32 { float *vertPtr; float *normPtr; + int j = 0; // Dangit, I soooo want to do this in a GLSL shader... AllocLerpBuffer(mesh->numVertices * sizeof(float) * 3); vertPtr = vertBuffer; normPtr = normBuffer; - int j = 0; + //int j = 0; for (j = 0; j < mesh->numVertices * 3; j++) {