mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 22:51:57 +00:00
changes angles->axis and stuff
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@467 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
bc260e8e72
commit
8dc7815228
9 changed files with 89 additions and 22 deletions
|
@ -78,6 +78,10 @@ typedef struct {
|
|||
int groupofs;
|
||||
|
||||
int nextsurf;
|
||||
|
||||
|
||||
int numtags;
|
||||
int ofstags;
|
||||
} galiasinfo_t;
|
||||
|
||||
//frame is an index into this
|
||||
|
@ -2316,11 +2320,35 @@ void GL_LoadQ2Model (model_t *mod, void *buffer)
|
|||
|
||||
|
||||
|
||||
typedef struct {
|
||||
char name[MAX_QPATH];
|
||||
vec3_t org;
|
||||
float ang[3][3];
|
||||
} md3tag_t;
|
||||
|
||||
|
||||
|
||||
|
||||
void Mod_GetTag(model_t *model, int tagnum, int frame, float **org, float **axis)
|
||||
{
|
||||
galiasinfo_t *inf;
|
||||
md3tag_t *t;
|
||||
|
||||
*org = NULL;
|
||||
*axis = NULL;
|
||||
if (!model || model->type != mod_alias)
|
||||
return;
|
||||
|
||||
inf = Mod_Extradata(model);
|
||||
t = (md3tag_t*)((char*)inf + inf->ofstags);
|
||||
if (tagnum <= 0 || tagnum > inf->numtags)
|
||||
return;
|
||||
tagnum--; //tagnum 0 is 'use my angles/org'
|
||||
|
||||
t += tagnum;
|
||||
*org = t->org;
|
||||
*axis = (float*)t->ang;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -2404,13 +2432,6 @@ typedef struct {
|
|||
} md3Shader_t;
|
||||
//End of Tenebrae 'assistance'
|
||||
|
||||
typedef struct {
|
||||
char name[MAX_QPATH];
|
||||
vec3_t org;
|
||||
float ang[3][3];
|
||||
} md3tag_t;
|
||||
|
||||
|
||||
void GL_LoadQ3Model(model_t *mod, void *buffer)
|
||||
{
|
||||
extern qboolean gl_bumpmappingpossible;
|
||||
|
@ -2644,6 +2665,10 @@ void GL_LoadQ3Model(model_t *mod, void *buffer)
|
|||
surf = (md3Surface_t *)((qbyte *)surf + surf->ofsEnd);
|
||||
}
|
||||
|
||||
root->numtags = header->numTags;
|
||||
root->ofstags = (char*)Hunk_Alloc(header->numTags*sizeof(md3tag_t)*header->numFrames) - (char*)root;
|
||||
memcpy((char*)root+root->ofstags, (char*)header+header->ofsTags, header->numTags*sizeof(md3tag_t)*header->numFrames);
|
||||
|
||||
//
|
||||
// move the complete, relocatable alias model to the cache
|
||||
//
|
||||
|
|
|
@ -727,7 +727,10 @@ TRACE(("dbg: GLDraw_ReInit: Allocating upload buffers\n"));
|
|||
if (!draw_chars) //or low res.
|
||||
{
|
||||
if (!(char_texture=Mod_LoadHiResTexture("pics/conchars.pcx", false, true, false))) //try low res q2 path
|
||||
if (!(char_texture=Mod_LoadHiResTexture("gfx/2d/bigchars.tga", false, true, false))) //try low res q2 path
|
||||
{
|
||||
|
||||
//gulp... so it's come to this has it? rework the hexen2 conchars into the q1 system.
|
||||
char *tempchars = COM_LoadMallocFile("gfx/menu/conchars.lmp");
|
||||
char *in, *out;
|
||||
if (!tempchars)
|
||||
|
@ -951,6 +954,7 @@ TRACE(("dbg: GLDraw_ReInit: Allocating upload buffers\n"));
|
|||
{
|
||||
if (!(gl->texnum=Mod_LoadHiResTexture("pics/conback.pcx", false, true, false)))
|
||||
if (!(gl->texnum=Mod_LoadReplacementTexture("gfx/menu/conback.lmp", false, true, false)))
|
||||
if (!(gl->texnum=Mod_LoadReplacementTexture("textures/sfx/logo512.jpg", false, false, false)))
|
||||
Sys_Error ("Couldn't load gfx/conback.lmp"); //that's messed it up, hasn't it?...
|
||||
}
|
||||
else
|
||||
|
@ -1342,7 +1346,7 @@ void GLDraw_Pic (int x, int y, qpic_t *pic)
|
|||
#endif
|
||||
}
|
||||
|
||||
void GLDraw_LevelPic (qpic_t *pic) //Fullscreen and stuff
|
||||
void GLDraw_ScalePic (int x, int y, int width, int height, qpic_t *pic)
|
||||
{
|
||||
glpic_t *gl;
|
||||
|
||||
|
@ -1356,13 +1360,13 @@ void GLDraw_LevelPic (qpic_t *pic) //Fullscreen and stuff
|
|||
GL_Bind (gl->texnum);
|
||||
glBegin (GL_QUADS);
|
||||
glTexCoord2f (gl->sl, gl->tl);
|
||||
glVertex2f (0, 0);
|
||||
glVertex2f (x, y);
|
||||
glTexCoord2f (gl->sh, gl->tl);
|
||||
glVertex2f (vid.conwidth, 0);
|
||||
glVertex2f (x+width, y);
|
||||
glTexCoord2f (gl->sh, gl->th);
|
||||
glVertex2f (vid.conwidth, vid.conheight);
|
||||
glVertex2f (x+width, y+height);
|
||||
glTexCoord2f (gl->sl, gl->th);
|
||||
glVertex2f (0, vid.conheight);
|
||||
glVertex2f (x, y+height);
|
||||
glEnd ();
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ void GLDraw_ColouredCharacter (int x, int y, unsigned int num);
|
|||
void GLDraw_DebugChar (qbyte num);
|
||||
void GLDraw_SubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height);
|
||||
void GLDraw_Pic (int x, int y, qpic_t *pic);
|
||||
void GLDraw_ScalePic (int x, int y, int width, int height, qpic_t *pic);
|
||||
void GLDraw_TransPic (int x, int y, qpic_t *pic);
|
||||
void GLDraw_TransPicTranslate (int x, int y, qpic_t *pic, qbyte *translation);
|
||||
void GLDraw_ConsoleBackground (int lines);
|
||||
|
|
|
@ -69,6 +69,7 @@ typedef struct mesh_s
|
|||
unsigned int patchWidth;
|
||||
unsigned int patchHeight;
|
||||
} mesh_t;
|
||||
struct meshbuffer_s;
|
||||
|
||||
void R_PushMesh ( mesh_t *mesh, int features );
|
||||
void R_RenderMeshBuffer ( struct meshbuffer_s *mb, qboolean shadowpass );
|
||||
|
|
|
@ -1277,6 +1277,7 @@ static void PPL_BaseTextureChain(msurface_t *first)
|
|||
s->ownerent = &r_worldentity;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (s->mesh)
|
||||
{
|
||||
redraw = mb.fog != s->fog || mb.infokey != vi|| mb.shader->flags&SHADER_DEFORMV_BULGE;
|
||||
|
|
|
@ -413,14 +413,20 @@ void GLQ3_LightGrid(vec3_t point, vec3_t res_diffuse, vec3_t res_ambient, vec3_t
|
|||
}
|
||||
|
||||
// if (!lg)
|
||||
{
|
||||
if(res_ambient)
|
||||
{
|
||||
res_ambient[0] = 64;
|
||||
res_ambient[1] = 64;
|
||||
res_ambient[2] = 64;
|
||||
}
|
||||
|
||||
if (res_diffuse)
|
||||
{
|
||||
res_diffuse[0] = 192;
|
||||
res_diffuse[1] = 192;
|
||||
res_diffuse[2] = 192;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -172,12 +172,39 @@ qboolean R_CullSphere (vec3_t org, float radius)
|
|||
|
||||
void R_RotateForEntity (entity_t *e)
|
||||
{
|
||||
glTranslatef (e->origin[0], e->origin[1], e->origin[2]);
|
||||
float m[16];
|
||||
m[0] = e->axis[0][0];
|
||||
m[1] = e->axis[0][1];
|
||||
m[2] = e->axis[0][2];
|
||||
m[3] = 0;
|
||||
|
||||
m[4] = e->axis[1][0];
|
||||
m[5] = e->axis[1][1];
|
||||
m[6] = e->axis[1][2];
|
||||
m[7] = 0;
|
||||
|
||||
m[8] = e->axis[2][0];
|
||||
m[9] = e->axis[2][1];
|
||||
m[10] = e->axis[2][2];
|
||||
m[11] = 0;
|
||||
|
||||
m[12] = e->origin[0];
|
||||
m[13] = e->origin[1];
|
||||
m[14] = e->origin[2];
|
||||
m[15] = 1;
|
||||
|
||||
|
||||
|
||||
#if 1
|
||||
glMultMatrixf(m);
|
||||
|
||||
#else
|
||||
glTranslatef (e->origin[0], e->origin[1], e->origin[2]);
|
||||
glRotatef (e->angles[1], 0, 0, 1);
|
||||
glRotatef (-e->angles[0], 0, 1, 0);
|
||||
//ZOID: fixed z angle
|
||||
glRotatef (e->angles[2], 1, 0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -852,6 +852,8 @@ void GLR_NewMap (void)
|
|||
d_lightstylevalue[i] = 264; // normal light value
|
||||
|
||||
memset (&r_worldentity, 0, sizeof(r_worldentity));
|
||||
AngleVectors(r_worldentity.angles, r_worldentity.axis[0], r_worldentity.axis[1], r_worldentity.axis[2]);
|
||||
VectorInverse(r_worldentity.axis[1]);
|
||||
r_worldentity.model = cl.worldmodel;
|
||||
|
||||
Cvar_Set(&host_mapname, cl.worldmodel->name);
|
||||
|
|
|
@ -1977,7 +1977,7 @@ void R_RenderDynamicLightmaps (msurface_t *fa)
|
|||
// lightmap[fa->lightmaptexturenum]->polys = fa->polys;
|
||||
|
||||
// check for lightmap modification
|
||||
if (cl.worldmodel->fromgame != fg_quake3) //no lightstyles on q3 maps
|
||||
// if (cl.worldmodel->fromgame != fg_quake3) //no lightstyles on q3 maps
|
||||
{
|
||||
for (maps = 0 ; maps < MAXLIGHTMAPS && fa->styles[maps] != 255 ;
|
||||
maps++)
|
||||
|
|
Loading…
Reference in a new issue