Add WaterChanged message, for things that need to be recomputed when the water height changes.
This was SVN commit r15226.
This commit is contained in:
parent
6407b593d6
commit
41f62cd3ff
@ -291,6 +291,19 @@ public:
|
||||
bool error; // whether we failed to start moving (couldn't find any path)
|
||||
};
|
||||
|
||||
/**
|
||||
* Sent when water height has been changed.
|
||||
*/
|
||||
class CMessageWaterChanged : public CMessage
|
||||
{
|
||||
public:
|
||||
DEFAULT_MESSAGE_IMPL(WaterChanged)
|
||||
|
||||
CMessageWaterChanged()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Sent when terrain (texture or elevation) has been changed.
|
||||
*/
|
||||
|
@ -46,6 +46,7 @@ MESSAGE(TerritoryPositionChanged)
|
||||
MESSAGE(MotionChanged)
|
||||
MESSAGE(RangeUpdate)
|
||||
MESSAGE(TerrainChanged)
|
||||
MESSAGE(WaterChanged)
|
||||
MESSAGE(TerritoriesChanged)
|
||||
MESSAGE(PathResult)
|
||||
MESSAGE(ValueModification)
|
||||
|
@ -118,6 +118,9 @@ public:
|
||||
|
||||
// Tell the terrain it'll need to recompute its cached render data
|
||||
GetSimContext().GetTerrain().MakeDirty(RENDERDATA_UPDATE_VERTICES);
|
||||
|
||||
CMessageWaterChanged msg;
|
||||
GetSimContext().GetComponentManager().BroadcastMessage(msg);
|
||||
}
|
||||
|
||||
virtual entity_pos_t GetWaterLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z))
|
||||
|
@ -282,6 +282,19 @@ CMessage* CMessageTerrainChanged::FromJSVal(ScriptInterface& scriptInterface, js
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
jsval CMessageWaterChanged::ToJSVal(ScriptInterface& scriptInterface) const
|
||||
{
|
||||
TOJSVAL_SETUP();
|
||||
return OBJECT_TO_JSVAL(obj);
|
||||
}
|
||||
|
||||
CMessage* CMessageWaterChanged::FromJSVal(ScriptInterface& UNUSED(scriptInterface), jsval UNUSED(val))
|
||||
{
|
||||
return new CMessageWaterChanged();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
jsval CMessageTerritoriesChanged::ToJSVal(ScriptInterface& scriptInterface) const
|
||||
{
|
||||
TOJSVAL_SETUP();
|
||||
|
Loading…
Reference in New Issue
Block a user