mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2024-12-28 07:45:29 +03:00
Merge branch 'develop' of https://github.com/mapbase-source/source-sdk-2013 into develop
This commit is contained in:
commit
7ce328cbb9
@ -283,6 +283,8 @@ void C_EnvProjectedTexture::UpdateLight( void )
|
|||||||
|
|
||||||
// VectorNormalize( vRight );
|
// VectorNormalize( vRight );
|
||||||
// VectorNormalize( vUp );
|
// VectorNormalize( vUp );
|
||||||
|
|
||||||
|
VectorVectors( vForward, vRight, vUp );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -745,7 +745,7 @@ void CViewRender::SetUpViews()
|
|||||||
|
|
||||||
//Adjust the viewmodel's FOV to move with any FOV offsets on the viewer's end
|
//Adjust the viewmodel's FOV to move with any FOV offsets on the viewer's end
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
view.fovViewmodel = fabs(g_pClientMode->GetViewModelFOV()) - flFOVOffset;
|
view.fovViewmodel = max(0.001f, g_pClientMode->GetViewModelFOV() - flFOVOffset);
|
||||||
#else
|
#else
|
||||||
view.fovViewmodel = g_pClientMode->GetViewModelFOV() - flFOVOffset;
|
view.fovViewmodel = g_pClientMode->GetViewModelFOV() - flFOVOffset;
|
||||||
#endif
|
#endif
|
||||||
|
@ -26,6 +26,15 @@ public:
|
|||||||
DECLARE_CLASS( CEnvInstructorHint, CPointEntity );
|
DECLARE_CLASS( CEnvInstructorHint, CPointEntity );
|
||||||
DECLARE_DATADESC();
|
DECLARE_DATADESC();
|
||||||
|
|
||||||
|
#ifdef MAPBASE
|
||||||
|
CEnvInstructorHint( void );
|
||||||
|
#endif
|
||||||
|
virtual ~CEnvInstructorHint( void ) {}
|
||||||
|
|
||||||
|
#ifdef MAPBASE
|
||||||
|
virtual void OnRestore( void );
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void InputShowHint( inputdata_t &inputdata );
|
void InputShowHint( inputdata_t &inputdata );
|
||||||
void InputEndHint( inputdata_t &inputdata );
|
void InputEndHint( inputdata_t &inputdata );
|
||||||
@ -56,6 +65,10 @@ private:
|
|||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
string_t m_iszStartSound;
|
string_t m_iszStartSound;
|
||||||
int m_iHintTargetPos;
|
int m_iHintTargetPos;
|
||||||
|
float m_flActiveUntil;
|
||||||
|
CHandle<CBasePlayer> m_hActivator;
|
||||||
|
EHANDLE m_hTarget;
|
||||||
|
bool m_bFilterByActivator;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -85,6 +98,11 @@ BEGIN_DATADESC( CEnvInstructorHint )
|
|||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
DEFINE_KEYFIELD( m_iszStartSound, FIELD_STRING, "hint_start_sound" ),
|
DEFINE_KEYFIELD( m_iszStartSound, FIELD_STRING, "hint_start_sound" ),
|
||||||
DEFINE_KEYFIELD( m_iHintTargetPos, FIELD_INTEGER, "hint_target_pos" ),
|
DEFINE_KEYFIELD( m_iHintTargetPos, FIELD_INTEGER, "hint_target_pos" ),
|
||||||
|
|
||||||
|
DEFINE_FIELD( m_flActiveUntil, FIELD_TIME ),
|
||||||
|
DEFINE_FIELD( m_hActivator, FIELD_EHANDLE ),
|
||||||
|
DEFINE_FIELD( m_hTarget, FIELD_EHANDLE ),
|
||||||
|
DEFINE_FIELD( m_bFilterByActivator, FIELD_BOOLEAN ),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DEFINE_INPUTFUNC( FIELD_STRING, "ShowHint", InputShowHint ),
|
DEFINE_INPUTFUNC( FIELD_STRING, "ShowHint", InputShowHint ),
|
||||||
@ -102,6 +120,43 @@ END_DATADESC()
|
|||||||
#define LOCATOR_ICON_FX_SHAKE_NARROW 0x00000040
|
#define LOCATOR_ICON_FX_SHAKE_NARROW 0x00000040
|
||||||
#define LOCATOR_ICON_FX_STATIC 0x00000100 // This icon draws at a fixed location on the HUD.
|
#define LOCATOR_ICON_FX_STATIC 0x00000100 // This icon draws at a fixed location on the HUD.
|
||||||
|
|
||||||
|
#ifdef MAPBASE
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
CEnvInstructorHint::CEnvInstructorHint( void )
|
||||||
|
{
|
||||||
|
m_hActivator = NULL;
|
||||||
|
m_hTarget = NULL;
|
||||||
|
m_bFilterByActivator = false;
|
||||||
|
m_flActiveUntil = -1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void CEnvInstructorHint::OnRestore( void )
|
||||||
|
{
|
||||||
|
int iTimeLeft = 0;
|
||||||
|
if ( m_flActiveUntil < 0.0f )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( m_iTimeout != 0 )
|
||||||
|
{
|
||||||
|
iTimeLeft = static_cast<int>( m_flActiveUntil - gpGlobals->curtime );
|
||||||
|
if ( iTimeLeft <= 0 )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int iOriginalTimeout = m_iTimeout;
|
||||||
|
m_iTimeout = iTimeLeft;
|
||||||
|
inputdata_t inputdata;
|
||||||
|
InputShowHint( inputdata );
|
||||||
|
m_iTimeout = iOriginalTimeout;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Input handler for showing the message and/or playing the sound.
|
// Purpose: Input handler for showing the message and/or playing the sound.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -110,7 +165,15 @@ void CEnvInstructorHint::InputShowHint( inputdata_t &inputdata )
|
|||||||
IGameEvent * event = gameeventmanager->CreateEvent( "instructor_server_hint_create", false );
|
IGameEvent * event = gameeventmanager->CreateEvent( "instructor_server_hint_create", false );
|
||||||
if ( event )
|
if ( event )
|
||||||
{
|
{
|
||||||
CBaseEntity *pTargetEntity = gEntList.FindEntityByName( NULL, m_iszHintTargetEntity );
|
CBaseEntity *pTargetEntity = NULL;
|
||||||
|
|
||||||
|
#ifdef MAPBASE
|
||||||
|
pTargetEntity = m_hTarget;
|
||||||
|
|
||||||
|
if ( pTargetEntity == NULL )
|
||||||
|
#endif
|
||||||
|
pTargetEntity = gEntList.FindEntityByName( NULL, m_iszHintTargetEntity );
|
||||||
|
|
||||||
if( pTargetEntity == NULL && !m_bStatic )
|
if( pTargetEntity == NULL && !m_bStatic )
|
||||||
pTargetEntity = inputdata.pActivator;
|
pTargetEntity = inputdata.pActivator;
|
||||||
|
|
||||||
@ -137,6 +200,15 @@ void CEnvInstructorHint::InputShowHint( inputdata_t &inputdata )
|
|||||||
pActivator = pMarine->GetCommander();
|
pActivator = pMarine->GetCommander();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
#ifdef MAPBASE
|
||||||
|
if ( m_hActivator )
|
||||||
|
{
|
||||||
|
pActivator = m_hActivator;
|
||||||
|
bFilterByActivator = m_bFilterByActivator;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( inputdata.value.StringID() != NULL_STRING )
|
if ( inputdata.value.StringID() != NULL_STRING )
|
||||||
{
|
{
|
||||||
CBaseEntity *pTarget = gEntList.FindEntityByName( NULL, inputdata.value.String() );
|
CBaseEntity *pTarget = gEntList.FindEntityByName( NULL, inputdata.value.String() );
|
||||||
@ -190,6 +262,13 @@ void CEnvInstructorHint::InputShowHint( inputdata_t &inputdata )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
gameeventmanager->FireEvent( event );
|
gameeventmanager->FireEvent( event );
|
||||||
|
|
||||||
|
#ifdef MAPBASE
|
||||||
|
m_flActiveUntil = gpGlobals->curtime + m_iTimeout;
|
||||||
|
m_hTarget = pTargetEntity;
|
||||||
|
m_hActivator = pActivator;
|
||||||
|
m_bFilterByActivator = bFilterByActivator;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,6 +282,13 @@ void CEnvInstructorHint::InputEndHint( inputdata_t &inputdata )
|
|||||||
event->SetString( "hint_name", GetEntityName().ToCStr() );
|
event->SetString( "hint_name", GetEntityName().ToCStr() );
|
||||||
|
|
||||||
gameeventmanager->FireEvent( event );
|
gameeventmanager->FireEvent( event );
|
||||||
|
|
||||||
|
#ifdef MAPBASE
|
||||||
|
m_flActiveUntil = -1.0f;
|
||||||
|
m_hActivator = NULL;
|
||||||
|
m_hTarget = NULL;
|
||||||
|
m_bFilterByActivator = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3735,7 +3735,7 @@ CChoreoScene *CSceneEntity::LoadScene( const char *filename, IChoreoEventCallbac
|
|||||||
Q_FixSlashes( loadfile );
|
Q_FixSlashes( loadfile );
|
||||||
|
|
||||||
// binary compiled vcd
|
// binary compiled vcd
|
||||||
void *pBuffer;
|
void *pBuffer = NULL;
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
//
|
//
|
||||||
// Raw scene file support
|
// Raw scene file support
|
||||||
@ -3760,12 +3760,13 @@ CChoreoScene *CSceneEntity::LoadScene( const char *filename, IChoreoEventCallbac
|
|||||||
{
|
{
|
||||||
g_TokenProcessor.SetBuffer((char*)pBuffer);
|
g_TokenProcessor.SetBuffer((char*)pBuffer);
|
||||||
pScene = ChoreoLoadScene( loadfile, NULL, &g_TokenProcessor, LocalScene_Printf );
|
pScene = ChoreoLoadScene( loadfile, NULL, &g_TokenProcessor, LocalScene_Printf );
|
||||||
|
g_TokenProcessor.SetBuffer(NULL);
|
||||||
}
|
}
|
||||||
// Okay, it's definitely missing.
|
// Okay, it's definitely missing.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MissingSceneWarning( loadfile );
|
MissingSceneWarning( loadfile );
|
||||||
return NULL;
|
pScene = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pScene)
|
if (pScene)
|
||||||
@ -4283,6 +4284,7 @@ CBaseEntity *CSceneEntity::FindNamedEntity( const char *name, CBaseEntity *pActo
|
|||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
const char *GetFirstSoundInScene(const char *pszScene)
|
const char *GetFirstSoundInScene(const char *pszScene)
|
||||||
{
|
{
|
||||||
|
const char *soundName;
|
||||||
SceneCachedData_t sceneData;
|
SceneCachedData_t sceneData;
|
||||||
if ( scenefilecache->GetSceneCachedData( pszScene, &sceneData ) )
|
if ( scenefilecache->GetSceneCachedData( pszScene, &sceneData ) )
|
||||||
{
|
{
|
||||||
@ -4292,16 +4294,17 @@ const char *GetFirstSoundInScene(const char *pszScene)
|
|||||||
short stringId = scenefilecache->GetSceneCachedSound( sceneData.sceneId, 0 );
|
short stringId = scenefilecache->GetSceneCachedSound( sceneData.sceneId, 0 );
|
||||||
|
|
||||||
// Trust that it's been precached
|
// Trust that it's been precached
|
||||||
return scenefilecache->GetSceneString( stringId );
|
soundName = scenefilecache->GetSceneString( stringId );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
void *pBuffer = NULL;
|
void *pBuffer = NULL;
|
||||||
if (filesystem->ReadFileEx( pszScene, "MOD", &pBuffer, false, true ))
|
if (filesystem->ReadFileEx( pszScene, "MOD", &pBuffer, true ))
|
||||||
{
|
{
|
||||||
g_TokenProcessor.SetBuffer((char*)pBuffer);
|
g_TokenProcessor.SetBuffer((char*)pBuffer);
|
||||||
CChoreoScene *pScene = ChoreoLoadScene( pszScene, NULL, &g_TokenProcessor, LocalScene_Printf );
|
CChoreoScene *pScene = ChoreoLoadScene( pszScene, NULL, &g_TokenProcessor, LocalScene_Printf );
|
||||||
|
g_TokenProcessor.SetBuffer(NULL);
|
||||||
if (pScene)
|
if (pScene)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < pScene->GetNumEvents(); i++)
|
for (int i = 0; i < pScene->GetNumEvents(); i++)
|
||||||
@ -4309,13 +4312,17 @@ const char *GetFirstSoundInScene(const char *pszScene)
|
|||||||
CChoreoEvent *pEvent = pScene->GetEvent(i);
|
CChoreoEvent *pEvent = pScene->GetEvent(i);
|
||||||
|
|
||||||
if (pEvent->GetType() == CChoreoEvent::SPEAK)
|
if (pEvent->GetType() == CChoreoEvent::SPEAK)
|
||||||
return pEvent->GetParameters();
|
{
|
||||||
|
soundName = pEvent->GetParameters();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FreeSceneFileMemory( pBuffer );
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return soundName;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *GetFirstSoundInScene(CChoreoScene *scene)
|
const char *GetFirstSoundInScene(CChoreoScene *scene)
|
||||||
@ -4483,6 +4490,8 @@ bool CSceneEntity::ScriptLoadSceneFromString(const char* pszFilename, const char
|
|||||||
PrecacheScene(pScene);
|
PrecacheScene(pScene);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_TokenProcessor.SetBuffer(NULL);
|
||||||
|
|
||||||
if (pScene != NULL)
|
if (pScene != NULL)
|
||||||
{
|
{
|
||||||
// release prior scene if present
|
// release prior scene if present
|
||||||
@ -5284,12 +5293,12 @@ int GetSceneSpeechCount( char const *pszScene )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
void *pBuffer = NULL;
|
void *pBuffer = NULL;
|
||||||
if (filesystem->ReadFileEx( pszScene, "MOD", &pBuffer, false, true ))
|
|
||||||
{
|
|
||||||
int iNumSounds = 0;
|
int iNumSounds = 0;
|
||||||
|
if (filesystem->ReadFileEx( pszScene, "MOD", &pBuffer, true ))
|
||||||
|
{
|
||||||
g_TokenProcessor.SetBuffer((char*)pBuffer);
|
g_TokenProcessor.SetBuffer((char*)pBuffer);
|
||||||
CChoreoScene *pScene = ChoreoLoadScene( pszScene, NULL, &g_TokenProcessor, LocalScene_Printf );
|
CChoreoScene *pScene = ChoreoLoadScene( pszScene, NULL, &g_TokenProcessor, LocalScene_Printf );
|
||||||
|
g_TokenProcessor.SetBuffer(NULL);
|
||||||
if (pScene)
|
if (pScene)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < pScene->GetNumEvents(); i++)
|
for (int i = 0; i < pScene->GetNumEvents(); i++)
|
||||||
@ -5300,10 +5309,12 @@ int GetSceneSpeechCount( char const *pszScene )
|
|||||||
iNumSounds++;
|
iNumSounds++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FreeSceneFileMemory( pBuffer );
|
||||||
|
|
||||||
return iNumSounds;
|
return iNumSounds;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -5359,7 +5370,7 @@ void PrecacheInstancedScene( char const *pszScene )
|
|||||||
|
|
||||||
// Attempt to precache manually
|
// Attempt to precache manually
|
||||||
void *pBuffer = NULL;
|
void *pBuffer = NULL;
|
||||||
if (filesystem->ReadFileEx( loadfile, "MOD", &pBuffer, false, true ))
|
if (filesystem->ReadFileEx( loadfile, "MOD", &pBuffer, true ))
|
||||||
{
|
{
|
||||||
g_TokenProcessor.SetBuffer((char*)pBuffer);
|
g_TokenProcessor.SetBuffer((char*)pBuffer);
|
||||||
CChoreoScene *pScene = ChoreoLoadScene( loadfile, NULL, &g_TokenProcessor, LocalScene_Printf );
|
CChoreoScene *pScene = ChoreoLoadScene( loadfile, NULL, &g_TokenProcessor, LocalScene_Printf );
|
||||||
@ -5367,7 +5378,9 @@ void PrecacheInstancedScene( char const *pszScene )
|
|||||||
{
|
{
|
||||||
PrecacheChoreoScene(pScene);
|
PrecacheChoreoScene(pScene);
|
||||||
}
|
}
|
||||||
|
g_TokenProcessor.SetBuffer(NULL);
|
||||||
}
|
}
|
||||||
|
FreeSceneFileMemory( pBuffer );
|
||||||
#else
|
#else
|
||||||
// Scenes are sloppy and don't always exist.
|
// Scenes are sloppy and don't always exist.
|
||||||
// A scene that is not in the pre-built cache image, but on disk, is a true error.
|
// A scene that is not in the pre-built cache image, but on disk, is a true error.
|
||||||
|
Loading…
Reference in New Issue
Block a user