//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: MapOverview.cpp: implementation of the CMapOverview class. // // $NoKeywords: $ //=============================================================================// #include "cbase.h" #include "mapoverview.h" #include #include #include #include #include #include "mathlib/mathlib.h" #include #include #include "gamevars_shared.h" #include "spectatorgui.h" #include "c_playerresource.h" #include "view.h" #include "clientmode.h" #include // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" ConVar overview_health( "overview_health", "1", FCVAR_ARCHIVE | FCVAR_CLIENTCMD_CAN_EXECUTE, "Show player's health in map overview.\n" ); ConVar overview_names ( "overview_names", "1", FCVAR_ARCHIVE | FCVAR_CLIENTCMD_CAN_EXECUTE, "Show player's names in map overview.\n" ); ConVar overview_tracks( "overview_tracks", "1", FCVAR_ARCHIVE | FCVAR_CLIENTCMD_CAN_EXECUTE, "Show player's tracks in map overview.\n" ); ConVar overview_locked( "overview_locked", "1", FCVAR_ARCHIVE | FCVAR_CLIENTCMD_CAN_EXECUTE, "Locks map angle, doesn't follow view angle.\n" ); ConVar overview_alpha( "overview_alpha", "1.0", FCVAR_ARCHIVE | FCVAR_CLIENTCMD_CAN_EXECUTE, "Overview map translucency.\n" ); static IMapOverviewPanel *g_pMapOverview[ MAX_SPLITSCREEN_PLAYERS ]; void SetMapOverView( int nSlot, IMapOverviewPanel *pPanel ) { g_pMapOverview[ nSlot ] = pPanel; } IMapOverviewPanel *GetMapOverView() { ASSERT_LOCAL_PLAYER_RESOLVABLE(); return g_pMapOverview[ GET_ACTIVE_SPLITSCREEN_SLOT() ]; } static int AdjustValue( int curValue, int targetValue, int amount ) { if ( curValue > targetValue ) { curValue -= amount; if ( curValue < targetValue ) curValue = targetValue; } else if ( curValue < targetValue ) { curValue += amount; if ( curValue > targetValue ) curValue = targetValue; } return curValue; } CON_COMMAND( overview_zoom, "Sets overview map zoom: [