From 468db062ea41a78210871ea5b2d53c01f9cab190 Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Wed, 6 Sep 2000 22:11:33 +0000 Subject: [PATCH] Various graphical tweaks (mainly particle related), some code removed. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@24 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_parse.c | 14 ++--- cl_tent.c | 13 +++-- console.c | 4 +- gl_draw.c | 2 +- gl_rmain.c | 16 ++---- gl_rmisc.c | 4 +- gl_rsurf.c | 16 +++--- gl_screen.c | 28 ++-------- glquake.h | 7 +-- host.c | 8 +-- r_light.c | 10 ++-- r_part.c | 157 ++++++++++++++++++++-------------------------------- render.h | 3 +- sbar.c | 8 +-- sbar.h | 3 - vid.h | 10 ---- vid_glx.c | 6 -- vid_wgl.c | 9 --- view.c | 4 +- 19 files changed, 114 insertions(+), 208 deletions(-) diff --git a/cl_parse.c b/cl_parse.c index da405589..38acf24a 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -103,7 +103,7 @@ entity_t *CL_EntityNum (int num) Host_Error ("CL_EntityNum: %i is an invalid number",num); while (cl.num_entities<=num) { - cl_entities[cl.num_entities].colormap = vid.colormap; + cl_entities[cl.num_entities].colormap = 0; //vid.colormap; cl.num_entities++; } } @@ -513,7 +513,7 @@ void CL_ParseUpdate (int bits) else forcelink = true; // hack to make null model players work if (num > 0 && num <= cl.maxclients) - R_TranslatePlayerSkin (num - 1); + R_TranslatePlayerSkin(num - 1); } ent->frame = ((bits & U_FRAME) ? MSG_ReadByte() : (baseline->frame & 0xFF)); @@ -521,12 +521,12 @@ void CL_ParseUpdate (int bits) i = bits & U_COLORMAP ? MSG_ReadByte() : baseline->colormap; ent->deltabaseline.colormap = i; if (!i) - ent->colormap = vid.colormap; + ent->colormap = 0; //vid.colormap; else { if (i > cl.maxclients) Host_Error ("i >= cl.maxclients"); - ent->colormap = vid.colormap; // cl.scores[i-1].translations; + ent->colormap = i; //vid.colormap; // cl.scores[i-1].translations; } skin = bits & U_SKIN ? MSG_ReadByte() : baseline->skin; @@ -534,7 +534,7 @@ void CL_ParseUpdate (int bits) { ent->skinnum = skin; if (num > 0 && num <= cl.maxclients) - R_TranslatePlayerSkin (num - 1); + R_TranslatePlayerSkin(num - 1); } ent->deltabaseline.skin = skin; @@ -765,7 +765,7 @@ void CL_ParseStatic (void) // copy it to the current state ent->model = cl.model_precache[ent->baseline.modelindex]; ent->frame = ent->baseline.frame; - ent->colormap = vid.colormap; + ent->colormap = 0; //vid.colormap; ent->skinnum = ent->baseline.skin; ent->effects = ent->baseline.effects; ent->alpha = 1; @@ -959,7 +959,7 @@ void CL_ParseServerMessage (void) if (i >= cl.maxclients) Host_Error ("CL_ParseServerMessage: svc_updatecolors > MAX_SCOREBOARD"); cl.scores[i].colors = MSG_ReadByte (); - R_TranslatePlayerSkin (i); + R_TranslatePlayerSkin(i); break; case svc_particle: diff --git a/cl_tent.c b/cl_tent.c index bc9f87d7..42ed0795 100644 --- a/cl_tent.c +++ b/cl_tent.c @@ -338,7 +338,7 @@ void CL_ParseTEnt (void) pos[0] = MSG_ReadCoord (); pos[1] = MSG_ReadCoord (); pos[2] = MSG_ReadCoord (); -// R_ParticleExplosion (pos, false); + R_ParticleExplosion (pos, false); dl = CL_AllocDlight (0); VectorCopy (pos, dl->origin); dl->radius = 350; @@ -352,7 +352,7 @@ void CL_ParseTEnt (void) pos[0] = MSG_ReadCoord (); pos[1] = MSG_ReadCoord (); pos[2] = MSG_ReadCoord (); -// R_ParticleExplosion (pos, false); + R_ParticleExplosion (pos, false); dl = CL_AllocDlight (0); VectorCopy (pos, dl->origin); dl->radius = 600; @@ -382,7 +382,7 @@ void CL_ParseTEnt (void) pos[0] = MSG_ReadCoord (); pos[1] = MSG_ReadCoord (); pos[2] = MSG_ReadCoord (); -// R_ParticleExplosion (pos, false); + R_ParticleExplosion (pos, false); dl = CL_AllocDlight (0); VectorCopy (pos, dl->origin); dl->radius = 350; @@ -396,7 +396,7 @@ void CL_ParseTEnt (void) pos[0] = MSG_ReadCoord (); pos[1] = MSG_ReadCoord (); pos[2] = MSG_ReadCoord (); -// R_ParticleExplosion (pos, false); + R_ParticleExplosion (pos, false); dl = CL_AllocDlight (0); VectorCopy (pos, dl->origin); dl->radius = 350; @@ -410,7 +410,7 @@ void CL_ParseTEnt (void) pos[0] = MSG_ReadCoord (); pos[1] = MSG_ReadCoord (); pos[2] = MSG_ReadCoord (); -// R_BlobExplosion (pos); + R_BlobExplosion (pos); S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1); dl = CL_AllocDlight (0); @@ -501,7 +501,8 @@ entity_t *CL_NewTempEntity (void) cl_visedicts[cl_numvisedicts] = ent; cl_numvisedicts++; - ent->colormap = vid.colormap; +// ent->colormap = vid.colormap; + ent->colormap = 0; ent->scale = 1; ent->alpha = 1; ent->colormod[0] = ent->colormod[1] = ent->colormod[2] = 1; diff --git a/console.c b/console.c index a1346332..c3ce5a1b 100644 --- a/console.c +++ b/console.c @@ -571,9 +571,9 @@ void Con_DrawNotify (void) // LordHavoc: speedup, and other improvements if (team_message) - sprintf(temptext, "say:%s%c", chat_buffer, (int) 10+((int)(realtime*con_cursorspeed)&1)); - else sprintf(temptext, "say_team:%s%c", chat_buffer, (int) 10+((int)(realtime*con_cursorspeed)&1)); + else + sprintf(temptext, "say:%s%c", chat_buffer, (int) 10+((int)(realtime*con_cursorspeed)&1)); while (strlen(temptext) >= con_linewidth) { Draw_String (8, v, temptext, con_linewidth); diff --git a/gl_draw.c b/gl_draw.c index 88e68abd..2e6772f7 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -48,7 +48,7 @@ typedef struct byte conback_buffer[sizeof(qpic_t) + sizeof(glpic_t)]; qpic_t *conback = (qpic_t *)&conback_buffer; -int gl_filter_min = GL_LINEAR_MIPMAP_NEAREST; +int gl_filter_min = GL_LINEAR_MIPMAP_LINEAR; //NEAREST; int gl_filter_max = GL_LINEAR; diff --git a/gl_rmain.c b/gl_rmain.c index d48dec0a..63e16255 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -75,9 +75,9 @@ cvar_t r_speeds = {"r_speeds","0"}; cvar_t r_speeds2 = {"r_speeds2","0"}; cvar_t r_fullbright = {"r_fullbright","0"}; //cvar_t r_lightmap = {"r_lightmap","0"}; -//cvar_t r_shadows = {"r_shadows","0"}; +cvar_t r_shadows = {"r_shadows","0"}; cvar_t r_wateralpha = {"r_wateralpha","1"}; -//cvar_t r_dynamic = {"r_dynamic","1"}; +cvar_t r_dynamic = {"r_dynamic","1"}; cvar_t r_novis = {"r_novis","0"}; cvar_t r_waterripple = {"r_waterripple","0"}; cvar_t r_fullbrights = {"r_fullbrights", "1"}; @@ -804,8 +804,7 @@ void R_DrawAliasFrame (aliashdr_t *paliashdr) glColor3f (1,1,1); } - /* - if (r_shadows.value && !(currententity->effects & EF_ADDITIVE) && currententity != &cl.viewent) + if (!fogenabled && r_shadows.value && !(currententity->effects & EF_ADDITIVE) && currententity != &cl.viewent) { // flatten it to make a shadow float *av = aliasvert + 2, l = lightspot[2] + 0.125; @@ -839,7 +838,6 @@ void R_DrawAliasFrame (aliashdr_t *paliashdr) glEnable (GL_TEXTURE_2D); glColor3f (1,1,1); } - */ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable (GL_BLEND); @@ -1020,8 +1018,7 @@ void R_DrawQ2AliasFrame (md2mem_t *pheader) glColor3f (1,1,1); } - /* - if (r_shadows.value && !(currententity->effects & EF_ADDITIVE) && currententity != &cl.viewent) + if (!fogenabled && r_shadows.value && !(currententity->effects & EF_ADDITIVE) && currententity != &cl.viewent) { int i; float *av = aliasvert + 2, l = lightspot[2] + 0.125; @@ -1086,7 +1083,6 @@ void R_DrawQ2AliasFrame (md2mem_t *pheader) glEnable (GL_TEXTURE_2D); glColor3f (1,1,1); } - */ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable (GL_BLEND); @@ -1181,11 +1177,11 @@ void R_DrawAliasModel (entity_t *e, int cull) // we can't dynamically colormap textures, so they are cached // seperately for the players. Heads are just uncolored. - if (currententity->colormap != vid.colormap/* && !gl_nocolors.value*/) + if (currententity->colormap != 0 /*vid.colormap*/ /* && !gl_nocolors.value*/) { i = currententity - cl_entities; if (i >= 1 && i<=cl.maxclients /* && !strcmp (currententity->model->name, "progs/player.mdl") */) - glBindTexture(GL_TEXTURE_2D, playertextures - 1 + i); + glBindTexture(GL_TEXTURE_2D, playertextures - 1 + i); } // if (gl_affinemodels.value) diff --git a/gl_rmisc.c b/gl_rmisc.c index 39cc5bbb..ceb79089 100644 --- a/gl_rmisc.c +++ b/gl_rmisc.c @@ -142,9 +142,9 @@ void R_Init (void) // Cvar_RegisterVariable (&r_lightmap); Cvar_RegisterVariable (&r_drawentities); Cvar_RegisterVariable (&r_drawviewmodel); -// Cvar_RegisterVariable (&r_shadows); + Cvar_RegisterVariable (&r_shadows); Cvar_RegisterVariable (&r_wateralpha); -// Cvar_RegisterVariable (&r_dynamic); + Cvar_RegisterVariable (&r_dynamic); Cvar_RegisterVariable (&r_novis); Cvar_RegisterVariable (&r_speeds); Cvar_RegisterVariable (&r_waterripple); // LordHavoc: added waterripple diff --git a/gl_rsurf.c b/gl_rsurf.c index 060a0ef7..55ab1875 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -510,8 +510,8 @@ void DrawTextureChains (void) if (currentwallpoly < MAX_WALLPOLYS && currentwallvert < MAX_WALLVERTS && (currentwallvert + s->polys->numverts) <= MAX_WALLVERTS) { // check for lightmap modification -// if (r_dynamic.value) -// { + if (r_dynamic.value) + { if (s->dlightframe == r_framecount || s->cached_dlight || lighthalf != s->cached_lighthalf) // dynamic this frame or previously, or lighthalf changed R_UpdateLightmap(s, s->lightmaptexturenum); else @@ -521,7 +521,7 @@ void DrawTextureChains (void) R_UpdateLightmap(s, s->lightmaptexturenum); break; } -// } + } wallpoly[currentwallpoly].texnum = (unsigned short) t->gl_texturenum; wallpoly[currentwallpoly].lighttexnum = (unsigned short) lightmap_textures + s->lightmaptexturenum; wallpoly[currentwallpoly].glowtexnum = (unsigned short) t->gl_glowtexturenum; @@ -561,7 +561,7 @@ void DrawTextureChains (void) light = false; if (s->flags & SURF_DRAWFULLBRIGHT) r = g = b = lighthalf ? 128 : 255; - else if (s->dlightframe == r_dlightframecount/* && r_dynamicwater.value*/) + else if (s->dlightframe == r_dlightframecount && r_dynamic.value) light = true; else r = g = b = lighthalf ? 64 : 128; @@ -865,7 +865,7 @@ e->angles[0] = -e->angles[0]; // stupid quake bug b = 255.0f * currententity->colormod[2]; } } - else if (s->dlightframe == r_dlightframecount/* && r_dynamicwater.value*/) + else if (s->dlightframe == r_dlightframecount && r_dynamic.value) light = true; else { @@ -963,8 +963,8 @@ e->angles[0] = -e->angles[0]; // stupid quake bug else { // check for lightmap modification -// if (r_dynamic.value) -// { + if (r_dynamic.value) + { if (s->dlightframe == r_framecount || s->cached_dlight || lighthalf != s->cached_lighthalf) // dynamic this frame or previously, or lighthalf changed R_UpdateLightmap(s, s->lightmaptexturenum); else @@ -974,7 +974,7 @@ e->angles[0] = -e->angles[0]; // stupid quake bug R_UpdateLightmap(s, s->lightmaptexturenum); break; } -// } + } if (currentwallpoly < MAX_WALLPOLYS && (currentwallvert + s->polys->numverts) <= MAX_WALLVERTS) { wallpoly[currentwallpoly].texnum = (unsigned short) t->gl_texturenum; diff --git a/gl_screen.c b/gl_screen.c index 2a0bfa53..717a04fd 100644 --- a/gl_screen.c +++ b/gl_screen.c @@ -88,7 +88,6 @@ cvar_t scr_showram = {"showram","1"}; cvar_t scr_showturtle = {"showturtle","0"}; cvar_t scr_showpause = {"showpause","1"}; cvar_t scr_printspeed = {"scr_printspeed","8"}; -cvar_t gl_triplebuffer = {"gl_triplebuffer", "1", true }; cvar_t showfps = {"showfps", "0", true}; extern cvar_t crosshair; @@ -108,8 +107,6 @@ extern int sb_lines; extern viddef_t vid; // global video state -vrect_t scr_vrect; - qboolean scr_disabled_for_loading; qboolean scr_drawloading; float scr_disabled_time; @@ -340,8 +337,6 @@ static void SCR_CalcRefdef (void) r_refdef.fov_x = scr_fov.value; r_refdef.fov_y = CalcFov (r_refdef.fov_x, r_refdef.vrect.width, r_refdef.vrect.height); - - scr_vrect = r_refdef.vrect; } @@ -390,7 +385,6 @@ void SCR_Init (void) Cvar_RegisterVariable (&scr_showpause); Cvar_RegisterVariable (&scr_centertime); Cvar_RegisterVariable (&scr_printspeed); - Cvar_RegisterVariable (&gl_triplebuffer); Cvar_RegisterVariable (&showfps); // @@ -422,7 +416,7 @@ void SCR_DrawRam (void) if (!r_cache_thrash) return; - Draw_Pic (scr_vrect.x+32, scr_vrect.y, scr_ram); + Draw_Pic (32, 0, scr_ram); } /* @@ -447,7 +441,7 @@ void SCR_DrawTurtle (void) if (count < 3) return; - Draw_Pic (scr_vrect.x, scr_vrect.y, scr_turtle); + Draw_Pic (0, 0, scr_turtle); } /* @@ -462,7 +456,7 @@ void SCR_DrawNet (void) if (cls.demoplayback) return; - Draw_Pic (scr_vrect.x+64, scr_vrect.y, scr_net); + Draw_Pic (64, 0, scr_net); } /* @@ -547,18 +541,6 @@ void SCR_SetUpToDrawConsole (void) if (scr_conlines < scr_con_current) scr_con_current = scr_conlines; } - - /* - if (clearconsole++ < vid.numpages) - { - Sbar_Changed (); - } - else if (clearnotify++ < vid.numpages) - { - } - else - con_notifylines = 0; - */ } /* @@ -879,8 +861,6 @@ void SCR_UpdateScreen (void) if (!gl_arrays) gl_vertexarrays.value = 0; - vid.numpages = 2 + gl_triplebuffer.value; - scr_copytop = 0; scr_copyeverything = 0; @@ -955,7 +935,7 @@ void SCR_UpdateScreen (void) else { if (crosshair.value) - Draw_Character (scr_vrect.x + scr_vrect.width/2, scr_vrect.y + scr_vrect.height/2, '+'); + Draw_Character (r_refdef.vrect.x + r_refdef.vrect.width/2, r_refdef.vrect.y + r_refdef.vrect.height/2, '+'); SCR_DrawRam (); SCR_DrawNet (); diff --git a/glquake.h b/glquake.h index 8bb15400..4852986b 100644 --- a/glquake.h +++ b/glquake.h @@ -102,7 +102,7 @@ typedef struct // LordHavoc: added dust, smoke, snow, bloodcloud, and many others typedef enum { - pt_static, pt_grav, pt_slowgrav, pt_fire, pt_explode, pt_explode2, pt_blob, pt_blob2, pt_dust, pt_smoke, pt_snow, pt_bulletpuff, pt_bloodcloud, pt_fadespark, pt_fadespark2, pt_fallfadespark, pt_fallfadespark2, pt_bubble + pt_static, pt_grav, pt_slowgrav, pt_fire, pt_explode, pt_explode2, pt_blob, pt_blob2, pt_dust, pt_smoke, pt_snow, pt_bulletpuff, pt_bloodcloud, pt_fadespark, pt_fadespark2, pt_fallfadespark, pt_fallfadespark2, pt_bubble, pt_fade } ptype_t; // !!! if this is changed, it must be changed in d_ifacea.h too !!! @@ -120,7 +120,6 @@ typedef struct particle_s // LordHavoc: added for improved particle effects float scale; short texnum; - short contents; // if non-zero, particles will die outside of this content type float alpha; // 0-255 float time2; // used for various things (snow fluttering, for example) vec3_t vel2; // used for snow fluttering (base velocity, wind for instance) @@ -172,9 +171,9 @@ extern cvar_t r_speeds; //extern cvar_t r_waterwarp; extern cvar_t r_fullbright; //extern cvar_t r_lightmap; -//extern cvar_t r_shadows; +extern cvar_t r_shadows; extern cvar_t r_wateralpha; -//extern cvar_t r_dynamic; +extern cvar_t r_dynamic; extern cvar_t r_novis; extern cvar_t r_waterripple; diff --git a/host.c b/host.c index a1fc8a57..72457eee 100644 --- a/host.c +++ b/host.c @@ -51,7 +51,7 @@ client_t *host_client; // current client jmp_buf host_abortserver; byte *host_basepal; -byte *host_colormap; +//byte *host_colormap; cvar_t host_framerate = {"host_framerate","0"}; // set for slow motion cvar_t host_speeds = {"host_speeds","0"}; // set for running times @@ -901,9 +901,9 @@ void Host_Init (quakeparms_t *parms) host_basepal = (byte *)COM_LoadHunkFile ("gfx/palette.lmp", false); if (!host_basepal) Sys_Error ("Couldn't load gfx/palette.lmp"); - host_colormap = (byte *)COM_LoadHunkFile ("gfx/colormap.lmp", false); - if (!host_colormap) - Sys_Error ("Couldn't load gfx/colormap.lmp"); +// host_colormap = (byte *)COM_LoadHunkFile ("gfx/colormap.lmp", false); +// if (!host_colormap) +// Sys_Error ("Couldn't load gfx/colormap.lmp"); #ifndef _WIN32 // on non win32, mouse comes before video for security reasons IN_Init (); diff --git a/r_light.c b/r_light.c index ab541e66..2246670c 100644 --- a/r_light.c +++ b/r_light.c @@ -178,8 +178,8 @@ void R_PushDlights (void) r_dlightframecount = r_framecount + 1; // because the count hasn't advanced yet for this frame -// if (gl_flashblend.value || !r_dynamic.value) -// return; + if (/*gl_flashblend.value ||*/ !r_dynamic.value) + return; l = cl_dlights; @@ -314,7 +314,7 @@ void R_DynamicLightPoint(vec3_t color, vec3_t org, int *dlightbits) vec3_t dist; float brightness, r, f; - if (/*gl_flashblend.value || !r_dynamic.value || */(!dlightbits[0] && !dlightbits[1] && !dlightbits[2] && !dlightbits[3] && !dlightbits[4] && !dlightbits[5] && !dlightbits[6] && !dlightbits[7])) + if (/*gl_flashblend.value ||*/ !r_dynamic.value || (!dlightbits[0] && !dlightbits[1] && !dlightbits[2] && !dlightbits[3] && !dlightbits[4] && !dlightbits[5] && !dlightbits[6] && !dlightbits[7])) return; for (i=0 ; inext = active_particles; active_particles = p; - p->contents = 0; p->texnum = flareparticletexture; p->scale = 2; p->alpha = 255; @@ -412,7 +411,6 @@ void R_ReadPointFile_f (void) p->next = active_particles; active_particles = p; - p->contents = 0; p->texnum = particletexture; p->scale = 2; p->alpha = 255; @@ -460,14 +458,13 @@ R_ParticleExplosion =============== */ -/* void R_ParticleExplosion (vec3_t org, int smoke) { int i, j; particle_t *p; if (!r_particles.value) return; // LordHavoc: particles are optional - for (i=0 ; i<2048 ; i++) + for (i=0 ; i<1024 ; i++) { if (!free_particles) return; @@ -476,13 +473,12 @@ void R_ParticleExplosion (vec3_t org, int smoke) p->next = active_particles; active_particles = p; - p->contents = 0; - p->texnum = flareparticletexture; - p->scale = lhrandom(2,5); + p->texnum = smokeparticletexture[rand()&7]; + p->scale = lhrandom(1,3); p->alpha = rand()&255; p->die = cl.time + 5; p->color = ramp1[0]; - p->ramp = rand()&3; + p->ramp = lhrandom(0, 4); // if (i & 1) // p->type = pt_explode; // else @@ -492,9 +488,9 @@ void R_ParticleExplosion (vec3_t org, int smoke) for (j=0 ; j<3 ; j++) { p->org[j] = org[j] + ((rand()&15)-8); - p->vel[j] = (rand()&511)-256; + p->vel[j] = lhrandom(-192, 192); } - p->vel[j] += 200; + p->vel[2] += 160; } if (smoke) @@ -508,7 +504,6 @@ void R_ParticleExplosion (vec3_t org, int smoke) p->next = active_particles; active_particles = p; - p->contents = 0; p->texnum = smokeparticletexture[rand()&7]; p->scale = 12; p->alpha = 80; @@ -523,7 +518,6 @@ void R_ParticleExplosion (vec3_t org, int smoke) } } } -*/ /* =============== @@ -531,7 +525,6 @@ R_ParticleExplosion2 =============== */ -/* void R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength) { int i, j; @@ -548,9 +541,8 @@ void R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength) p->next = active_particles; active_particles = p; - p->contents = 0; - p->texnum = flareparticletexture; - p->scale = 4; + p->texnum = smokeparticletexture[rand()&7]; + p->scale = 1.5; p->alpha = 255; p->die = cl.time + 0.3; p->color = colorStart + (colorMod % colorLength); @@ -560,11 +552,10 @@ void R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength) for (j=0 ; j<3 ; j++) { p->org[j] = org[j] + ((rand()&15)-8); - p->vel[j] = (rand()%512)-256; + p->vel[j] = lhrandom(-128, 128); } } } -*/ /* =============== @@ -572,7 +563,6 @@ R_BlobExplosion =============== */ -/* void R_BlobExplosion (vec3_t org) { int i, j; @@ -588,9 +578,8 @@ void R_BlobExplosion (vec3_t org) p->next = active_particles; active_particles = p; - p->contents = 0; - p->texnum = flareparticletexture; - p->scale = 4; + p->texnum = smokeparticletexture[rand()&7]; + p->scale = 2; p->alpha = 255; p->die = cl.time + 1 + (rand()&8)*0.05; @@ -601,7 +590,7 @@ void R_BlobExplosion (vec3_t org) for (j=0 ; j<3 ; j++) { p->org[j] = org[j] + ((rand()%32)-16); - p->vel[j] = (rand()%512)-256; + p->vel[j] = lhrandom(-128, 128); } } else @@ -611,12 +600,13 @@ void R_BlobExplosion (vec3_t org) for (j=0 ; j<3 ; j++) { p->org[j] = org[j] + ((rand()%32)-16); - p->vel[j] = (rand()%512)-256; + p->vel[j] = lhrandom(-128, 128); } } + p->vel[0] *= 0.25; + p->vel[1] *= 0.25; } } -*/ /* =============== @@ -626,11 +616,16 @@ R_RunParticleEffect */ void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count) { - int i, j; + int j; particle_t *p; if (!r_particles.value) return; // LordHavoc: particles are optional - for (i=0 ; inext; p->next = active_particles; active_particles = p; - - p->contents = 0; - if (count == 1024) - { // rocket explosion - p->texnum = flareparticletexture; - p->scale = 4; - p->alpha = 255; - p->die = cl.time + 5; - p->color = ramp1[0]; - p->ramp = rand()&3; - if (i & 1) - { - p->type = pt_explode; - for (j=0 ; j<3 ; j++) - { - p->org[j] = org[j] + ((rand()%32)-16); - p->vel[j] = (rand()%512)-256; - } - } - else - { - p->type = pt_explode2; - for (j=0 ; j<3 ; j++) - { - p->org[j] = org[j] + ((rand()%32)-16); - p->vel[j] = (rand()%512)-256; - } - } + if (count & 3) + { + p->alpha = (count & 3) * 16 + (rand()&15); + count &= ~3; } else { - p->texnum = flareparticletexture; - p->scale = 4; - p->alpha = 255; - p->die = cl.time + 0.1*(rand()%5); - p->color = (color&~7) + (rand()&7); - p->type = pt_static; //slowgrav; - for (j=0 ; j<3 ; j++) - { - p->org[j] = org[j] + ((rand()&15)-8); - p->vel[j] = dir[j]*15;// + (rand()%300)-150; - } + p->alpha = 64; + count -= 4; + } + + p->texnum = particletexture; + p->scale = 6; + p->die = cl.time + 1; //lhrandom(0.1, 0.5); + p->color = (color&~7) + (rand()&7); + p->type = pt_fade; //static; //slowgrav; + for (j=0 ; j<3 ; j++) + { + p->org[j] = org[j] + ((rand()&15)-8); + p->vel[j] = dir[j]*15;// + (rand()%300)-150; } } } @@ -703,7 +676,6 @@ void R_SparkShower (vec3_t org, vec3_t dir, int count, int type) free_particles = p->next; p->next = active_particles; active_particles = p; - p->contents = 0; if (type == 0) // sparks { p->texnum = smokeparticletexture[rand()&7]; @@ -717,7 +689,7 @@ void R_SparkShower (vec3_t org, vec3_t dir, int count, int type) } else // blood { - p->texnum = bloodcloudparticletexture; + p->texnum = smokeparticletexture[rand()&7]; p->scale = 12; p->alpha = 128; p->color = (rand()&3)+68; @@ -736,7 +708,6 @@ void R_SparkShower (vec3_t org, vec3_t dir, int count, int type) p->next = active_particles; active_particles = p; - p->contents = 0; p->texnum = flareparticletexture; p->scale = 2; p->alpha = 255; @@ -795,7 +766,6 @@ void R_BloodShower (vec3_t mins, vec3_t maxs, float velspeed, int count) p->next = active_particles; active_particles = p; - p->contents = 0; p->texnum = bloodcloudparticletexture; p->scale = 12; p->alpha = 96 + (rand()&63); @@ -833,7 +803,6 @@ void R_ParticleCube (vec3_t mins, vec3_t maxs, vec3_t dir, int count, int colorb p->next = active_particles; active_particles = p; - p->contents = 0; p->texnum = flareparticletexture; p->scale = 6; p->alpha = 255; @@ -898,7 +867,6 @@ void R_ParticleRain (vec3_t mins, vec3_t maxs, vec3_t dir, int count, int colorb org[1] = diff[1] * (float) (rand()&1023) * (1.0 / 1024.0) + mins[1]; org[2] = z; - p->contents = 0; p->scale = 1.5; p->alpha = 255; p->die = t; @@ -945,7 +913,6 @@ void R_LavaSplash (vec3_t org) p->next = active_particles; active_particles = p; - p->contents = 0; p->texnum = flareparticletexture; p->scale = 10; p->alpha = 128; @@ -1025,7 +992,6 @@ void R_TeleportSplash (vec3_t org) p->next = active_particles; active_particles = p; - p->contents = 0; p->texnum = flareparticletexture; p->scale = 4; p->alpha = lhrandom(32,256); @@ -1082,7 +1048,6 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent) p->next = active_particles; active_particles = p; - p->contents = 0; p->vel[0] = p->vel[1] = p->vel[2] = 0; p->die = cl.time + 2; @@ -1093,7 +1058,6 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent) if (bubbles) { dec = 0.005f; - p->contents = contents; p->texnum = bubbleparticletexture; p->scale = lhrandom(1,2); p->alpha = 255; @@ -1136,9 +1100,9 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent) */ case 2: // blood - dec = 0.03f; - p->texnum = bloodcloudparticletexture; - p->scale = lhrandom(8, 12); + dec = 0.025f; + p->texnum = smokeparticletexture[rand()&7]; + p->scale = lhrandom(6, 8); p->alpha = 255; p->color = (rand()&3)+68; p->type = pt_bloodcloud; @@ -1179,10 +1143,10 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent) break; case 4: // slight blood - dec = 0.03f; // sparse trail - p->texnum = bloodcloudparticletexture; - p->scale = lhrandom(8,12); - p->alpha = 255; + dec = 0.025f; // sparse trail + p->texnum = smokeparticletexture[rand()&7]; + p->scale = lhrandom(6, 8); + p->alpha = 192; p->color = (rand()&3)+68; p->type = pt_fadespark2; p->die = cl.time + 2; @@ -1195,8 +1159,8 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent) case 6: // voor trail dec = 0.05f; // sparse trail - p->texnum = flareparticletexture; - p->scale = lhrandom(4, 8); + p->texnum = smokeparticletexture[rand()&7]; + p->scale = lhrandom(3, 5); p->alpha = 255; p->color = 9*16 + 8 + (rand()&3); p->type = pt_fadespark2; @@ -1250,7 +1214,6 @@ void R_RocketTrail2 (vec3_t start, vec3_t end, int color, entity_t *ent) VectorCopy (vec3_origin, p->vel); - p->contents = 0; p->texnum = flareparticletexture; p->scale = 8; p->alpha = 192; @@ -1333,12 +1296,6 @@ void R_DrawParticles (void) if (!p) break; - a = Mod_PointInLeaf(p->org, cl.worldmodel)->contents; - if (a == CONTENTS_SOLID || (p->contents && p->contents != a)) - { - p->die = -1; - continue; - } VectorSubtract(p->org, r_refdef.vieworg, v); if (DotProduct(v, v) >= 256.0f) { @@ -1409,8 +1366,9 @@ void R_DrawParticles (void) p->color = ramp2[(int)p->ramp]; // p->vel[2] -= grav1; // LordHavoc: apply full gravity to explosion sparks for (i=0 ; i<3 ; i++) - p->vel[i] -= p->vel[i]*frametime; -// p->vel[2] -= grav; +// p->vel[i] -= p->vel[i]*frametime; + p->vel[i] *= dvel; +//// p->vel[2] -= grav; break; case pt_blob: @@ -1466,8 +1424,8 @@ void R_DrawParticles (void) p->die = -1; break; case pt_bloodcloud: - p->scale -= frametime * 24; - p->alpha -= frametime * 128; + p->scale += frametime * 4; + p->alpha -= frametime * 64; p->vel[2] -= grav; if (p->alpha < 1 || p->scale < 1) p->die = -1; @@ -1496,7 +1454,14 @@ void R_DrawParticles (void) if (p->alpha < 1) p->die = -1; break; + case pt_fade: + p->alpha -= frametime * 512; + if (p->alpha < 1) + p->die = -1; + break; case pt_bubble: + if (Mod_PointInLeaf(p->org, cl.worldmodel)->contents == CONTENTS_EMPTY) + p->die = -1; p->vel[2] += grav1 * 2; if (p->vel[2] >= 200) p->vel[2] = lhrandom(130, 200); diff --git a/render.h b/render.h index 78289b5e..5f5d224a 100644 --- a/render.h +++ b/render.h @@ -68,7 +68,8 @@ typedef struct entity_s struct efrag_s *efrag; // linked list of efrags int frame; float syncbase; // for client-side animations - byte *colormap; +// byte *colormap; + int colormap; int effects; // light, particals, etc int skinnum; // for Alias models int visframe; // last frame this entity was diff --git a/sbar.c b/sbar.c index 9fe505a2..66c1af20 100644 --- a/sbar.c +++ b/sbar.c @@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" -//int sb_updates; // if >= vid.numpages, no update needed - #define STAT_MINUS 10 // num frame for '-' stats digit qpic_t *sb_nums[2][11]; qpic_t *sb_colon, *sb_slash; @@ -928,10 +926,6 @@ void Sbar_Draw (void) if (scr_con_current == vid.height) return; // console is full screen - // LordHavoc: always redraw - //if (sb_updates >= vid.numpages) - // return; - scr_copyeverything = 1; // sb_updates++; @@ -1127,7 +1121,7 @@ void Sbar_DeathmatchOverlay (void) fph = total ? (int) ((float) s->frags * 3600.0 / total) : 0; if (fph < -999) fph = -999; if (fph > 9999) fph = 9999; - + // put it together sprintf (num, "%c %4i:%4i %3i:%i%i %s", k == cl.viewentity - 1 ? 12 : ' ', (int) s->frags, fph, minutes, tens, units, s->name); Draw_String(x - 8, y, num, 0); diff --git a/sbar.h b/sbar.h index 286b3b6a..9e881c84 100644 --- a/sbar.h +++ b/sbar.h @@ -18,9 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// the status bar is only redrawn if something has changed, but if anything -// does, the entire thing will be redrawn for the next vid.numpages frames. - #define SBAR_HEIGHT 24 extern int sb_lines; // scan lines to draw diff --git a/vid.h b/vid.h index 56be2668..1ba61753 100644 --- a/vid.h +++ b/vid.h @@ -33,22 +33,12 @@ typedef struct vrect_s typedef struct { - pixel_t *buffer; // invisible buffer - pixel_t *colormap; // 256 * VID_GRADES size - unsigned short *colormap16; // 256 * VID_GRADES size - int fullbright; // index of first fullbright color unsigned width; unsigned height; float aspect; // width / height -- < 0 is taller than wide - int numpages; int recalc_refdef; // if true, recalc vid-based stuff - pixel_t *conbuffer; unsigned conwidth; unsigned conheight; - int maxwarpwidth; - int maxwarpheight; - pixel_t *direct; // direct drawing to framebuffer, if not - // NULL } viddef_t; extern viddef_t vid; // global video state diff --git a/vid_glx.c b/vid_glx.c index 14f9c268..99ec8842 100644 --- a/vid_glx.c +++ b/vid_glx.c @@ -735,11 +735,6 @@ void VID_Init(unsigned char *palette) Cvar_RegisterVariable (&in_dgamouse); Cvar_RegisterVariable (&m_filter); - vid.maxwarpwidth = WARP_WIDTH; - vid.maxwarpheight = WARP_HEIGHT; - vid.colormap = host_colormap; - vid.fullbright = 256 - LittleLong (*((int *)vid.colormap + 2048)); - // interpret command-line params // set vid parameters @@ -877,7 +872,6 @@ void VID_Init(unsigned char *palette) vid.height = vid.conheight; vid.aspect = ((float)vid.height / (float)vid.width) * (320.0 / 240.0); - vid.numpages = 2; InitSig(); // trap evil signals diff --git a/vid_wgl.c b/vid_wgl.c index 298d4ade..5767ca2b 100644 --- a/vid_wgl.c +++ b/vid_wgl.c @@ -237,8 +237,6 @@ qboolean VID_SetWindowedMode (int modenum) vid.width = vid.conwidth; vid.height = vid.conheight; - vid.numpages = 2; - mainwindow = dibwindow; SendMessage (mainwindow, WM_SETICON, (WPARAM)TRUE, (LPARAM)hIcon); @@ -329,8 +327,6 @@ qboolean VID_SetFullDIBMode (int modenum) vid.width = vid.conwidth; vid.height = vid.conheight; - vid.numpages = 2; - // needed because we're not getting WM_MOVE messages fullscreen on NT window_x = 0; window_y = 0; @@ -1650,11 +1646,6 @@ void VID_Init (unsigned char *palette) if (vid.conheight < 200) vid.conheight = 200; - vid.maxwarpwidth = WARP_WIDTH; - vid.maxwarpheight = WARP_HEIGHT; - vid.colormap = host_colormap; - vid.fullbright = 256 - LittleLong (*((int *)vid.colormap + 2048)); - DestroyWindow (hwnd_dialog); VID_SetPalette (palette); diff --git a/view.c b/view.c index 7f357216..7d907cd2 100644 --- a/view.c +++ b/view.c @@ -792,7 +792,7 @@ void V_CalcRefdef (void) view->model = cl.model_precache[cl.stats[STAT_WEAPON]]; view->frame = cl.stats[STAT_WEAPONFRAME]; - view->colormap = vid.colormap; + view->colormap = 0; //vid.colormap; // set up the refresh position VectorAdd (r_refdef.viewangles, cl.punchangle, r_refdef.viewangles); @@ -830,8 +830,6 @@ The player's clipping box goes from (-16 -16 -24) to (16 16 32) from the entity origin, so any view position inside that will be valid ================== */ -extern vrect_t scr_vrect; - void V_RenderView (void) { if (con_forcedup) -- 2.39.2