mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
Fix #303
This commit is contained in:
@ -56,6 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
#include "../pnMessage/plRefMsg.h"
|
#include "../pnMessage/plRefMsg.h"
|
||||||
#include "../pnMessage/plEnableMsg.h"
|
#include "../pnMessage/plEnableMsg.h"
|
||||||
#include "../pfMessage/pfGameGUIMsg.h"
|
#include "../pfMessage/pfGameGUIMsg.h"
|
||||||
|
#include "../plMessage/plDeviceRecreateMsg.h"
|
||||||
#include "../pnSceneObject/plDrawInterface.h"
|
#include "../pnSceneObject/plDrawInterface.h"
|
||||||
#include "../pnSceneObject/plCoordinateInterface.h"
|
#include "../pnSceneObject/plCoordinateInterface.h"
|
||||||
#include "../pnSceneObject/plAudioInterface.h"
|
#include "../pnSceneObject/plAudioInterface.h"
|
||||||
@ -584,14 +585,16 @@ plProfile_CreateTimer("Gui", "RenderSetup", GUITime);
|
|||||||
hsBool pfGUIControlMod::MsgReceive( plMessage *msg )
|
hsBool pfGUIControlMod::MsgReceive( plMessage *msg )
|
||||||
{
|
{
|
||||||
plRenderMsg* rend = plRenderMsg::ConvertNoRef( msg );
|
plRenderMsg* rend = plRenderMsg::ConvertNoRef( msg );
|
||||||
|
plDeviceRecreateMsg* device = plDeviceRecreateMsg::ConvertNoRef(msg);
|
||||||
|
if (rend || device) {
|
||||||
|
plPipeline* pipe = rend ? rend->Pipeline() : device->Pipeline();
|
||||||
|
|
||||||
if( rend )
|
|
||||||
{
|
|
||||||
plProfile_BeginLap(GUITime, this->GetKey()->GetUoid().GetObjectName());
|
plProfile_BeginLap(GUITime, this->GetKey()->GetUoid().GetObjectName());
|
||||||
// Only need it once
|
ISetUpDynTextMap(pipe);
|
||||||
if( ISetUpDynTextMap( rend->Pipeline() ) )
|
|
||||||
plgDispatch::Dispatch()->UnRegisterForExactType( plRenderMsg::Index(), GetKey() );
|
|
||||||
plProfile_EndLap(GUITime, this->GetKey()->GetUoid().GetObjectName());
|
plProfile_EndLap(GUITime, this->GetKey()->GetUoid().GetObjectName());
|
||||||
|
|
||||||
|
if (rend)
|
||||||
|
plgDispatch::Dispatch()->UnRegisterForExactType(plRenderMsg::Index(), GetKey());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -603,12 +606,16 @@ hsBool pfGUIControlMod::MsgReceive( plMessage *msg )
|
|||||||
if( refMsg->GetContext() & ( plRefMsg::kOnCreate | plRefMsg::kOnRequest | plRefMsg::kOnReplace ) )
|
if( refMsg->GetContext() & ( plRefMsg::kOnCreate | plRefMsg::kOnRequest | plRefMsg::kOnReplace ) )
|
||||||
{
|
{
|
||||||
fDynTextMap = plDynamicTextMap::ConvertNoRef( refMsg->GetRef() );
|
fDynTextMap = plDynamicTextMap::ConvertNoRef( refMsg->GetRef() );
|
||||||
// Register for a render msg so we can leech the material when we finally
|
|
||||||
// have a pipeline to work with
|
// These tell us when we need to (re-)initialize the DTM
|
||||||
plgDispatch::Dispatch()->RegisterForExactType( plRenderMsg::Index(), GetKey() );
|
plgDispatch::Dispatch()->RegisterForExactType( plRenderMsg::Index(), GetKey() );
|
||||||
|
plgDispatch::Dispatch()->RegisterForExactType( plDeviceRecreateMsg::Index(), GetKey() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
fDynTextMap = nil;
|
fDynTextMap = nil;
|
||||||
|
plgDispatch::Dispatch()->UnRegisterForExactType( plDeviceRecreateMsg::Index(), GetKey() );
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if( refMsg->fType == kRefDynTextLayer )
|
else if( refMsg->fType == kRefDynTextLayer )
|
||||||
|
@ -51,15 +51,26 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
|
|
||||||
#include "../pnMessage/plMessage.h"
|
#include "../pnMessage/plMessage.h"
|
||||||
|
|
||||||
|
class plPipeline;
|
||||||
|
|
||||||
class plDeviceRecreateMsg : public plMessage
|
class plDeviceRecreateMsg : public plMessage
|
||||||
{
|
{
|
||||||
|
plPipeline* fPipe;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
plDeviceRecreateMsg() : plMessage( nil, nil, nil ) { SetBCastFlag( kBCastByExactType ); }
|
plDeviceRecreateMsg(plPipeline* pipe=nil)
|
||||||
|
: plMessage(nil, nil, nil), fPipe(pipe)
|
||||||
|
{
|
||||||
|
SetBCastFlag(kBCastByExactType);
|
||||||
|
}
|
||||||
|
|
||||||
~plDeviceRecreateMsg() {}
|
~plDeviceRecreateMsg() {}
|
||||||
|
|
||||||
CLASSNAME_REGISTER( plDeviceRecreateMsg );
|
CLASSNAME_REGISTER( plDeviceRecreateMsg );
|
||||||
GETINTERFACE_ANY( plDeviceRecreateMsg, plMessage );
|
GETINTERFACE_ANY( plDeviceRecreateMsg, plMessage );
|
||||||
|
|
||||||
|
plPipeline* Pipeline() const { return fPipe; }
|
||||||
|
|
||||||
// IO
|
// IO
|
||||||
void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead( stream, mgr ); }
|
void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead( stream, mgr ); }
|
||||||
void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite( stream, mgr ); }
|
void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite( stream, mgr ); }
|
||||||
|
@ -2278,7 +2278,7 @@ hsBool plDXPipeline::IResetDevice()
|
|||||||
|
|
||||||
/// Broadcast a message letting everyone know that we were recreated and that
|
/// Broadcast a message letting everyone know that we were recreated and that
|
||||||
/// all device-specific stuff needs to be recreated
|
/// all device-specific stuff needs to be recreated
|
||||||
plDeviceRecreateMsg* clean = TRACKED_NEW plDeviceRecreateMsg();
|
plDeviceRecreateMsg* clean = TRACKED_NEW plDeviceRecreateMsg(this);
|
||||||
plgDispatch::MsgSend(clean);
|
plgDispatch::MsgSend(clean);
|
||||||
}
|
}
|
||||||
fDevWasLost = true;
|
fDevWasLost = true;
|
||||||
@ -2552,7 +2552,7 @@ void plDXPipeline::Resize( UInt32 width, UInt32 height )
|
|||||||
|
|
||||||
/// Broadcast a message letting everyone know that we were recreated and that
|
/// Broadcast a message letting everyone know that we were recreated and that
|
||||||
/// all device-specific stuff needs to be recreated
|
/// all device-specific stuff needs to be recreated
|
||||||
plDeviceRecreateMsg* clean = TRACKED_NEW plDeviceRecreateMsg();
|
plDeviceRecreateMsg* clean = TRACKED_NEW plDeviceRecreateMsg(this);
|
||||||
plgDispatch::MsgSend(clean);
|
plgDispatch::MsgSend(clean);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3834,7 +3834,7 @@ hsBool plDXPipeline::BeginRender()
|
|||||||
{
|
{
|
||||||
/// Broadcast a message letting everyone know that we were recreated and that
|
/// Broadcast a message letting everyone know that we were recreated and that
|
||||||
/// all device-specific stuff needs to be recreated
|
/// all device-specific stuff needs to be recreated
|
||||||
// plDeviceRecreateMsg* clean = TRACKED_NEW plDeviceRecreateMsg();
|
// plDeviceRecreateMsg* clean = TRACKED_NEW plDeviceRecreateMsg(this);
|
||||||
// plgDispatch::MsgSend(clean);
|
// plgDispatch::MsgSend(clean);
|
||||||
|
|
||||||
fDevWasLost = false;
|
fDevWasLost = false;
|
||||||
|
Reference in New Issue
Block a user