From 18fb7fdd81358bbf4b6942e84979b55290d1cd88 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 1 Feb 2019 00:14:31 +0100 Subject: [PATCH] - moved some diagnostic CCMDs to g_dumpinfo.cpp. --- src/g_cvars.cpp | 20 ++++++++++++++- src/g_dumpinfo.cpp | 57 ++++++++++++++++++++++++++++++++++++++++++ src/p_3dfloors.cpp | 33 ------------------------ src/p_destructible.cpp | 1 - src/p_effect.cpp | 21 +--------------- src/portal.cpp | 28 --------------------- src/skins.h | 4 --- src/tagitem.h | 0 8 files changed, 77 insertions(+), 87 deletions(-) delete mode 100644 src/skins.h delete mode 100644 src/tagitem.h diff --git a/src/g_cvars.cpp b/src/g_cvars.cpp index 3fc48ff860..67d18179fa 100644 --- a/src/g_cvars.cpp +++ b/src/g_cvars.cpp @@ -35,6 +35,7 @@ #include "c_cvars.h" #include "g_levellocals.h" +#include "g_game.h" CVAR (Bool, cl_spreaddecals, true, CVAR_ARCHIVE) CVAR(Bool, var_pushers, true, CVAR_SERVERINFO); @@ -88,6 +89,23 @@ CUSTOM_CVAR (Int, cl_maxdecals, 1024, CVAR_ARCHIVE) } +// [BC] Allow the maximum number of particles to be specified by a cvar (so people +// with lots of nice hardware can have lots of particles!). +CUSTOM_CVAR(Int, r_maxparticles, 4000, CVAR_ARCHIVE) +{ + if (self == 0) + self = 4000; + else if (self > 65535) + self = 65535; + else if (self < 100) + self = 100; - + if (gamestate != GS_STARTUP) + { + for (auto Level : AllLevels()) + { + P_InitParticles(Level); + } + } +} diff --git a/src/g_dumpinfo.cpp b/src/g_dumpinfo.cpp index 84a296d27f..9501b452f7 100644 --- a/src/g_dumpinfo.cpp +++ b/src/g_dumpinfo.cpp @@ -40,6 +40,7 @@ #include "d_net.h" #include "p_setup.h" #include "w_wad.h" +#include "v_text.h" //========================================================================== // @@ -250,3 +251,59 @@ CCMD(dumptags) +CCMD(dump3df) +{ + if (argv.argc() > 1) + { + // Print 3D floor info for a single sector. + // This only checks the primary level. + int sec = (int)strtoll(argv[1], NULL, 10); + if ((unsigned)sec >= currentUILevel->sectors.Size()) + { + Printf("Sector %d does not exist.\n", sec); + return; + } + sector_t *sector = ¤tUILevel->sectors[sec]; + TArray & ffloors = sector->e->XFloor.ffloors; + + for (unsigned int i = 0; i < ffloors.Size(); i++) + { + double height = ffloors[i]->top.plane->ZatPoint(sector->centerspot); + double bheight = ffloors[i]->bottom.plane->ZatPoint(sector->centerspot); + + IGNORE_FORMAT_PRE + Printf("FFloor %d @ top = %f (model = %d), bottom = %f (model = %d), flags = %B, alpha = %d %s %s\n", + i, height, ffloors[i]->top.model->sectornum, + bheight, ffloors[i]->bottom.model->sectornum, + ffloors[i]->flags, ffloors[i]->alpha, (ffloors[i]->flags&FF_EXISTS) ? "Exists" : "", (ffloors[i]->flags&FF_DYNAMIC) ? "Dynamic" : ""); + IGNORE_FORMAT_POST + } + } +} + +//============================================================================ +// +// print the group link table to the console +// +//============================================================================ + +CCMD(dumplinktable) +{ + for (auto Level : AllLevels()) + { + Printf("Portal displacements for %s:\n", Level->MapName.GetChars()); + for (int x = 1; x < Level->Displacements.size; x++) + { + for (int y = 1; y < Level->Displacements.size; y++) + { + FDisplacement &disp = Level->Displacements(x, y); + Printf("%c%c(%6d, %6d)", TEXTCOLOR_ESCAPE, 'C' + disp.indirect, int(disp.pos.X), int(disp.pos.Y)); + } + Printf("\n"); + } + } +} + + + + diff --git a/src/p_3dfloors.cpp b/src/p_3dfloors.cpp index d132da69fc..1d3e2d4c50 100644 --- a/src/p_3dfloors.cpp +++ b/src/p_3dfloors.cpp @@ -46,7 +46,6 @@ #include "p_spec.h" #include "g_levellocals.h" #include "actorinlines.h" -#include "maploader/maploader.h" //========================================================================== // @@ -859,35 +858,3 @@ int P_Find3DFloor(sector_t * sec, const DVector3 &pos, bool above, bool floor, d return -1; } -#include "c_dispatch.h" - - -CCMD (dump3df) -{ - if (argv.argc() > 1) - { - // Print 3D floor info for a single sector. - // This only checks the primary level. - int sec = (int)strtoll(argv[1], NULL, 10); - if ((unsigned)sec >= currentUILevel->sectors.Size()) - { - Printf("Sector %d does not exist.\n", sec); - return; - } - sector_t *sector = ¤tUILevel->sectors[sec]; - TArray & ffloors=sector->e->XFloor.ffloors; - - for (unsigned int i = 0; i < ffloors.Size(); i++) - { - double height=ffloors[i]->top.plane->ZatPoint(sector->centerspot); - double bheight=ffloors[i]->bottom.plane->ZatPoint(sector->centerspot); - - IGNORE_FORMAT_PRE - Printf("FFloor %d @ top = %f (model = %d), bottom = %f (model = %d), flags = %B, alpha = %d %s %s\n", - i, height, ffloors[i]->top.model->sectornum, - bheight, ffloors[i]->bottom.model->sectornum, - ffloors[i]->flags, ffloors[i]->alpha, (ffloors[i]->flags&FF_EXISTS)? "Exists":"", (ffloors[i]->flags&FF_DYNAMIC)? "Dynamic":""); - IGNORE_FORMAT_POST - } - } -} diff --git a/src/p_destructible.cpp b/src/p_destructible.cpp index 5a9c564482..4794b7ed48 100755 --- a/src/p_destructible.cpp +++ b/src/p_destructible.cpp @@ -37,7 +37,6 @@ #include "actor.h" #include "p_trace.h" #include "p_lnspec.h" -#include "r_sky.h" #include "p_local.h" #include "p_maputl.h" #include "c_cvars.h" diff --git a/src/p_effect.cpp b/src/p_effect.cpp index 073d6d9b89..82c4e40b16 100644 --- a/src/p_effect.cpp +++ b/src/p_effect.cpp @@ -55,6 +55,7 @@ CVAR (Bool, r_rail_smartspiral, 0, CVAR_ARCHIVE); CVAR (Int, r_rail_spiralsparsity, 1, CVAR_ARCHIVE); CVAR (Int, r_rail_trailsparsity, 1, CVAR_ARCHIVE); CVAR (Bool, r_particles, true, 0); +EXTERN_CVAR(Int, r_maxparticles); FRandom pr_railtrail("RailTrail"); @@ -116,26 +117,6 @@ inline particle_t *NewParticle (FLevelLocals *Level) // void P_InitParticles (FLevelLocals *); -// [BC] Allow the maximum number of particles to be specified by a cvar (so people -// with lots of nice hardware can have lots of particles!). -CUSTOM_CVAR( Int, r_maxparticles, 4000, CVAR_ARCHIVE ) -{ - if ( self == 0 ) - self = 4000; - else if (self > 65535) - self = 65535; - else if (self < 100) - self = 100; - - if ( gamestate != GS_STARTUP ) - { - for (auto Level : AllLevels()) - { - P_InitParticles(Level); - } - } -} - void P_InitParticles (FLevelLocals *Level) { const char *i; diff --git a/src/portal.cpp b/src/portal.cpp index 6cca8385d7..5a9c8b3a60 100644 --- a/src/portal.cpp +++ b/src/portal.cpp @@ -1198,31 +1198,3 @@ bool FLevelLocals::CollectConnectedGroups(int startgroup, const DVector3 &positi } return retval; } - - -//============================================================================ -// -// print the group link table to the console -// -//============================================================================ - -CCMD(dumplinktable) -{ - for (auto Level : AllLevels()) - { - Printf("Portal displacements for %s:\n", Level->MapName.GetChars()); - for (int x = 1; x < Level->Displacements.size; x++) - { - for (int y = 1; y < Level->Displacements.size; y++) - { - FDisplacement &disp = Level->Displacements(x, y); - Printf("%c%c(%6d, %6d)", TEXTCOLOR_ESCAPE, 'C' + disp.indirect, int(disp.pos.X), int(disp.pos.Y)); - } - Printf("\n"); - } - } -} - - - - diff --git a/src/skins.h b/src/skins.h deleted file mode 100644 index 8ce1f99cb5..0000000000 --- a/src/skins.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef __SKINS_H__ -#define __SKINS_H__ - -#endif //__SKINS_H__ diff --git a/src/tagitem.h b/src/tagitem.h deleted file mode 100644 index e69de29bb2..0000000000