diff --git a/cvarinfo.base b/cvarinfo.base index f6adb1ed9..8495eba5a 100644 --- a/cvarinfo.base +++ b/cvarinfo.base @@ -86,6 +86,7 @@ server bool swwm_bonkhammer = false; // combat hammer makes bonk sounds when hi server int swwm_friendlyfire = 0; // 0: allow all friendly fire, 1: block incoming damage, 2: block incoming and outgoing damage nosave bool swwm_showmaptitle = false; // shows the name of the map when entering, just like in dark souls! server bool swwm_lobdoubled = false; // [LOB] Enable Double Death monster spawns +nosave noarchive bool swwm_debugchair = false; // debug aid for precise crosshairs (temporarily available until a critical bug is fixed) // minimap settings nosave bool swwm_mm_enable = true; // show a minimap below the score counter diff --git a/language.def_menu b/language.def_menu index 21f6cba19..655ed4953 100644 --- a/language.def_menu +++ b/language.def_menu @@ -207,6 +207,7 @@ SWWM_DBG_FIXITEMCAPS = "Recalculate Item Caps"; SWWM_DBG_UPDATESHADOWS = "Update Simple Shadows"; SWWM_DBG_UPDATEGLOWS = "Update Item Glows"; SWWM_DBG_UPDATEHITBOXES = "Update Extended Hitboxes"; +SWWM_DBG_DEBUGCHAIR = "Debug Crosshair Info"; TOOLTIP_SWWM_VOICETYPE = "Sets the voice pack for the player."; TOOLTIP_SWWM_MUTEVOICE = "Control what gets muted, if you'd rather have a more silent protagonist."; TOOLTIP_SWWM_FLASHSTRENGTH = "Screen flashes usually happen when firing some weapons, you can lower this if these effects are harmful for you."; @@ -297,6 +298,7 @@ TOOLTIP_NETEVENT_SWWMFIXITEMCAPS = "Recomputes carried item capacities. Only nee TOOLTIP_NETEVENT_SWWMUPDATESHADOWS = "Adds/Removes simple shadows at runtime, without the need to restart the map. Unclear if it causes issues."; TOOLTIP_NETEVENT_SWWMUPDATEGLOWS = "Adds/Removes item glows at runtime, without the need to restart the map. Unclear if it causes issues."; TOOLTIP_NETEVENT_SWWMUPDATEHITBOXES = "Removes extended item hitboxes at runtime. Due to implementation quirks, they can't be added without a map restart."; +TOOLTIP_SWWM_DEBUGCHAIR = "Prints out debug information about active precise crosshairs."; // main menu poses (do not localize) SWWM_NMENUPOSE = "24"; SWWM_MENUPOSE1 = "graphics/M_DEMOCHAN_DEEPIMPACT.png"; diff --git a/language.es_menu b/language.es_menu index 362da7d09..26869eca2 100644 --- a/language.es_menu +++ b/language.es_menu @@ -204,6 +204,7 @@ SWWM_DBG_FIXITEMCAPS = "Recalcular Capacidades de Ítem"; SWWM_DBG_UPDATESHADOWS = "Actualizar Sombras Simples"; SWWM_DBG_UPDATEGLOWS = "Actualizar Brillos de Ítem"; SWWM_DBG_UPDATEHITBOXES = "Actualizar Hitboxes Extendidas"; +SWWM_DBG_DEBUGCHAIR = "Información de Depurado de Miras"; TOOLTIP_SWWM_VOICETYPE = "Selecciona el pack de voz para el jugador."; TOOLTIP_SWWM_MUTEVOICE = "Controla lo que se mutea, si prefieres tener un protagonista más silencioso."; TOOLTIP_SWWM_FLASHSTRENGTH = "Los destellos en pantalla suelen ocurrir al disparar algunas armas, puedes reducirlo si este tipo de efectos te causan malestar."; @@ -295,6 +296,7 @@ TOOLTIP_NETEVENT_SWWMFIXITEMCAPS = "Recomputa las capacidades de los ítems en e TOOLTIP_NETEVENT_SWWMUPDATESHADOWS = "Añade/Quita sombras simples en tiempo real, sin necesidad de reiniciar el mapa. No está claro si puede causar problemas."; TOOLTIP_NETEVENT_SWWMUPDATEGLOWS = "Añade/Quite brillos de ítem en tiempo real, sin necesidad de reiniciar el mapa. No está claro si puede causar problemas."; TOOLTIP_NETEVENT_SWWMUPDATEHITBOXES = "Quita hitboxes extendidas de ítem en tiempo real. Dados los detalles de implementación, no pueden añadirse sin reiniciar el mapa."; +TOOLTIP_SWWM_DEBUGCHAIR = "Muestra en pantalla información de depurado sobre miras precisas activas."; // credits SWWM_MCREDS = "Créditos de DEMOLITIONIST"; SWWM_CLEAD = "Desarrollo Principal:"; diff --git a/language.version b/language.version index 6d70528f5..75b468cf1 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r509 \cu(Sun 25 Sep 18:21:27 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r509 \cu(2022-09-25 18:21:27)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r510 \cu(Mon 26 Sep 11:12:33 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r510 \cu(2022-09-26 11:12:33)\c-"; diff --git a/menudef.txt b/menudef.txt index 94ac89701..351b683c9 100644 --- a/menudef.txt +++ b/menudef.txt @@ -233,6 +233,7 @@ OptionMenu "SWWMDebugMenu" StaticText " " Option "$SWWM_DBG_DEBUGBLAST", "swwm_debugblast", "YesNo" Option "$SWWM_DBG_DEBUGVIEW", "swwm_debugview", "YesNo" + Option "$SWWM_DBG_DEBUGCHAIR", "swwm_debugchair", "YesNo" StaticText " " SafeCommand "$SWWM_DBG_FIXITEMCAPS", "netevent swwmfixitemcaps" SafeCommand "$SWWM_DBG_UPDATESHADOWS", "netevent swwmupdateshadows" diff --git a/zscript/handler/swwm_handler_crosshair.zsc b/zscript/handler/swwm_handler_crosshair.zsc index 3e92b6be0..29e9bd986 100644 --- a/zscript/handler/swwm_handler_crosshair.zsc +++ b/zscript/handler/swwm_handler_crosshair.zsc @@ -34,6 +34,7 @@ extend Class SWWMHandler transient ui Vector3 lagtndc[MAX_CROSSHAIRS]; // "lagged" NDC for crosshairs transient ui bool tactive[MAX_CROSSHAIRS]; // denotes that the crosshair is "active" for drawing transient ui double prevframe; // previous frame timestamp + ui Font TinyFont; private ui void TraceCrosshairs( RenderEvent e ) { @@ -126,24 +127,53 @@ extend Class SWWMHandler if ( crosshairgrow ) sz *= StatusBar.CrosshairSize; SWWMUtility.PrepareProjData(tprojdata,e.ViewPos,e.ViewAngle,e.ViewPitch,e.ViewRoll,players[consoleplayer].fov); Vector2 actpos[MAX_CROSSHAIRS]; + if ( !TinyFont ) TinyFont = Font.GetFont('TewiFontOutline'); + int fh = TinyFont.GetHeight(); + bool debug = swwm_debugchair; + int nact = 0; + for ( int i=0; i= 1. ) continue; Vector2 vpos = SWWMUtility.NDCToViewport(tprojdata,ndc); + if ( debug && tactive[i] ) Screen.DrawText(TinyFont,fc,xpos,ypos,String.Format("VPOS: (%g,%g)",vpos.x,vpos.y)); + ypos += fh; if ( !prevframe ) lagtndc[i] = ndc; + if ( debug && tactive[i] ) Screen.DrawText(TinyFont,fc,xpos,ypos,String.Format("LAGTNDC: (%g,%g,%g)",lagtndc[i].x,lagtndc[i].y,lagtndc[i].z)); + ypos += fh; if ( lagtndc[i].z >= 1. ) continue; Vector2 oldvpos = SWWMUtility.NDCToViewport(tprojdata,lagtndc[i]); + if ( debug && tactive[i] ) Screen.DrawText(TinyFont,fc,xpos,ypos,String.Format("OLDVPOS: (%g,%g)",oldvpos.x,oldvpos.y)); + ypos += fh; lagtndc[i] = SWWMUtility.LerpVector3(lagtndc[i],ndc,theta); + if ( debug && tactive[i] ) Screen.DrawText(TinyFont,fc,xpos,ypos,String.Format("LAGTNDC: (%g,%g,%g)",lagtndc[i].x,lagtndc[i].y,lagtndc[i].z)); + ypos += fh; if ( lagtndc[i].z >= 1. ) continue; Vector2 lagvpos = SWWMUtility.NDCToViewport(tprojdata,lagtndc[i]); + if ( debug && tactive[i] ) Screen.DrawText(TinyFont,fc,xpos,ypos,String.Format("LAGVPOS: (%g,%g)",lagvpos.x,lagvpos.y)); + ypos += fh; if ( !tactive[i] ) continue; // draw int streak = int(max(abs(oldvpos.x-lagvpos.x),abs(oldvpos.y-lagvpos.y))); + if ( debug && tactive[i] ) Screen.DrawText(TinyFont,fc,xpos,ypos,String.Format("STREAK: %d",streak)); + ypos += fh; double alph = 1.; if ( i < numcrosshairs ) actpos[i] = lagvpos; else @@ -155,6 +185,8 @@ extend Class SWWMHandler tactive[i] = false; alph = clamp(dist/max(2,streak+2),0.,1.); // this should make the merge less jarring } + if ( debug && tactive[i] ) Screen.DrawText(TinyFont,fc,xpos,ypos,String.Format("ALPH: %g",alph)); + ypos += fh; for ( int i=0; i