Beispiel #1
0
void ComplxFrame::OnRunComplete(wxThreadEvent& event)
{
    std::cout.flush();
    console->Update();
    UpdatePlay();
    UpdateRegisters();
    UpdateMemory();
    UpdateStatus();
}
Beispiel #2
0
/** @brief OnIo
  *
  * @todo: document this function
  */
void ComplxFrame::OnGetIo()
{
    wxCriticalSectionLocker enter(threadCS);
    if (thread != NULL && thread->IsPaused())
    {
        refreshednoio = false;
        UpdatePlay();
        thread->Resume();
    }
}
int StateMenu::Update(const double delta_time) {
    m_AnimBg->Update( delta_time );
    m_AnimClick->Update( delta_time );
    m_AnimGreenPop->Update( delta_time );
    m_AnimBluePop->Update( delta_time );
    gui::GUIManager::GetInstance().Update(delta_time);
    // __asm int 9;
    switch( m_SubState ) {
    case SUBSTATE::IGM :
        // update IGM
        break;
    case SUBSTATE::MAIN :
        UpdatePlay( delta_time );
        break;
    }
    return m_SubState;
}
Beispiel #4
0
void ComplxFrame::SetupExecution(int run_mode, int runtime)
{
    wxCriticalSectionLocker enter(threadCS);
    changed = false;
    if (thread != NULL)
    {
        if (thread->IsPaused()) return;
        if (thread->IsRunning())
        {
            //printf("Deleting thread\n");
            thread->Delete();
            //delete thread;
            thread = NULL;
            changed = true;
            std::cout.flush();
            console->Update();
            UpdatePlay();
            UpdateRegisters();
            UpdateMemory();
            UpdateStatus();
            return;
        }
        else
        {
//            //printf("Deleting and Creating thread\n");
            thread->Delete();
            thread = NULL;
            //delete thread;
            //thread = new LC3RunThread(this, run_mode);
            //thread->Create();
            //UpdateStop();
            return;
        }
    }
    else
    {
        //printf("Creating thread\n");
        thread = new LC3RunThread(this, run_mode, runtime);
        thread->Create();
        //UpdateStop();
    }

    thread->SetPriority(0);
    thread->Run();
}
Beispiel #5
0
void ComplxFrame::SetupExecution(int run_mode, int runtime)
{
    wxCriticalSectionLocker enter(threadCS);
    if (run_mode != RUNMODE_STEP && run_mode != RUNMODE_BACK)
        UpdatePhrase("&Stop");
    if (thread != NULL)
    {
        if (thread->IsPaused()) return;
        if (thread->IsRunning())
        {
            thread->Delete();
            thread = NULL;
            std::cout.flush();
            console->Update();
            UpdatePlay();
            UpdateRegisters();
            UpdateMemory();
            UpdateStatus();
            return;
        }
        else
        {
            thread->Delete();
            thread = NULL;
            return;
        }
    }
    else
    {
        thread = new LC3RunThread(this, run_mode, runtime);
        thread->Create();
    }

    thread->SetPriority(0);
    thread->Run();
}
Beispiel #6
0
void idWorldManager::Think( void )
{
	int i;
	UpdateRecord();

	for (i = 0; i < 3; i++)
	{
		idVec4 markerColor;
		idVec3 markerPos;
		int markerRadius = 24;

		if (records[i].playing)
		{
			UpdatePlay(i);
		}
		else
		{
			continue;
		}

		if (state == OFF && index != -1 /*caser*/)
		{
			continue;
		}

		if (this->index == i)
		{
			continue;
		}

		if (!records[i].ghost->IsHidden())
		{
			if ((int)(gameLocal.time * 0.004) % 3 == 0)
			{
				markerRadius = 12;
			}

			switch (i)
			{
				case 0:		markerColor = idVec4(.25, .75, 1, 1); break; //blue.
				case 1:		markerColor = idVec4(.74, .9, .26, 1); break;  //green.
				default:	markerColor = idVec4(1, .6, 0, 1); break; //orange.
			}

			//blue .25, .75, 1
			//yellow 1, .8, 0, 1
			//red .9, .25, .25

			markerPos = records[i].ghost->GetPhysics()->GetOrigin() + idVec3(0,0,85);
			gameRenderWorld->DebugLine( markerColor, markerPos + idVec3(0,0,-markerRadius), markerPos + idVec3(0,0,markerRadius) );
			gameRenderWorld->DebugLine( markerColor, markerPos + idVec3(0,-markerRadius,0), markerPos + idVec3(0,markerRadius,0) );
			gameRenderWorld->DebugLine( markerColor, markerPos + idVec3(-markerRadius,0,0), markerPos + idVec3(markerRadius,0,0) );

			if (index == -1)
			{
				//draw lines.
				int k;

				if (recordlines[i].lines.Num() >= 3)
				{
					for (k = 0; k < recordlines[i].lines.Num() - 1; k++)
					{
						if (k > 2) //BC hack. The initial lines are garbage data. So, just skip them.
						{
							gameRenderWorld->DebugLine( markerColor, 
								recordlines[i].lines[k].position1, recordlines[i].lines[k].position2 );
						}
					}


					//This is the dangly bit that connects the last recordline position to the character model's feet.
					if (records[i].index < recordlines[i].lines.Num() && i > 1)
					{
						gameRenderWorld->DebugLine( markerColor, 
							recordlines[i].lines[records[i].index].position1,
							records[i].ghost->GetPhysics()->GetOrigin() );
					}
				}
			}
		}
	}
}