More mixed d&c fixes
This commit is contained in:
1 parent
78adb69481
commit
d5a0b2df4d
2 files changed
+12
-5
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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++)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user