void Game::Update()
{
    srand((int)RF_Engine::instance->time->currentTime);

    deltaCount += RF_Engine::instance->time->deltaTime;
    if(deltaCount >= 0.05f)
    {
        deltaCount = 0.0f;

        if(false == losed)
        {
            InputUpdate();
            SnakeUpdate();
            GridUpdate();
        }
        else
        {
            if(RF_Engine::instance->key[_return])
            {
                restart();
            }
        }

        handiCam();
        shakeCam();
        pL->drawAlone(bg);
    }
}
Beispiel #2
0
void EcuHacksMainRPM() //RPM based Hz main routine
{
#if REVLIM_HACKS
	RevLimCode();
#endif

#if SWITCH_HACKS
	InputUpdate();
#endif
}
Beispiel #3
0
void Direct3DRender(HWND hwnd)
{
	gPD3DDevice->Clear(0, nullptr, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
	gPD3DDevice->BeginScene();
	
	InputUpdate();
	MatrixSet();

	RECT formatRect;
	GetClientRect(hwnd, &formatRect);

	for (int i = 0; i < gDwNumMtrl; i++)
	{
		gPD3DDevice->SetMaterial(&gPMaterial[i]);
		gPD3DDevice->SetTexture(0, gPTexture[i]);
		gPCharacter->DrawSubset(i);
	}

	int strLen = swprintf_s(gStrFPS, _T("FPS: %f"), 123.45f);
	gPTextFPSFont->DrawTextW(nullptr, gStrFPS, strLen, &formatRect, DT_TOP | DT_RIGHT, D3DCOLOR_XRGB(0, 239, 136));	
	strLen = sizeof(gStrAdapterDesc);
	gPTextAdapterFont->DrawTextW(nullptr, gStrAdapterDesc, -1, &formatRect, DT_TOP | DT_LEFT, D3DCOLOR_XRGB(23, 23, 236));

	formatRect.top = 30;
	static wchar_t strInfo[256] = { 0 };
	swprintf_s(strInfo, -1, L"模型坐标: (%.2f, %.2f, %.2f)", gMatWorld._41, gMatWorld._42, gMatWorld._43);
	gPTextHelperFont->DrawText(NULL, strInfo, -1, &formatRect, DT_SINGLELINE | DT_NOCLIP | DT_LEFT, D3DCOLOR_RGBA(135, 239, 136, 255));

	formatRect.top = WINDOW_HEIGHT * 2 / 3;
	gPTextInfoFont->DrawTextW(nullptr, _T("控制说明:"), -1, &formatRect, DT_NOCLIP|DT_LEFT | DT_SINGLELINE, D3DCOLOR_XRGB(23, 25, 111));
	formatRect.top += 35;
	formatRect.left += 50;
	gPTextHelperFont->DrawText(NULL, L"按住鼠标左键并拖动:平移模型", -1, &formatRect,
		DT_SINGLELINE | DT_NOCLIP | DT_LEFT, D3DCOLOR_RGBA(255, 200, 0, 255));
	formatRect.top += 25;
	gPTextHelperFont->DrawText(NULL, L"按住鼠标右键并拖动:旋转模型", -1, &formatRect,
		DT_SINGLELINE | DT_NOCLIP | DT_LEFT, D3DCOLOR_RGBA(255, 200, 0, 255));
	formatRect.top += 25;
	gPTextHelperFont->DrawText(NULL, L"滑动鼠标滚轮:拉伸模型", -1, &formatRect,
		DT_SINGLELINE | DT_NOCLIP | DT_LEFT, D3DCOLOR_RGBA(255, 200, 0, 255));
	formatRect.top += 25;
	gPTextHelperFont->DrawText(NULL, L"W、S、A、D键:平移模型 ", -1, &formatRect,
		DT_SINGLELINE | DT_NOCLIP | DT_LEFT, D3DCOLOR_RGBA(255, 200, 0, 255));
	formatRect.top += 25;
	gPTextHelperFont->DrawText(NULL, L"上、下、左、右方向键:旋转模型 ", -1, &formatRect,
		DT_SINGLELINE | DT_NOCLIP | DT_LEFT, D3DCOLOR_RGBA(255, 200, 0, 255));
	formatRect.top += 25;
	gPTextHelperFont->DrawText(NULL, L"ESC键 : 退出程序", -1, &formatRect,
		DT_SINGLELINE | DT_NOCLIP | DT_LEFT, D3DCOLOR_RGBA(255, 200, 0, 255));


	gPD3DDevice->EndScene();
	gPD3DDevice->Present(nullptr, nullptr, nullptr, nullptr);

}
Beispiel #4
0
int LoopCode()
{

  // Main loop:
  while (!LoopQuit)
  {
    InputUpdate();

    DirectClear(0);
    ModeUpdate();
    ModeRender();
    DirectPresent();
//      UpdateSound();
  }

  return 0;
}
Beispiel #5
0
//-----------------------------------------------------------------------------------------------
void Game::Update( float deltaSeconds, Keyboard& keyInput, const Mouse& mouseInput, const Xbox::Controller& xboxInput )
{
	Debug::UpdateDrawings( deltaSeconds );

	if( keyInput.KeyIsPressed( Keyboard::GRAVE ) )
		m_consoleVisible = !m_consoleVisible;

	if( m_consoleVisible )
	{
		UpdateConsoleInput( deltaSeconds, keyInput, mouseInput );
		m_console->Update( deltaSeconds );
	}
	else
	{
		InputUpdate( deltaSeconds, keyInput, mouseInput, xboxInput );
	}

	GameUpdate( deltaSeconds );
}
Beispiel #6
0
//=============================================================================
//	更新処理
//=============================================================================
void CSceneResult::Update()
{
	InputUpdate();
	renderer->Update();
}
Beispiel #7
0
//=============================================================================
//	更新処理
//=============================================================================
void CSceneStageSelect::Update()
{
	InputUpdate();
	renderer->Update();
}