diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 28ada86a6..52e339cf9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -52,7 +52,6 @@ set(SRB2_CORE_SOURCES set(SRB2_CORE_HEADERS am_map.h - args.h b_bot.h byteptr.h command.h @@ -106,7 +105,6 @@ set(SRB2_CORE_HEADERS m_swap.h md5.h mserv.h - p5prof.h s_sound.h screen.h sounds.h diff --git a/src/d_main.c b/src/d_main.c index 257402ed2..3850243b8 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1641,10 +1641,11 @@ void D_SRB2Main(void) I_StartupSound(); I_InitMusic(); S_InitSfxChannels(cv_soundvolume.value); - S_InitMusicDefs(); - S_InitMTDefs(); } + S_InitMusicDefs(); + S_InitMTDefs(); + CONS_Printf("ST_Init(): Init status bar.\n"); ST_Init(); diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index cfb9fae2c..c2fad85a3 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -960,11 +960,13 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 // -----------------+ // HWR_DrawFill : draw flat coloured rectangle, with no texture // -----------------+ +// alug: now with translucency support X) void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color) { FOutVector v[4]; FSurfaceInfo Surf; float fx, fy, fw, fh; + UINT8 alphalevel = ((color & V_ALPHAMASK) >> V_ALPHASHIFT); if (w < 0 || h < 0) return; // consistency w/ software @@ -1061,8 +1063,16 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color) Surf.PolyColor = V_GetColor(color); - HWD.pfnDrawPolygon(&Surf, v, 4, - PF_Modulated|PF_NoTexture|PF_NoDepthTest, false); + if ((alphalevel) && (!(alphalevel >= 10 && alphalevel < 13))) + { + if (alphalevel == 13) Surf.PolyColor.s.alpha = softwaretranstogl_lo[hudtrans]; + else if (alphalevel == 14) Surf.PolyColor.s.alpha = softwaretranstogl[hudtrans]; + else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[hudtrans]; + else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel]; + HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest, false); + } + else + HWD.pfnDrawPolygon(&Surf, v, 4, PF_Modulated|PF_NoTexture|PF_NoDepthTest, false); } #ifdef HAVE_PNG diff --git a/src/r_plane.c b/src/r_plane.c index 3578bd7b4..590ea32a2 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -29,13 +29,6 @@ #include "p_tick.h" #include "r_fps.h" -#ifdef TIMING -#include "p5prof.h" - INT64 mycount; - INT64 mytotal = 0; - UINT32 nombre = 100000; -#endif - // // opening // @@ -340,19 +333,7 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2) ds_x1 = x1; ds_x2 = x2; - // profile drawer -#ifdef TIMING - ProfZeroTimer(); -#endif - spanfunc(); - -#ifdef TIMING - RDMSR(0x10, &mycount); - mytotal += mycount; // 64bit add - if (!(nombre--)) - I_Error("spanfunc() CPU Spy reports: 0x%d %d\n", *((INT32 *)&mytotal+1), (INT32)mytotal); -#endif } // diff --git a/src/r_segs.c b/src/r_segs.c index 0c4e1d763..4623d3b0e 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1248,19 +1248,6 @@ static boolean R_FFloorCanClip(visffloor_t *pfloor) #define HEIGHTBITS 12 #define HEIGHTUNIT (1<>FRACBITS; - - //profile stuff --------------------------------------------------------- -#ifdef TIMING - ProfZeroTimer(); -#endif colfunc(); -#ifdef TIMING - RDMSR(0x10,&mycount); - mytotal += mycount; //64bit add - - if (nombre--==0) - I_Error("R_DrawColumn CPU Spy reports: 0x%d %d\n", *((INT32 *)&mytotal+1), - (INT32)mytotal); -#endif - //profile stuff --------------------------------------------------------- // dont draw anything more for this column, since // a midtexture blocks the view diff --git a/src/v_video.c b/src/v_video.c index 894037cab..28a02bcff 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -695,10 +695,13 @@ void V_DrawBlock(INT32 x, INT32 y, INT32 scrn, INT32 width, INT32 height, const // // Fills a box of pixels with a single color, NOTE: scaled to screen size // +// alug: now with translucency support X) void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) { UINT8 *dest; const UINT8 *deststop; + INT32 u, v; + UINT32 alphalevel = 0; if (rendermode == render_none) return; @@ -752,6 +755,7 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) if (x >= vid.width || y >= vid.height) return; // off the screen + if (x < 0) { w += x; @@ -765,18 +769,45 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) if (w <= 0 || h <= 0) return; // zero width/height wouldn't draw anything + if (x + w > vid.width) - w = vid.width - x; + w = vid.width-x; if (y + h > vid.height) - h = vid.height - y; + h = vid.height-y; dest = screens[0] + y*vid.width + x; deststop = screens[0] + vid.rowbytes * vid.height; + if ((alphalevel = ((c & V_ALPHAMASK) >> V_ALPHASHIFT))) + { + if (alphalevel == 13) + alphalevel = hudminusalpha[cv_translucenthud.value]; + else if (alphalevel == 14) + alphalevel = 10 - cv_translucenthud.value; + else if (alphalevel == 15) + alphalevel = hudplusalpha[cv_translucenthud.value]; + + if (alphalevel >= 10) + return; // invis + } + c &= 255; - for (;(--h >= 0) && dest < deststop; dest += vid.width) - memset(dest, c, w * vid.bpp); + if (!alphalevel) { + for (;(--h >= 0) && dest < deststop; dest += vid.width) + memset(dest, c, w * vid.bpp); + } else { // holy fuck i hope this doesent break lmao + const UINT8 *fadetable = ((UINT8 *)transtables + ((alphalevel-1)<y) ? y : x + w = clip(w,vid.width); + h = clip(h,vid.height); +#undef clip + for (v = 0; v < h; v++, dest += vid.width) { + for (u = 0; u < w; u++) { + dest[u] = fadetable[dest[u]]; + } + } + } } #ifdef HWRENDER