From 0648f384bbdebfabc26c07a270fc30c894834787 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 27 Mar 2024 18:13:39 +0100 Subject: [PATCH] kill some stuff that did nothing --- src/d_clisrv.c | 3 +- src/d_netcmd.c | 2 - src/dehacked.c | 10 ++- src/hardware/hw_main.c | 41 +++++------- src/hardware/hw_md2.c | 10 +-- src/m_anigif.c | 137 +++++------------------------------------ src/m_anigif.h | 2 +- src/m_misc.c | 2 +- src/r_fps.c | 20 ------ src/r_fps.h | 1 - src/tables.c | 5 +- src/v_video.c | 8 +-- src/v_video.h | 2 +- src/z_zone.c | 11 ++-- src/z_zone.h | 3 +- 15 files changed, 58 insertions(+), 199 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 379691b44..2b52216b9 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1933,6 +1933,7 @@ static void CL_LoadReceivedSavegame(void) } else { + CONS_Alert(CONS_ERROR, M_GetText("Can't load the level!\n")); Z_Free(savebuffer); save_p = NULL; if (unlink(tmpsave) == -1) @@ -3944,7 +3945,7 @@ static void Command_list_http_logins (void) } #endif/*HAVE_CURL*/ -static CV_PossibleValue_t netticbuffer_cons_t[] = {{0, "MIN"}, {1, "1"}, {2, "2"}, {3, "MAX"}, {0, NULL}}; +static CV_PossibleValue_t netticbuffer_cons_t[] = {{0, "MIN"}, {3, "MAX"}, {0, NULL}}; consvar_t cv_netticbuffer = {"netticbuffer", "1", CV_SAVE, netticbuffer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static void Joinable_OnChange(void); diff --git a/src/d_netcmd.c b/src/d_netcmd.c index accaeaf27..4de32845e 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -896,8 +896,6 @@ void D_RegisterClientCommands(void) // GIF variables CV_RegisterVar(&cv_gif_optimize); CV_RegisterVar(&cv_gif_downscale); - CV_RegisterVar(&cv_gif_dynamicdelay); - CV_RegisterVar(&cv_gif_localcolortable); #ifdef WALLSPLATS CV_RegisterVar(&cv_splats); diff --git a/src/dehacked.c b/src/dehacked.c index 63e240a06..8c1ba8e4d 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1716,13 +1716,13 @@ static void readframe(MYFILE *f, INT32 num) { size_t z; boolean found = false; - size_t actionlen = strlen(word2) + 1; - char *actiontocompare = calloc(actionlen, 1); + char actiontocompare[32]; - strcpy(actiontocompare, word2); + memset(actiontocompare, 0x00, sizeof(actiontocompare)); + strlcpy(actiontocompare, word2, sizeof (actiontocompare)); strupr(actiontocompare); - for (z = 0; z < actionlen; z++) + for (z = 0; z < 32; z++) { if (actiontocompare[z] == '\n' || actiontocompare[z] == '\r') { @@ -1758,8 +1758,6 @@ static void readframe(MYFILE *f, INT32 num) if (!found) deh_warning("Unknown action %s", actiontocompare); - - free(actiontocompare); } else deh_warning("Frame %d: unknown word '%s'", num, word1); diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index c21435d3f..4bf22955c 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2481,8 +2481,7 @@ static boolean CheckClip(sector_t * afrontsector, sector_t * abacksector) } // using this check with portals causes weird culling issues on ante-station - //if (!portalclipline && (afrontsector == viewsector || abacksector == viewsector)) - if (afrontsector == viewsector || abacksector == viewsector) + if (!portalclipline && (afrontsector == viewsector || abacksector == viewsector)) { fixed_t viewf1, viewf2, viewc1, viewc2; if (afrontsector == viewsector) @@ -2516,9 +2515,9 @@ static boolean CheckClip(sector_t * afrontsector, sector_t * abacksector) if (backc1 <= frontf1 && backc2 <= frontf2) { checkforemptylines = false; - //if (portalclipline)// during portal rendering view position may cause undesired culling and the above code has some wrong side effects - //return false; - //else + if (portalclipline)// during portal rendering view position may cause undesired culling and the above code has some wrong side effects + return false; + else return true; } @@ -2736,9 +2735,9 @@ static boolean HWR_CheckBBox(const fixed_t *bspcoord) if (viewy >= bspcoord[BOXTOP]) boxpos |= 0; else if (viewy > bspcoord[BOXBOTTOM]) - boxpos |= 4; + boxpos |= 1<<2; else - boxpos |= 8; + boxpos |= 2<<2; if (boxpos == 5) return true; @@ -3253,8 +3252,10 @@ static void HWR_Subsector(size_t num) { HWR_GetFlat(levelflats[gr_frontsector->floorpic].lumpnum, R_NoEncore(gr_frontsector, false)); HWR_RenderPlane(sub, &extrasubsectors[num], false, - locFloorHeight == cullFloorHeight ? locFloorHeight : gr_frontsector->floorheight, - PF_Occlude, floorlightlevel, levelflats[gr_frontsector->floorpic].lumpnum, NULL, 255, floorcolormap); + // Hack to make things continue to work around slopes. + locFloorHeight == cullFloorHeight ? locFloorHeight : gr_frontsector->floorheight, + // We now return you to your regularly scheduled rendering. + PF_Occlude, floorlightlevel, levelflats[gr_frontsector->floorpic].lumpnum, NULL, 255, floorcolormap); } } } @@ -4407,28 +4408,18 @@ static int CompareVisSprites(const void *p1, const void *p2) gr_vissprite_t* spr2 = *(gr_vissprite_t*const*)p2; int idiff; float fdiff; - float tz1, tz2; - - int transparency1; - int transparency2; // make transparent sprites last // "boolean to int" - // check for precip first, because then sprX->mobj is actually a precipmobj_t and does not have flags2 or tracer - tz1 = spr1->tz; - transparency1 = (!spr1->precip && (spr1->mobj->flags2 & MF2_SHADOW)) || (spr1->mobj->frame & FF_TRANSMASK); - tz2 = spr2->tz; - transparency2 = (!spr2->precip && (spr2->mobj->flags2 & MF2_SHADOW)) || (spr2->mobj->frame & FF_TRANSMASK); - - // first compare transparency flags, then compare tz, then compare dispoffset - + int transparency1 = (spr1->mobj->flags2 & MF2_SHADOW) || (spr1->mobj->frame & FF_TRANSMASK); + int transparency2 = (spr2->mobj->flags2 & MF2_SHADOW) || (spr2->mobj->frame & FF_TRANSMASK); idiff = transparency1 - transparency2; if (idiff != 0) return idiff; - fdiff = tz2 - tz1; // this order seems correct when checking with apitrace. Back to front. + fdiff = spr2->tz - spr1->tz;// this order seems correct when checking with apitrace. Back to front. if (fabsf(fdiff) < 1.0E-36f) - return spr1->dispoffset - spr2->dispoffset; // smallest dispoffset first if sprites are at (almost) same location. + return spr1->dispoffset - spr2->dispoffset;// smallest dispoffset first if sprites are at (almost) same location. else if (fdiff > 0) return 1; else @@ -5028,8 +5019,8 @@ void HWR_ProjectSprite(mobj_t *thing) I_Error("sprframes NULL for sprite %d\n", thing->sprite); #endif - ang = R_PointToAngle(interp.x, interp.y) - interp.angle; - camang = R_PointToAngle(interp.x, interp.y); + ang = R_PointToAngle (interp.x, interp.y) - interp.angle; + camang = R_PointToAngle (interp.x, interp.y); if (mirrored) ang = InvAngle(ang); diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 08ecebeb9..79ca9bf92 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -243,7 +243,7 @@ static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_ { png_uint_32 i, pitch = png_get_rowbytes(png_ptr, png_info_ptr); - png_bytep PNG_image = Z_Malloc(pitch*height, PU_HWRMODELTEXTURE, &grpatch->mipmap->data); + png_bytep PNG_image = Z_Malloc(pitch*height, PU_HWRCACHE, &grpatch->mipmap->data); png_bytepp row_pointers = png_malloc(png_ptr, height * sizeof (png_bytep)); for (i = 0; i < height; i++) row_pointers[i] = PNG_image + i*pitch; @@ -323,7 +323,7 @@ static GLTextureFormat_t PCX_Load(const char *filename, int *w, int *h, pw = *w = header.xmax - header.xmin + 1; ph = *h = header.ymax - header.ymin + 1; - image = Z_Malloc(pw*ph*4, PU_HWRMODELTEXTURE, &grpatch->mipmap->data); + image = Z_Malloc(pw*ph*4, PU_HWRCACHE, &grpatch->mipmap->data); if (fread(palette, sizeof (UINT8), PALSIZE, file) != PALSIZE) { @@ -712,7 +712,7 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, grmip->data = NULL; } - cur = Z_Malloc(size*4, PU_HWRMODELTEXTURE, &grmip->data); + cur = Z_Malloc(size*4, PU_HWRCACHE, &grmip->data); memset(cur, 0x00, size*4); image = gpatch->mipmap->data; @@ -1062,7 +1062,7 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT if (grmip->downloaded && grmip->data) { HWD.pfnSetTexture(grmip); // found the colormap, set it to the correct texture - Z_ChangeTag(grmip->data, PU_HWRMODELTEXTURE_UNLOCKED); + Z_ChangeTag(grmip->data, PU_HWRCACHE_UNLOCKED); return; } } @@ -1084,7 +1084,7 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT HWR_CreateBlendedTexture(gpatch, blendgpatch, newmip, skinnum, color); HWD.pfnSetTexture(newmip); - Z_ChangeTag(newmip->data, PU_HWRMODELTEXTURE_UNLOCKED); + Z_ChangeTag(newmip->data, PU_HWRCACHE_UNLOCKED); } diff --git a/src/m_anigif.c b/src/m_anigif.c index 94535a0b3..44b5a96c0 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -18,9 +18,6 @@ #include "z_zone.h" #include "v_video.h" #include "i_video.h" -#include "i_system.h" // I_GetPreciseTime -#include "doomstat.h" // singletics -#include "st_stuff.h" // st_palette #ifdef HWRENDER #include "hardware/hw_main.h" @@ -29,31 +26,15 @@ // GIFs are always little-endian #include "byteptr.h" -CV_PossibleValue_t gif_dynamicdelay_cons_t[] = { - {0, "Off"}, - {1, "On"}, - {2, "Accurate, experimental"}, -{0, NULL}}; - consvar_t cv_gif_optimize = {"gif_optimize", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_gif_downscale = {"gif_downscale", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_gif_dynamicdelay = {"gif_dynamicdelay", "On", CV_SAVE, gif_dynamicdelay_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_gif_localcolortable = {"gif_localcolortable", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; #ifdef HAVE_ANIGIF static boolean gif_optimize = false; // So nobody can do something dumb static boolean gif_downscale = false; // like changing cvars mid output -static UINT8 gif_dynamicdelay = (UINT8)0; // and messing something up - -// Palette handling -static boolean gif_localcolortable = false; -static RGBA_t *gif_headerpalette = NULL; -static RGBA_t *gif_framepalette = NULL; static FILE *gif_out = NULL; static INT32 gif_frames = 0; -static precise_t gif_prevframetime = 0; -static UINT32 gif_delayus = 0; // "us" is microseconds static UINT8 gif_writeover = 0; @@ -408,47 +389,18 @@ const UINT8 gifhead_base[6] = {0x47,0x49,0x46,0x38,0x39,0x61}; // GIF89a const UINT8 gifhead_nsid[19] = {0x21,0xFF,0x0B, // extension block + size 0x4E,0x45,0x54,0x53,0x43,0x41,0x50,0x45,0x32,0x2E,0x30, // NETSCAPE2.0 0x03,0x01,0xFF,0xFF,0x00}; // sub-block, repetitions - -// -// GIF_getpalette -// determine the palette for the current frame. -// -static RGBA_t *GIF_getpalette(size_t palnum) -{ - // In hardware mode, always returns the local palette -#ifdef HWRENDER - if (rendermode == render_opengl && !HWR_ShouldUsePaletteRendering()) - return pLocalPalette; - else -#endif - return (&pLocalPalette[palnum*256]); -} - -// -// GIF_palwrite -// writes the gif palette. -// used both for the header and local color tables. -// -static UINT8 *GIF_palwrite(UINT8 *p, RGBA_t *pal) -{ - INT32 i; - for (i = 0; i < 256; i++) - { - WRITEUINT8(p, pal[i].s.red); - WRITEUINT8(p, pal[i].s.green); - WRITEUINT8(p, pal[i].s.blue); - } - return p; -} // // GIF_headwrite // writes the gif header to the currently open output file. +// NOTE that this code does not accomodate for palette changes. // static void GIF_headwrite(void) { UINT8 *gifhead = Z_Malloc(800, PU_STATIC, NULL); UINT8 *p = gifhead; + RGBA_t *c; + INT32 i; UINT16 rwidth, rheight; if (!gif_out) @@ -469,17 +421,22 @@ static void GIF_headwrite(void) rwidth = vid.width; rheight = vid.height; } - WRITEUINT16(p, rwidth); WRITEUINT16(p, rheight); // colors, aspect, etc - WRITEUINT8(p, 0xF7); // (0xF7 = 1111 0111) + WRITEUINT8(p, 0xF7); WRITEUINT8(p, 0x00); WRITEUINT8(p, 0x00); // write color table - p = GIF_palwrite(p, gif_headerpalette); + for (i = 0; i < 256; ++i) + { + c = &pLocalPalette[i]; + WRITEUINT8(p, c->s.red); + WRITEUINT8(p, c->s.green); + WRITEUINT8(p, c->s.blue); + } // write extension block WRITEMEM(p, gifhead_nsid, sizeof(gifhead_nsid)); @@ -510,7 +467,7 @@ static void GIF_rgbconvert(UINT8 *linear, UINT8 *scr) size_t src, dest; int x, y; - InitColorLUT(gif_framepalette); + InitColorLUT(); for (x = 0; x < vid.width; x += scrbuf_downscaleamt) { @@ -537,7 +494,6 @@ static void GIF_framewrite(void) UINT8 *p; UINT8 *movie_screen = screens[2]; INT32 blitx, blity, blitw, blith; - boolean palchanged; if (!gifframe_data) gifframe_data = Z_Malloc(gifframe_size, PU_STATIC, NULL); @@ -545,19 +501,9 @@ static void GIF_framewrite(void) if (!gif_out) return; - - // Lactozilla: Compare the header's palette with the current frame's palette and see if it changed. - if (gif_localcolortable) - { - gif_framepalette = GIF_getpalette(max(st_palette, 0)); - palchanged = memcmp(gif_headerpalette, gif_framepalette, sizeof(RGBA_t) * 256); - } - else - palchanged = false; // Compare image data (for optimizing GIF) - // If the palette has changed, the entire frame is considered to be different. - if (gif_optimize && gif_frames > 0 && (!palchanged)) + if (gif_optimize && gif_frames > 0) { // before blit movie_screen points to last frame, cur_screen points to this frame UINT8 *cur_screen = screens[0]; @@ -601,39 +547,11 @@ static void GIF_framewrite(void) // screen regions are handled in GIF_lzw { - UINT16 delay = 0; + int d1 = (int)((100.0f/NEWTICRATE)*(gif_frames+1)); + int d2 = (int)((100.0f/NEWTICRATE)*(gif_frames)); + UINT16 delay = d1-d2; INT32 startline; - if (gif_dynamicdelay ==(UINT8) 2 && !singletics) - { - // golden's attempt at creating a "dynamic delay" - UINT16 mingifdelay = 10; // minimum gif delay in milliseconds (keep at 10 because gifs can't get more precise). - gif_delayus += (I_GetPreciseTime() - gif_prevframetime) / (I_GetPrecisePrecision() / 1000000); // increase delay by how much time was spent between last measurement - - if (gif_delayus/1000 >= mingifdelay) // delay is big enough to be able to effect gif frame delay? - { - int frames = (gif_delayus/1000) / mingifdelay; // get amount of frames to delay. - delay = frames; // set the delay to delay that amount of frames. - gif_delayus -= frames*(mingifdelay*1000); // remove frames by the amount of milliseconds they take. don't reset to 0, the microseconds help consistency. - } - } - else if (gif_dynamicdelay ==(UINT8) 1 && !singletics) - { - float delayf = ceil(100.0f/NEWTICRATE); - - delay = (UINT16)((I_GetPreciseTime() - gif_prevframetime)) / (I_GetPrecisePrecision() / 1000000) /10/1000; - - if (delay < (UINT16)(delayf)) - delay = (UINT16)(delayf); - } - else - { - // the original code - int d1 = (int)((100.0f/NEWTICRATE)*(gif_frames+1)); - int d2 = (int)((100.0f/NEWTICRATE)*(gif_frames)); - delay = d1-d2; - } - WRITEMEM(p, gifframe_gchead, 4); WRITEUINT16(p, delay); @@ -654,20 +572,7 @@ static void GIF_framewrite(void) WRITEUINT16(p, (UINT16)(blity / scrbuf_downscaleamt)); WRITEUINT16(p, (UINT16)(blitw / scrbuf_downscaleamt)); WRITEUINT16(p, (UINT16)(blith / scrbuf_downscaleamt)); - - if (!gif_localcolortable) - WRITEUINT8(p, 0); // no local table of colors - else - { - if (palchanged) - { - // The palettes are different, so write the Local Color Table! - WRITEUINT8(p, 0x87); // (0x87 = 1000 0111) - p = GIF_palwrite(p, gif_framepalette); - } - else - WRITEUINT8(p, 0); // They are equal, no Local Color Table needed. - } + WRITEUINT8(p, 0); // no local table of colors scrbuf_pos = movie_screen + blitx + (blity * vid.width); scrbuf_writeend = scrbuf_pos + (blitw - 1) + ((blith - 1) * vid.width); @@ -711,7 +616,6 @@ static void GIF_framewrite(void) } fwrite(gifframe_data, 1, (p - gifframe_data), gif_out); ++gif_frames; - gif_prevframetime = I_GetPreciseTime(); } @@ -732,15 +636,8 @@ INT32 GIF_open(const char *filename) gif_optimize = (!!cv_gif_optimize.value); gif_downscale = (!!cv_gif_downscale.value); - gif_dynamicdelay = (UINT8)cv_gif_dynamicdelay.value; - - gif_localcolortable = (!!cv_gif_localcolortable.value); - gif_headerpalette = GIF_getpalette(0); - GIF_headwrite(); gif_frames = 0; - gif_prevframetime = I_GetPreciseTime(); - gif_delayus = 0; return 1; } diff --git a/src/m_anigif.h b/src/m_anigif.h index 7d89ae86a..6d94ecf8c 100644 --- a/src/m_anigif.h +++ b/src/m_anigif.h @@ -27,6 +27,6 @@ void GIF_frame(void); INT32 GIF_close(void); #endif -extern consvar_t cv_gif_optimize, cv_gif_downscale, cv_gif_dynamicdelay, cv_gif_localcolortable; +extern consvar_t cv_gif_optimize, cv_gif_downscale; #endif diff --git a/src/m_misc.c b/src/m_misc.c index 82dae378c..4ba93b983 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -1142,7 +1142,7 @@ void M_SaveFrame(void) // paranoia: should be unnecessary without singletics static tic_t oldtic = 0; - if (oldtic == I_GetTime() && !singletics) + if (oldtic == I_GetTime()) return; else oldtic = I_GetTime(); diff --git a/src/r_fps.c b/src/r_fps.c index 3c67da9fb..44518ea4d 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -514,7 +514,6 @@ void R_CreateInterpolator_Polyobj(thinker_t *thinker, polyobj_t *polyobj) interp->polyobj.oldcx = interp->polyobj.bakcx = polyobj->centerPt.x; interp->polyobj.oldcy = interp->polyobj.bakcy = polyobj->centerPt.y; - interp->polyobj.oldangle = interp->polyobj.bakangle = polyobj->angle; } /*void R_CreateInterpolator_DynSlope(thinker_t *thinker, pslope_t *slope) @@ -538,15 +537,6 @@ void R_InitializeLevelInterpolators(void) levelinterpolators = NULL; } -static void RecalculatePolyobjectSegAngles(polyobj_t *polyobj) -{ - for (size_t i = 0; i < polyobj->segCount; i++) - { - seg_t *seg = polyobj->segs[i]; - seg->angle = R_PointToAngle2(seg->v1->x, seg->v1->y, seg->v2->x, seg->v2->y); - } -} - static void UpdateLevelInterpolatorState(levelinterpolator_t *interp) { size_t i; @@ -577,13 +567,10 @@ static void UpdateLevelInterpolatorState(levelinterpolator_t *interp) interp->polyobj.bakvertices[i * 2 ] = interp->polyobj.polyobj->vertices[i]->x; interp->polyobj.bakvertices[i * 2 + 1] = interp->polyobj.polyobj->vertices[i]->y; } - RecalculatePolyobjectSegAngles(interp->polyobj.polyobj); interp->polyobj.oldcx = interp->polyobj.bakcx; interp->polyobj.oldcy = interp->polyobj.bakcy; - interp->polyobj.oldangle = interp->polyobj.bakangle; interp->polyobj.bakcx = interp->polyobj.polyobj->centerPt.x; interp->polyobj.bakcy = interp->polyobj.polyobj->centerPt.y; - interp->polyobj.bakangle = interp->polyobj.polyobj->angle; break; /*case LVLINTERP_DynSlope: FV3_Copy(&interp->dynslope.oldo, &interp->dynslope.bako); @@ -703,7 +690,6 @@ void R_ApplyLevelInterpolators(fixed_t frac) else interp->polyobj.polyobj->vertices[ii]->y = R_LerpFixed(interp->polyobj.oldvertices[ii * 2 + 1], interp->polyobj.bakvertices[ii * 2 + 1], frac); } - RecalculatePolyobjectSegAngles(interp->polyobj.polyobj); if (interp->polyobj.polyobj->centerPt.x == interp->polyobj.oldcx) interp->polyobj.polyobj->centerPt.x = interp->polyobj.bakcx; else @@ -714,10 +700,6 @@ void R_ApplyLevelInterpolators(fixed_t frac) else interp->polyobj.polyobj->centerPt.y = R_LerpFixed(interp->polyobj.oldcy, interp->polyobj.bakcy, frac); - if (interp->polyobj.polyobj->angle == interp->polyobj.oldangle) - interp->polyobj.polyobj->angle = interp->polyobj.oldangle; - else - interp->polyobj.polyobj->angle = R_LerpAngle(interp->polyobj.oldangle, interp->polyobj.bakangle, frac); break; /*case LVLINTERP_DynSlope: R_LerpVector3(&interp->dynslope.oldo, &interp->dynslope.bako, frac, &interp->dynslope.slope->o); @@ -771,10 +753,8 @@ void R_RestoreLevelInterpolators(void) interp->polyobj.polyobj->vertices[ii]->x = interp->polyobj.bakvertices[ii * 2 ]; interp->polyobj.polyobj->vertices[ii]->y = interp->polyobj.bakvertices[ii * 2 + 1]; } - RecalculatePolyobjectSegAngles(interp->polyobj.polyobj); interp->polyobj.polyobj->centerPt.x = interp->polyobj.bakcx; interp->polyobj.polyobj->centerPt.y = interp->polyobj.bakcy; - interp->polyobj.polyobj->angle = interp->polyobj.bakangle; break; /*case LVLINTERP_DynSlope: FV3_Copy(&interp->dynslope.slope->o, &interp->dynslope.bako); diff --git a/src/r_fps.h b/src/r_fps.h index c5d0e27f7..14b7b2157 100644 --- a/src/r_fps.h +++ b/src/r_fps.h @@ -107,7 +107,6 @@ typedef struct levelinterpolator_s { fixed_t *bakvertices; size_t vertices_size; fixed_t oldcx, oldcy, bakcx, bakcy; - angle_t oldangle, bakangle; } polyobj; struct { pslope_t *slope; diff --git a/src/tables.c b/src/tables.c index 41520b4dc..71b74636c 100644 --- a/src/tables.c +++ b/src/tables.c @@ -3,7 +3,6 @@ // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1999-2018 by Sonic Team Junior. -// Copyright (C) 2009 by Stephen McGranahan. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -407,7 +406,6 @@ void FV3_Rotate(vector3_t *rotVec, const vector3_t *axisVec, const angle_t angle rotVec->z = az+dz+ez; } - void FM_Rotate(matrix_t *dest, angle_t angle, fixed_t x, fixed_t y, fixed_t z) { #define M(row,col) dest->m[row * 4 + col] @@ -460,6 +458,5 @@ void FM_Rotate(matrix_t *dest, angle_t angle, fixed_t x, fixed_t y, fixed_t z) M(1, 3) = 0; M(2, 3) = 0; M(3, 3) = FRACUNIT; - #undef M +#undef M } - diff --git a/src/v_video.c b/src/v_video.c index 887401dde..180424934 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -3202,19 +3202,19 @@ Unoptimized version UINT8 colorlookup[CLUTSIZE][CLUTSIZE][CLUTSIZE]; -void InitColorLUT(RGBA_t *palette) +void InitColorLUT(void) { UINT8 r, g, b; static boolean clutinit = false; static RGBA_t *lastpalette = NULL; - if ((!clutinit) || (lastpalette != palette)) + if ((!clutinit) || (lastpalette != pLocalPalette)) { for (r = 0; r < CLUTSIZE; r++) for (g = 0; g < CLUTSIZE; g++) for (b = 0; b < CLUTSIZE; b++) - colorlookup[r][g][b] = NearestPaletteColor(r << SHIFTCOLORBITS, g << SHIFTCOLORBITS, b << SHIFTCOLORBITS, palette); + colorlookup[r][g][b] = NearestColor(r << SHIFTCOLORBITS, g << SHIFTCOLORBITS, b << SHIFTCOLORBITS); clutinit = true; - lastpalette = palette; + lastpalette = pLocalPalette; } } diff --git a/src/v_video.h b/src/v_video.h index 8f4801166..77f628efb 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -47,7 +47,7 @@ void V_Init(void); extern UINT8 colorlookup[CLUTSIZE][CLUTSIZE][CLUTSIZE]; -void InitColorLUT(RGBA_t *palette); +void InitColorLUT(void); // Set the current RGB palette lookup to use for palettized graphics void V_SetPalette(INT32 palettenum); diff --git a/src/z_zone.c b/src/z_zone.c index 8d702ad80..b0223460b 100644 --- a/src/z_zone.c +++ b/src/z_zone.c @@ -653,23 +653,22 @@ static void Command_Memfree_f(void) CONS_Printf("\x82%s", M_GetText("Memory Info\n")); CONS_Printf(M_GetText("Total heap used : %7s KB\n"), sizeu1(Z_TagsUsage(0, INT32_MAX)>>10)); CONS_Printf(M_GetText("Static : %7s KB\n"), sizeu1(Z_TagUsage(PU_STATIC)>>10)); + CONS_Printf(M_GetText("Lua : %7s KB\n"), sizeu1(Z_TagUsage(PU_LUA)>>10)); CONS_Printf(M_GetText("Static (sound) : %7s KB\n"), sizeu1(Z_TagUsage(PU_SOUND)>>10)); CONS_Printf(M_GetText("Static (music) : %7s KB\n"), sizeu1(Z_TagUsage(PU_MUSIC)>>10)); CONS_Printf(M_GetText("Locked cache : %7s KB\n"), sizeu1(Z_TagUsage(PU_CACHE)>>10)); CONS_Printf(M_GetText("Level : %7s KB\n"), sizeu1(Z_TagUsage(PU_LEVEL)>>10)); CONS_Printf(M_GetText("Special thinker : %7s KB\n"), sizeu1(Z_TagUsage(PU_LEVSPEC)>>10)); - CONS_Printf(M_GetText("Lua : %7s KB\n"), sizeu1(Z_TagUsage(PU_LUA)>>10)); CONS_Printf(M_GetText("All purgable : %7s KB\n"), sizeu1(Z_TagsUsage(PU_PURGELEVEL, INT32_MAX)>>10)); #ifdef HWRENDER if (rendermode != render_soft && rendermode != render_none) { - CONS_Printf(M_GetText("Patch info headers : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRPATCHINFO)>>10)); - CONS_Printf(M_GetText("Cached textures : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRCACHE)>>10)); - CONS_Printf(M_GetText("Texture colormaps : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRPATCHCOLMIPMAP)>>10)); - CONS_Printf(M_GetText("Model textures : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRMODELTEXTURE)>>10)); - CONS_Printf(M_GetText("Plane polygons : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRPLANE)>>10)); + CONS_Printf(M_GetText("Patch info headers: %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRPATCHINFO)>>10)); + CONS_Printf(M_GetText("Mipmap patches : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRPATCHCOLMIPMAP)>>10)); + CONS_Printf(M_GetText("HW Texture cache : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRCACHE)>>10)); + CONS_Printf(M_GetText("Plane polygons : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRPLANE)>>10)); CONS_Printf(M_GetText("All GPU textures : %7d KB\n"), HWR_GetTextureUsed()>>10); } #endif diff --git a/src/z_zone.h b/src/z_zone.h index f5c830ed5..91743cfae 100644 --- a/src/z_zone.h +++ b/src/z_zone.h @@ -48,7 +48,6 @@ enum PU_HWRPATCHINFO = 21, // Hardware GLPatch_t struct for OpenGL texture cache PU_HWRPATCHCOLMIPMAP = 22, // Hardware GLMipmap_t struct colormap variation of patch - PU_HWRMODELTEXTURE = 23, // Hardware model texture PU_HWRCACHE = 48, // static until unlocked PU_CACHE = 49, // static until unlocked @@ -64,7 +63,7 @@ enum PU_HWRCACHE_UNLOCKED = 102, // 'unlocked' PU_HWRCACHE memory: // 'second-level' cache for graphics // stored in hardware format and downloaded as needed - PU_HWRMODELTEXTURE_UNLOCKED = 104, // 'unlocked' PU_HWRMODELTEXTURE memory + PU_HWRPATCHINFO_UNLOCKED = 103, // 'unlocked' PU_HWRMODELTEXTURE memory }; //