//========= Copyright 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" ); IMapOverviewPanel *g_pMapOverview = NULL; // we assume only one overview is created 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: [