mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-17 15:11:12 +00:00
GCC compile fixes
This commit is contained in:
parent
30c7ad3928
commit
2e22b069f1
5 changed files with 25 additions and 121 deletions
|
@ -83,10 +83,12 @@ md2_t md2_playermodels[MAXSKINS];
|
||||||
/*
|
/*
|
||||||
* free model
|
* free model
|
||||||
*/
|
*/
|
||||||
|
#if 0
|
||||||
static void md2_freeModel (model_t *model)
|
static void md2_freeModel (model_t *model)
|
||||||
{
|
{
|
||||||
UnloadModel(model);
|
UnloadModel(model);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -832,11 +834,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
FSurfaceInfo Surf;
|
FSurfaceInfo Surf;
|
||||||
|
|
||||||
char filename[64];
|
char filename[64];
|
||||||
INT32 frame = 0;
|
|
||||||
INT32 nextFrame = -1;
|
|
||||||
FTransform p;
|
|
||||||
md2_t *md2;
|
md2_t *md2;
|
||||||
UINT8 color[4];
|
|
||||||
|
|
||||||
if (!cv_grmd2.value)
|
if (!cv_grmd2.value)
|
||||||
return;
|
return;
|
||||||
|
@ -881,17 +879,6 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
// Look at HWR_ProjectSprite for more
|
// Look at HWR_ProjectSprite for more
|
||||||
{
|
{
|
||||||
GLPatch_t *gpatch;
|
GLPatch_t *gpatch;
|
||||||
INT32 durs = spr->mobj->state->tics;
|
|
||||||
INT32 tics = spr->mobj->tics;
|
|
||||||
mdlframe_t *curr, *next = NULL;
|
|
||||||
const UINT8 flip = (UINT8)((spr->mobj->eflags & MFE_VERTICALFLIP) == MFE_VERTICALFLIP);
|
|
||||||
spritedef_t *sprdef;
|
|
||||||
spriteframe_t *sprframe;
|
|
||||||
float finalscale;
|
|
||||||
|
|
||||||
// Apparently people don't like jump frames like that, so back it goes
|
|
||||||
//if (tics > durs)
|
|
||||||
//durs = tics;
|
|
||||||
|
|
||||||
if (spr->mobj->flags2 & MF2_SHADOW)
|
if (spr->mobj->flags2 & MF2_SHADOW)
|
||||||
Surf.FlatColor.s.alpha = 0x40;
|
Surf.FlatColor.s.alpha = 0x40;
|
||||||
|
@ -933,7 +920,6 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//HWD.pfnSetBlend(blend); // This seems to actually break translucency?
|
//HWD.pfnSetBlend(blend); // This seems to actually break translucency?
|
||||||
finalscale = md2->scale;
|
|
||||||
//Hurdler: arf, I don't like that implementation at all... too much crappy
|
//Hurdler: arf, I don't like that implementation at all... too much crappy
|
||||||
gpatch = md2->grpatch;
|
gpatch = md2->grpatch;
|
||||||
if (!gpatch || !gpatch->mipmap.grInfo.format || !gpatch->mipmap.downloaded)
|
if (!gpatch || !gpatch->mipmap.grInfo.format || !gpatch->mipmap.downloaded)
|
||||||
|
@ -987,95 +973,6 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
gpatch = W_CachePatchNum(spr->patchlumpnum, PU_CACHE);
|
gpatch = W_CachePatchNum(spr->patchlumpnum, PU_CACHE);
|
||||||
HWR_GetMappedPatch(gpatch, spr->colormap);
|
HWR_GetMappedPatch(gpatch, spr->colormap);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spr->mobj->frame & FF_ANIMATE)
|
|
||||||
{
|
|
||||||
// set duration and tics to be the correct values for FF_ANIMATE states
|
|
||||||
durs = spr->mobj->state->var2;
|
|
||||||
tics = spr->mobj->anim_duration;
|
|
||||||
}
|
|
||||||
|
|
||||||
//FIXME: this is not yet correct
|
|
||||||
frame = (spr->mobj->frame & FF_FRAMEMASK) % md2->model->meshes[0].numFrames;
|
|
||||||
curr = &md2->model->meshes[0].frames[frame];
|
|
||||||
#if 0
|
|
||||||
if (cv_grmd2.value == 1 && tics <= durs)
|
|
||||||
{
|
|
||||||
// frames are handled differently for states with FF_ANIMATE, so get the next frame differently for the interpolation
|
|
||||||
if (spr->mobj->frame & FF_ANIMATE)
|
|
||||||
{
|
|
||||||
UINT32 nextframe = (spr->mobj->frame & FF_FRAMEMASK) + 1;
|
|
||||||
if (nextframe >= (UINT32)spr->mobj->state->var1)
|
|
||||||
nextframe = (spr->mobj->state->frame & FF_FRAMEMASK);
|
|
||||||
nextframe %= md2->model->header.numFrames;
|
|
||||||
next = &md2->model->frames[nextframe];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (spr->mobj->state->nextstate != S_NULL && states[spr->mobj->state->nextstate].sprite != SPR_NULL)
|
|
||||||
{
|
|
||||||
const UINT32 nextframe = (states[spr->mobj->state->nextstate].frame & FF_FRAMEMASK) % md2->model->header.numFrames;
|
|
||||||
next = &md2->model->frames[nextframe];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//Hurdler: it seems there is still a small problem with mobj angle
|
|
||||||
p.x = FIXED_TO_FLOAT(spr->mobj->x);
|
|
||||||
p.y = FIXED_TO_FLOAT(spr->mobj->y)+md2->offset;
|
|
||||||
|
|
||||||
if (spr->mobj->eflags & MFE_VERTICALFLIP)
|
|
||||||
p.z = FIXED_TO_FLOAT(spr->mobj->z + spr->mobj->height);
|
|
||||||
else
|
|
||||||
p.z = FIXED_TO_FLOAT(spr->mobj->z);
|
|
||||||
|
|
||||||
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
|
||||||
sprdef = &((skin_t *)spr->mobj->skin)->spritedef;
|
|
||||||
else
|
|
||||||
sprdef = &sprites[spr->mobj->sprite];
|
|
||||||
|
|
||||||
sprframe = &sprdef->spriteframes[spr->mobj->frame & FF_FRAMEMASK];
|
|
||||||
|
|
||||||
if (sprframe->rotate)
|
|
||||||
{
|
|
||||||
fixed_t anglef;
|
|
||||||
if (spr->mobj->player)
|
|
||||||
anglef = AngleFixed(spr->mobj->player->frameangle);
|
|
||||||
else
|
|
||||||
anglef = AngleFixed(spr->mobj->angle);
|
|
||||||
p.angley = FIXED_TO_FLOAT(anglef);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const fixed_t anglef = AngleFixed((R_PointToAngle(spr->mobj->x, spr->mobj->y))-ANGLE_180);
|
|
||||||
p.angley = FIXED_TO_FLOAT(anglef);
|
|
||||||
}
|
|
||||||
p.anglex = 0.0f;
|
|
||||||
p.anglez = 0.0f;
|
|
||||||
if (spr->mobj->standingslope)
|
|
||||||
{
|
|
||||||
fixed_t tempz = spr->mobj->standingslope->normal.z;
|
|
||||||
fixed_t tempy = spr->mobj->standingslope->normal.y;
|
|
||||||
fixed_t tempx = spr->mobj->standingslope->normal.x;
|
|
||||||
fixed_t tempangle = AngleFixed(R_PointToAngle2(0, 0, FixedSqrt(FixedMul(tempy, tempy) + FixedMul(tempz, tempz)), tempx));
|
|
||||||
p.anglez = FIXED_TO_FLOAT(tempangle);
|
|
||||||
tempangle = -AngleFixed(R_PointToAngle2(0, 0, tempz, tempy));
|
|
||||||
p.anglex = FIXED_TO_FLOAT(tempangle);
|
|
||||||
}
|
|
||||||
|
|
||||||
color[0] = Surf.FlatColor.s.red;
|
|
||||||
color[1] = Surf.FlatColor.s.green;
|
|
||||||
color[2] = Surf.FlatColor.s.blue;
|
|
||||||
color[3] = Surf.FlatColor.s.alpha;
|
|
||||||
|
|
||||||
// SRB2CBTODO: MD2 scaling support
|
|
||||||
finalscale *= FIXED_TO_FLOAT(spr->mobj->scale);
|
|
||||||
|
|
||||||
p.flip = atransform.flip;
|
|
||||||
p.mirror = atransform.mirror;
|
|
||||||
|
|
||||||
HWD.pfnDrawModel(md2->model, frame, durs, tics, nextFrame, &p, finalscale, flip, color);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,7 @@ static void GetNormalFromLatLong(short latlng, float *out)
|
||||||
out[2] = *lookup++;
|
out[2] = *lookup++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void NormalToLatLng(float *n, short *out)
|
static void NormalToLatLng(float *n, short *out)
|
||||||
{
|
{
|
||||||
// Special cases
|
// Special cases
|
||||||
|
@ -115,6 +116,7 @@ static void NormalToLatLng(float *n, short *out)
|
||||||
*out = (x << 8) + y;
|
*out = (x << 8) + y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline void LatLngToNormal(short n, float *out)
|
static inline void LatLngToNormal(short n, float *out)
|
||||||
{
|
{
|
||||||
|
@ -140,7 +142,7 @@ static void LatLngInit(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool latlnginit = false;
|
static boolean latlnginit = false;
|
||||||
|
|
||||||
model_t *MD3_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
model_t *MD3_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
static float PI = (3.1415926535897932384626433832795f);
|
static float PI = (3.1415926535897932384626433832795f);
|
||||||
float U_Deg2Rad(float deg)
|
static float U_Deg2Rad(float deg)
|
||||||
{
|
{
|
||||||
return deg * ((float)PI / 180.0f);
|
return deg * ((float)PI / 180.0f);
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,8 @@ void VectorRotate(vector_t *rotVec, const vector_t *axisVec, float angle)
|
||||||
|
|
||||||
void CreateVBOTiny(mesh_t *mesh, tinyframe_t *frame)
|
void CreateVBOTiny(mesh_t *mesh, tinyframe_t *frame)
|
||||||
{
|
{
|
||||||
|
(void)mesh;
|
||||||
|
(void)frame;
|
||||||
return;
|
return;
|
||||||
/* int bufferSize = sizeof(VBO::vbotiny_t)*mesh->numTriangles*3;
|
/* int bufferSize = sizeof(VBO::vbotiny_t)*mesh->numTriangles*3;
|
||||||
VBO::vbotiny_t *buffer = (VBO::vbotiny_t*)Z_Malloc(bufferSize, PU_STATIC, 0);
|
VBO::vbotiny_t *buffer = (VBO::vbotiny_t*)Z_Malloc(bufferSize, PU_STATIC, 0);
|
||||||
|
@ -91,6 +93,8 @@ void CreateVBOTiny(mesh_t *mesh, tinyframe_t *frame)
|
||||||
|
|
||||||
void CreateVBO(mesh_t *mesh, mdlframe_t *frame)
|
void CreateVBO(mesh_t *mesh, mdlframe_t *frame)
|
||||||
{
|
{
|
||||||
|
(void)mesh;
|
||||||
|
(void)frame;
|
||||||
return;
|
return;
|
||||||
/* int bufferSize = sizeof(VBO::vbo64_t)*mesh->numTriangles*3;
|
/* int bufferSize = sizeof(VBO::vbo64_t)*mesh->numTriangles*3;
|
||||||
VBO::vbo64_t *buffer = (VBO::vbo64_t*)Z_Malloc(bufferSize, PU_STATIC, 0);
|
VBO::vbo64_t *buffer = (VBO::vbo64_t*)Z_Malloc(bufferSize, PU_STATIC, 0);
|
||||||
|
@ -450,7 +454,7 @@ typedef struct materiallist_s
|
||||||
material_t *material;
|
material_t *material;
|
||||||
} materiallist_t;
|
} materiallist_t;
|
||||||
|
|
||||||
static bool AddMaterialToList(materiallist_t **head, material_t *material)
|
static boolean AddMaterialToList(materiallist_t **head, material_t *material)
|
||||||
{
|
{
|
||||||
materiallist_t *node;
|
materiallist_t *node;
|
||||||
for (node = *head; node; node = node->next)
|
for (node = *head; node; node = node->next)
|
||||||
|
@ -648,7 +652,8 @@ void GeneratePolygonNormals(model_t *model, int ztag)
|
||||||
//
|
//
|
||||||
// Reload VBOs
|
// Reload VBOs
|
||||||
//
|
//
|
||||||
void Reload(void)
|
#if 0
|
||||||
|
static void Reload(void)
|
||||||
{
|
{
|
||||||
/* model_t *node;
|
/* model_t *node;
|
||||||
for (node = modelHead; node; node = node->next)
|
for (node = modelHead; node; node = node->next)
|
||||||
|
@ -673,9 +678,11 @@ void Reload(void)
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void DeleteVBOs(model_t *model)
|
void DeleteVBOs(model_t *model)
|
||||||
{
|
{
|
||||||
|
(void)model;
|
||||||
/* for (int i = 0; i < model->numMeshes; i++)
|
/* for (int i = 0; i < model->numMeshes; i++)
|
||||||
{
|
{
|
||||||
mesh_t *mesh = &model->meshes[i];
|
mesh_t *mesh = &model->meshes[i];
|
||||||
|
|
|
@ -27,7 +27,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
float ambient[4], diffuse[4], specular[4], emissive[4];
|
float ambient[4], diffuse[4], specular[4], emissive[4];
|
||||||
float shininess;
|
float shininess;
|
||||||
bool spheremap;
|
boolean spheremap;
|
||||||
// Texture::texture_t *texture;
|
// Texture::texture_t *texture;
|
||||||
// Texture::texture_t *lightmap;
|
// Texture::texture_t *lightmap;
|
||||||
} material_t;
|
} material_t;
|
||||||
|
|
|
@ -1920,8 +1920,6 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
|
||||||
|
|
||||||
static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32 tics, INT32 nextFrameIndex, FTransform *pos, float scale, UINT8 flipped, UINT8 *color)
|
static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32 tics, INT32 nextFrameIndex, FTransform *pos, float scale, UINT8 flipped, UINT8 *color)
|
||||||
{
|
{
|
||||||
INT32 val, count, pindex;
|
|
||||||
GLfloat s, t;
|
|
||||||
GLfloat ambient[4];
|
GLfloat ambient[4];
|
||||||
GLfloat diffuse[4];
|
GLfloat diffuse[4];
|
||||||
|
|
||||||
|
@ -2062,9 +2060,9 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32
|
||||||
normPtr = normBuffer;
|
normPtr = normBuffer;
|
||||||
for (j = 0; j < mesh->numTriangles; j++)
|
for (j = 0; j < mesh->numTriangles; j++)
|
||||||
{
|
{
|
||||||
pglTexCoord2fv(uvPtr);
|
pglTexCoord2fv((const GLfloat*) uvPtr);
|
||||||
pglNormal3bv(normPtr);
|
pglNormal3bv((const GLbyte*) normPtr);
|
||||||
pglVertex3sv(vertPtr);
|
pglVertex3sv((const GLshort*) vertPtr);
|
||||||
|
|
||||||
uvPtr += 2;
|
uvPtr += 2;
|
||||||
normPtr += 3;
|
normPtr += 3;
|
||||||
|
|
Loading…
Reference in a new issue