diff --git a/neo/d3xp/Light.cpp b/neo/d3xp/Light.cpp index ea52951d..e9c56271 100644 --- a/neo/d3xp/Light.cpp +++ b/neo/d3xp/Light.cpp @@ -276,6 +276,8 @@ idLight::idLight(): lightStyleBase.Set( 300, 300, 300 ); lightStyleState.Reset(); + + modelTarget = NULL; // RB end } @@ -324,6 +326,9 @@ void idLight::Save( idSaveGame* savefile ) const savefile->WriteInt( fadeStart ); savefile->WriteInt( fadeEnd ); savefile->WriteBool( soundWasPlaying ); + + // RB: TODO light styles + modelTarget.Save( savefile ); } /* @@ -360,6 +365,11 @@ void idLight::Restore( idRestoreGame* savefile ) savefile->ReadInt( fadeEnd ); savefile->ReadBool( soundWasPlaying ); + if( savefile->GetBuildNumber() >= BUILD_NUMBER_SAVE_VERSION_LIGHT_MODELTARGET_CHANGE ) + { + modelTarget.Restore( savefile ); + } + lightDefHandle = -1; SetLightLevel(); @@ -520,6 +530,15 @@ void idLight::Spawn() idClipModel::CheckModel( brokenModel ); } + // RB: link func_static modelTarget + //modelTarget = NULL; + const char* target = spawnArgs.GetString( "modelTarget" ); + if( target != NULL && target[0] != '\0' ) + { + PostEventMS( &EV_Light_UpdateModelTarget, 0 ); + } + // RB end + PostEventMS( &EV_PostSpawn, 0 ); UpdateVisuals(); diff --git a/neo/framework/BuildVersion.h b/neo/framework/BuildVersion.h index de76a91a..edd44884 100644 --- a/neo/framework/BuildVersion.h +++ b/neo/framework/BuildVersion.h @@ -26,9 +26,10 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -const int BUILD_NUMBER_SAVE_VERSION_BEFORE_SKIP_CINEMATIC = 1400; -const int BUILD_NUMBER_SAVE_VERSION_CHANGE = 1401; // Altering saves so that the version goes in the Details file that we read in during the enumeration phase -const int BUILD_NUMBER_SAVE_VERSION_SCRIPT_CHANGES1 = 1402; // RB: Merged script compiler changes from Dhewm3 so functions don't need declarations before used +const int BUILD_NUMBER_SAVE_VERSION_BEFORE_SKIP_CINEMATIC = 1400; +const int BUILD_NUMBER_SAVE_VERSION_CHANGE = 1401; // Altering saves so that the version goes in the Details file that we read in during the enumeration phase +const int BUILD_NUMBER_SAVE_VERSION_SCRIPT_CHANGES1 = 1402; // RB: Merged script compiler changes from Dhewm3 so functions don't need declarations before used +const int BUILD_NUMBER_SAVE_VERSION_LIGHT_MODELTARGET_CHANGE = 1403; // RB: added idLight::modelTarget entity pointer -const int BUILD_NUMBER = BUILD_NUMBER_SAVE_VERSION_SCRIPT_CHANGES1; +const int BUILD_NUMBER = BUILD_NUMBER_SAVE_VERSION_LIGHT_MODELTARGET_CHANGE; const int BUILD_NUMBER_MINOR = 0;