Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/game/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,7 @@ target_sources_grouped(

set(UNITY_SOURCE_NEO_SHARED
${CMAKE_SOURCE_DIR}/game/shared/neo/achievements_neo.cpp
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_debugoverlay_budget.cpp
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_gamerules.cpp
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_ghost_cap_point.cpp
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_juggernaut.cpp
Expand Down Expand Up @@ -1755,6 +1756,7 @@ target_sources_grouped(
FILES
${CMAKE_SOURCE_DIR}/game/shared/neo/achievements_neo.h
${CMAKE_SOURCE_DIR}/game/shared/neo/nav_shared.h
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_debugoverlay_budget.h
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_gamerules.h
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_ghost_cap_point.h
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_juggernaut.h
Expand Down
8 changes: 8 additions & 0 deletions src/game/client/cdll_client_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
#include <vgui_controls/Button.h>
#include <vgui_controls/MenuButton.h>
#include "neo_mp3player.h"
#include "neo/neo_debugoverlay_budget.h"
#endif

extern vgui::IInputInternal *g_InputInternal;
Expand Down Expand Up @@ -991,8 +992,15 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi
return false;
if ( (render = (IVRenderView *)appSystemFactory( VENGINE_RENDERVIEW_INTERFACE_VERSION, NULL )) == NULL )
return false;
#ifdef NEO
// Route every debug overlay through the budgeting proxy (neo/neo_debugoverlay_budget.*)
// so a runaway per-tick visualiser such as nb_debug can't exhaust the renderer.
if ( (debugoverlay = NEO_InstallDebugOverlayBudget( (IVDebugOverlay *)appSystemFactory( VDEBUG_OVERLAY_INTERFACE_VERSION, NULL ) )) == NULL )
return false;
#else
if ( (debugoverlay = (IVDebugOverlay *)appSystemFactory( VDEBUG_OVERLAY_INTERFACE_VERSION, NULL )) == NULL )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My pitch for this approach is that we only need to wrap debugoverlay at a few initialization sites, and we can handle custom changes in the new proxy class.

return false;
#endif
if ( (datacache = (IDataCache*)appSystemFactory(DATACACHE_INTERFACE_VERSION, NULL )) == NULL )
return false;
if ( !mdlcache )
Expand Down
2 changes: 2 additions & 0 deletions src/game/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,7 @@ target_sources_grouped(

set(UNITY_SOURCE_NEO_SHARED
${CMAKE_SOURCE_DIR}/game/shared/neo/achievements_neo.cpp
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_debugoverlay_budget.cpp
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_gamerules.cpp
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_ghost_cap_point.cpp
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_juggernaut.cpp
Expand Down Expand Up @@ -1472,6 +1473,7 @@ target_sources_grouped(
FILES
${CMAKE_SOURCE_DIR}/game/shared/neo/achievements_neo.h
${CMAKE_SOURCE_DIR}/game/shared/neo/nav_shared.h
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_debugoverlay_budget.h
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_gamerules.h
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_ghost_cap_point.h
${CMAKE_SOURCE_DIR}/game/shared/neo/neo_juggernaut.h
Expand Down
7 changes: 7 additions & 0 deletions src/game/server/gameinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ extern ConVar tf_mm_servermode;
#include "neo_version.h"
#include "neo_player_shared.h"
#include "bot/neo_bot_profile.h"
#include "neo/neo_debugoverlay_budget.h"
#endif

extern IToolFrameworkServer *g_pToolFrameworkServer;
Expand Down Expand Up @@ -752,7 +753,13 @@ bool CServerGameDLL::DLLInit( CreateInterfaceFn appSystemFactory,
InvalidateQueryCache();

// try to get debug overlay, may be NULL if on HLDS
#ifdef NEO
// Route every debug overlay through the budgeting proxy (neo/neo_debugoverlay_budget.*)
// so a runaway per-tick visualiser such as nb_debug path can't exhaust the renderer.
debugoverlay = NEO_InstallDebugOverlayBudget( (IVDebugOverlay *)appSystemFactory( VDEBUG_OVERLAY_INTERFACE_VERSION, NULL ) );
#else
debugoverlay = (IVDebugOverlay *)appSystemFactory( VDEBUG_OVERLAY_INTERFACE_VERSION, NULL );
#endif

#ifndef _XBOX
#ifdef USE_NAV_MESH
Expand Down
Loading