Exemplo n.º 1
0
    bool EnvironmentModule::HandleEvent(event_category_id_t category_id, event_id_t event_id, Foundation::EventDataInterface* data)
    {
        if(category_id == framework_event_category_)
        {
            HandleFrameworkEvent(event_id, data);
        }
        else if(category_id == resource_event_category_)
        {
            HandleResouceEvent(event_id, data);
        }
        else if(category_id == network_in_event_category_)
        {
            HandleNetworkEvent(event_id, data);
        }
        else if (category_id == network_state_event_category_)
        {
            if (event_id == ProtocolUtilities::Events::EVENT_SERVER_CONNECTED)
            {
                if (GetFramework()->GetDefaultWorldScene().get())
                {
                    CreateEnvironment();
                    CreateTerrain();
                    CreateWater();
                    //CreateEnvironment();
                    CreateSky();
                }
            }

            if (event_id == ProtocolUtilities::Events::EVENT_SERVER_DISCONNECTED)
            {
                if(postprocess_dialog_)
                    postprocess_dialog_->DisableAllEffects();
                ReleaseTerrain();
                ReleaseWater();
                ReleaseEnvironment();
                ReleaseSky();
                firstTime_ = true;
               
            }
        }
        else if(category_id == input_event_category_)
        {
            HandleInputEvent(event_id, data);
        }
        return false;
    }
Exemplo n.º 2
0
static void Terminate()
{
	ReleaseTerrain();

	for(int i=0;i<MAX_NB_TESTS;i++)
	{
		gCollisionTests[i]->Release();
		DELETESINGLE(gCollisionTests[i]);
	}

	if(gMainBar)
	{
		TwDeleteBar(gMainBar);
		gMainBar = null;
	}

	TwTerminate();
}