Ejemplo n.º 1
0
// **************************************************************************
// RunWorkerThread ()
//
// Description:
//	Creates a worker thread to perform a specified task.  This function will
//	block until worker thread completes its task.
//
// Parameters:
//	WORKERTHREADARG	*pArg	Pointer to a structure that contains information
//							  about task to be performed.
//
// Returns:
//  void
// **************************************************************************
void CKDocument::RunWorkerThread (WORKERTHREADARG *pArg)
	{
	// Load standard arrow and small hourglass cursor reource:
	HCURSOR hCursor = ::LoadCursor (NULL, IDC_APPSTARTING);
	ASSERT (hCursor);

	// Set the hourglass cursor:
	::SetCursor (hCursor);

	// Lock document to prevent edits while worker thread is doing its thing:
	SetLocked (true);

	// Start the worker thread:
	unsigned int uAddress = 0;
	HANDLE hThread = (HANDLE) _beginthreadex (NULL, 0, WorkerThread, pArg, 0, &uAddress);
	
	// If thread was created successfully, we need to wait for it to complete
	// its task.  This will guarentee that pArg will remain valid while the
	// thread completes its task.  We will need to process the message queue
	// while the thread runs to keep everybody up to date.
	if (hThread)
		{
		MSG stMsg;

		// Proccess messages while waiting for the thread to stop.  
		// hThread event will be set when thread stops.  Timeout every
		// 10 ms to process message queue, and then resume wait.
		while (WaitForSingleObject (hThread, 10) == WAIT_TIMEOUT)
			{
			// Process message queue by removing the next message, and then
			// dispatching it.  This will insure that important Windows 
			// notifiactions get processed by their target windows while this
			// thread is running.
			if (PeekMessage (&stMsg, NULL, 0, 0, PM_REMOVE))
				DispatchMessage (&stMsg);

			// Make sure hourglass cursor stays:
			::SetCursor (hCursor);
			}

		// When we break out of look, we know worker thread has stopped.
		// We can now close the thread handle:
		CloseHandle (hThread);
		}

	// We can now unlock document for edits:
	SetLocked (false);

	// Replace normal cursor:
	::DestroyCursor (hCursor);
	}
Ejemplo n.º 2
0
	//! Constructor.
	Camera::Camera()
	{
		// Set the sensitivity and speed
		SetLookSensitivity(2.0f);
		SetMovementSpeed(0.6f);
		SetLocked(false);

		// Default position and target
		mPosition	= XMFLOAT3(-30, 60, 0);
		mTarget		= XMFLOAT3(0.0f, 0.0f, 0.0f);
		mUp			= XMFLOAT3(0.0f, 1.0f, 0.0f);		// Weird up vector

		// Calculate the new direction.
		UpdatePitchYaw();

		// Build the projection matrix
		XMMATRIX proj = XMMatrixPerspectiveFovLH(XM_PI * 0.25, (float)GlobalApp::GetClientWidth()/(float)GlobalApp::GetClientHeight(), 1.0f, 1000.0f);
		XMStoreFloat4x4(&mProj, proj);

		UpdateViewMatrix();
		
		// Build the camera frustum.
		mFrustum.ConstructFromProjection(GetProjectionMatrix());
		//XNA::ComputeFrustumFromProjection(&mFrustum, &XMLoadFloat4x4(&GetProjectionMatrix()));
	}
Ejemplo n.º 3
0
void FLevelViewModel::ToggleLock()
{
	if( !Level.IsValid() )
	{
		return;
	}

	SetLocked( !IsLocked() );
}
Ejemplo n.º 4
0
void CP4FileStats::SetOtherOpens(int num)
{
	m_OtherOpens=num; 
	if(num==0)
	{
		m_OtherOpenAction=0;
		m_OtherUserMyClient=FALSE;
		SetLocked(FALSE, TRUE);
	}
}
void scene_gestalt()
{
    float time = 0.0;
    float offset = 1.0;
    object p1 = GetObjectByTag("intro_p1_start");
    object p2 = GetObjectByTag("intro_p2_start");
    object p2e = GetObjectByTag("intro_p2_end");
    object p3 = GetObjectByTag("intro_p3");

    /* Initialize */
    GestaltStartCutscene(pc);
    GestaltCameraFade(time, pc, FADE_CROSS, FADE_SPEED_MEDIUM, fade_duration);
    ghost();

    /* Setup */
    time = 2*delay;
    GestaltInvisibility(time, pc);
    GestaltCameraFacing(time, 63.0, 10.0, 85.0, pc);
    play_audio(time);

    /* Pass 1 */
    GestaltJump(time, pc, p1);
    GestaltActionMove(time + offset, pc, p2, FALSE, 0.0, 5*delay);

    /* Pass 2 */
    time = 7*delay;
    GestaltCameraFade(time - offset, pc, FADE_CROSS, FADE_SPEED_MEDIUM, fade_duration);
    GestaltCameraFacing(time + offset, 293.0, 10.0, 85.0, pc);
    GestaltJump(time, pc, p2);
    GestaltActionMove(time + offset, pc, p2e, FALSE, 0.0, 5*delay);


    /* Pass 3 (zoom into shadow) */
    time = 12*delay;
    GestaltCameraFade(time - offset, pc, FADE_CROSS, FADE_SPEED_MEDIUM, fade_duration);
    GestaltJump(time + offset, pc, p3);
    GestaltCameraMove(time + offset, 260.0, 20.0, 85.0, 280.0, 10.0, 85.0, 5*delay, 60.0, pc);

    /* Clean up and end cutscene */
    time = 16 * delay;
    DelayCommand(time, FadeToBlack(pc));
    //GestaltCameraFade(time - offset, pc, FADE_CROSS, FADE_SPEED_MEDIUM, fade_duration);

    /* Trigger ScriptEase */
    time = 18 * delay;
    GestaltClearEffect(time, pc);
    GestaltStopCutscene(time, pc, "intro_end");

    time = time + offset;
    // GestaltCameraFacing(time, 270.0, 10.0, 75.0, pc);
    AssignCommand(pc, SetCameraFacing(270.0, 10.0));
    DelayCommand(time, AssignCommand(pc, SetFacing(270.0)));
    DelayCommand(time, SetLocked(GetObjectByTag("activate_easel_trigger"), FALSE));
    DelayCommand(time, FadeFromBlack(pc));
}
Ejemplo n.º 6
0
void cGameSwingDoor::LoadFromSaveData(iGameEntity_SaveData *apSaveData)
{
	__super::LoadFromSaveData(apSaveData);
	cGameSwingDoor_SaveData *pData = static_cast<cGameSwingDoor_SaveData*>(apSaveData);

	kCopyFromVar(pData,msBreakSound);
	kCopyFromVar(pData,msBreakEntity);
	kCopyFromVar(pData,msBreakPS);

	SetLocked(pData->mbLocked);
}
Ejemplo n.º 7
0
static void create() {
    door::create();
    SetId("north", "door");
    SetShort("north", "a door made from fine oak");
    SetLong("north", "It is a magnificent door marking the entrance to "
            "the fighter class hall.");
    SetLockable("north", 1);
    SetKeys("north", "special_key_id");
    SetId("south", "door");
    SetShort("south", "a door made from fine oak");
    SetLong("south", "It is a magnificent door leading out to the recruitment "
            "area.");
    SetLockable("south", 1);
    SetKeys("south", "special_key_id");
    SetClosed(1);
    SetLocked(0);
}
Ejemplo n.º 8
0
mitk::Label::Label() : PropertyList()
{
  if (GetProperty("locked") == nullptr)
    SetLocked(true);
  if (GetProperty("visible") == nullptr)
    SetVisible(true);
  if (GetProperty("opacity") == nullptr)
    SetOpacity(0.6);
  if (GetProperty("center.coordinates") == nullptr)
  {
    mitk::Point3D pnt;
    pnt.SetElement(0, 0);
    pnt.SetElement(1, 0);
    pnt.SetElement(2, 0);
    SetCenterOfMassCoordinates(pnt);
  }
  if (GetProperty("center.index") == nullptr)
  {
    mitk::Point3D pnt;
    pnt.SetElement(0, 0);
    pnt.SetElement(1, 0);
    pnt.SetElement(2, 0);
    SetCenterOfMassIndex(pnt);
  }
  if (GetProperty("color") == nullptr)
  {
    mitk::Color col;
    col.Set(0, 0, 0);
    SetColor(col);
  }
  if (GetProperty("name") == nullptr)
    SetName("noName!");
  if (GetProperty("value") == nullptr)
    SetValue(0);
  if (GetProperty("layer") == nullptr)
    SetLayer(0);

  DICOMSegmentationPropertyHandler::SetDICOMSegmentProperties(this);
}
Ejemplo n.º 9
0
void GameScene::Setup   (void           )
{
    auto background_texture     = LOAD_TEXTURE(GetContentManager()              ,
                                               L"background"                    ,
                                               L"assets\\game\\platform.png"    );

    // =====

    auto sprite                 = new DNDLayerSprites(L"root", GetRenderer());
    {
        sprite->SetLocked(true);

        auto background = new DNDEntity(L"background", PBSize(800, 480));
        {
            background->SetLocked(true);

            // uh lah?
            background->AddModel(L"default", new DNDModelSprite(background_texture));
        }
        background->Add(sprite);

        auto trainLeft = new DNDNode(L"train_left"      , DNDNodeSizingRule::None, PBSize(150, 480));
        {
            auto entity = trainLeft;
            auto trans  = entity->GetTransform();

            trans.SetLocation(PBPoint2(250, 0));

            entity->SetTransform(trans);

            auto train = new Train(L"train", true);
            {
                auto entity = train;
                auto trans  = entity->GetTransform();

                trans.SetLocation(PBPoint2(75, 0));

                entity->SetTransform(trans);
            }
            train->Add(trainLeft);
        }
        trainLeft->Add(sprite);

        auto trainRight = new DNDNode(L"train_right"    , DNDNodeSizingRule::None, PBSize(150, 480));
        {
            auto entity = trainRight;
            auto trans  = entity->GetTransform();

            trans.SetLocation(PBPoint2(400, 0));

            entity->SetTransform(trans);

            auto train = new Train(L"train", false);
            {
                auto entity = train;
                auto trans  = entity->GetTransform();

                trans.SetLocation(PBPoint2(75, 480));

                entity->SetTransform(trans);
            }
            train->Add(trainRight);
        }
        trainRight->Add(sprite);
    }
    sprite->Add(this);
}