mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-18 03:35:07 +02:00
TypeInfoGen will now autobind doom scripts.
This commit is contained in:
@@ -39,16 +39,7 @@ If you have questions concerning this license or the applicable additional terms
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
const idEventDef EV_Speaker_On( "On", NULL );
|
||||
const idEventDef EV_Speaker_Off( "Off", NULL );
|
||||
const idEventDef EV_Speaker_Timer( "<timer>", NULL );
|
||||
|
||||
CLASS_DECLARATION( idEntity, idSound )
|
||||
EVENT( EV_Activate, idSound::Event_Trigger )
|
||||
EVENT( EV_Speaker_On, idSound::Event_On )
|
||||
EVENT( EV_Speaker_Off, idSound::Event_Off )
|
||||
EVENT( EV_Speaker_Timer, idSound::Event_Timer )
|
||||
END_CLASS
|
||||
|
||||
|
||||
/*
|
||||
@@ -124,7 +115,7 @@ void idSound::Spawn( void ) {
|
||||
|
||||
if ( !refSound.waitfortrigger && ( wait > 0.0f ) ) {
|
||||
timerOn = true;
|
||||
PostEventSec( &EV_Speaker_Timer, wait + gameLocal.random.CRandomFloat() * random );
|
||||
PostEventSec( &EV_Timer, wait + gameLocal.random.CRandomFloat() * random );
|
||||
} else {
|
||||
timerOn = false;
|
||||
}
|
||||
@@ -141,11 +132,11 @@ void idSound::Event_Trigger( idEntity *activator ) {
|
||||
if ( wait > 0.0f ) {
|
||||
if ( timerOn ) {
|
||||
timerOn = false;
|
||||
CancelEvents( &EV_Speaker_Timer );
|
||||
CancelEvents( &EV_Timer );
|
||||
} else {
|
||||
timerOn = true;
|
||||
DoSound( true );
|
||||
PostEventSec( &EV_Speaker_Timer, wait + gameLocal.random.CRandomFloat() * random );
|
||||
PostEventSec( &EV_Timer, wait + gameLocal.random.CRandomFloat() * random );
|
||||
}
|
||||
} else {
|
||||
if ( gameLocal.isMultiplayer ) {
|
||||
@@ -171,7 +162,7 @@ idSound::Event_Timer
|
||||
*/
|
||||
void idSound::Event_Timer( void ) {
|
||||
DoSound( true );
|
||||
PostEventSec( &EV_Speaker_Timer, wait + gameLocal.random.CRandomFloat() * random );
|
||||
PostEventSec( &EV_Timer, wait + gameLocal.random.CRandomFloat() * random );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -225,8 +216,8 @@ void idSound::UpdateChangeableSpawnArgs( const idDict *source ) {
|
||||
if ( !refSound.waitfortrigger && ( wait > 0.0f ) ) {
|
||||
timerOn = true;
|
||||
DoSound( false );
|
||||
CancelEvents( &EV_Speaker_Timer );
|
||||
PostEventSec( &EV_Speaker_Timer, wait + gameLocal.random.CRandomFloat() * random );
|
||||
CancelEvents( &EV_Timer );
|
||||
PostEventSec( &EV_Timer, wait + gameLocal.random.CRandomFloat() * random );
|
||||
} else if ( !refSound.waitfortrigger && !(refSound.referenceSound && refSound.referenceSound->CurrentlyPlaying() ) ) {
|
||||
// start it if it isn't already playing, and we aren't waitForTrigger
|
||||
DoSound( true );
|
||||
@@ -276,7 +267,7 @@ idSound::Event_On
|
||||
void idSound::Event_On( void ) {
|
||||
if ( wait > 0.0f ) {
|
||||
timerOn = true;
|
||||
PostEventSec( &EV_Speaker_Timer, wait + gameLocal.random.CRandomFloat() * random );
|
||||
PostEventSec( &EV_Timer, wait + gameLocal.random.CRandomFloat() * random );
|
||||
}
|
||||
DoSound( true );
|
||||
}
|
||||
@@ -289,7 +280,7 @@ idSound::Event_Off
|
||||
void idSound::Event_Off( void ) {
|
||||
if ( timerOn ) {
|
||||
timerOn = false;
|
||||
CancelEvents( &EV_Speaker_Timer );
|
||||
CancelEvents( &EV_Timer );
|
||||
}
|
||||
DoSound( false );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user