mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2026-10-12 02:28:00 +08:00
Update from SDK 2013
This commit is contained in:
1 parent
e0e01948b8
commit
ebd971b421
7471 files changed
+2595606
-1256665
No files matched your search
+63
-62
@@ -1,62 +1,63 @@
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#include <stdio.h>
|
||||
#include "basetypes.h"
|
||||
#include "pacifier.h"
|
||||
#include "tier0/dbg.h"
|
||||
|
||||
|
||||
static int g_LastPacifierDrawn = -1;
|
||||
static bool g_bPacifierSuppressed = false;
|
||||
|
||||
|
||||
void StartPacifier( char const *pPrefix )
|
||||
{
|
||||
Msg( "%s", pPrefix );
|
||||
g_LastPacifierDrawn = -1;
|
||||
UpdatePacifier( 0.001f );
|
||||
}
|
||||
|
||||
void UpdatePacifier( float flPercent )
|
||||
{
|
||||
int iCur = (int)(flPercent * 40.0f);
|
||||
iCur = clamp( iCur, g_LastPacifierDrawn, 40 );
|
||||
|
||||
if( iCur != g_LastPacifierDrawn && !g_bPacifierSuppressed )
|
||||
{
|
||||
for( int i=g_LastPacifierDrawn+1; i <= iCur; i++ )
|
||||
{
|
||||
if ( !( i % 4 ) )
|
||||
{
|
||||
Msg("%d", i/4);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( i != 40 )
|
||||
{
|
||||
Msg(".");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_LastPacifierDrawn = iCur;
|
||||
}
|
||||
}
|
||||
|
||||
void EndPacifier( bool bCarriageReturn )
|
||||
{
|
||||
UpdatePacifier(1);
|
||||
|
||||
if( bCarriageReturn && !g_bPacifierSuppressed )
|
||||
Msg("\n");
|
||||
}
|
||||
|
||||
void SuppressPacifier( bool bSuppress )
|
||||
{
|
||||
g_bPacifierSuppressed = bSuppress;
|
||||
}
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#include <stdio.h>
|
||||
#include "basetypes.h"
|
||||
#include "pacifier.h"
|
||||
#include "tier0/dbg.h"
|
||||
|
||||
|
||||
static int g_LastPacifierDrawn = -1;
|
||||
static bool g_bPacifierSuppressed = false;
|
||||
|
||||
#define clamp(a,b,c) ( (a) > (c) ? (c) : ( (a) < (b) ? (b) : (a) ) )
|
||||
|
||||
void StartPacifier( char const *pPrefix )
|
||||
{
|
||||
Msg( "%s", pPrefix );
|
||||
g_LastPacifierDrawn = -1;
|
||||
UpdatePacifier( 0.001f );
|
||||
}
|
||||
|
||||
void UpdatePacifier( float flPercent )
|
||||
{
|
||||
int iCur = (int)(flPercent * 40.0f);
|
||||
iCur = clamp( iCur, g_LastPacifierDrawn, 40 );
|
||||
|
||||
if( iCur != g_LastPacifierDrawn && !g_bPacifierSuppressed )
|
||||
{
|
||||
for( int i=g_LastPacifierDrawn+1; i <= iCur; i++ )
|
||||
{
|
||||
if ( !( i % 4 ) )
|
||||
{
|
||||
Msg("%d", i/4);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( i != 40 )
|
||||
{
|
||||
Msg(".");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_LastPacifierDrawn = iCur;
|
||||
}
|
||||
}
|
||||
|
||||
void EndPacifier( bool bCarriageReturn )
|
||||
{
|
||||
UpdatePacifier(1);
|
||||
|
||||
if( bCarriageReturn && !g_bPacifierSuppressed )
|
||||
Msg("\n");
|
||||
}
|
||||
|
||||
void SuppressPacifier( bool bSuppress )
|
||||
{
|
||||
g_bPacifierSuppressed = bSuppress;
|
||||
}
|
||||
Reference in new issue
Block a user