void Start_TP() { Init_MCU(); InitializeTouchPanel(); InitializeObjects(); Delay_ms(1000); TFT_Fill_Screen(0); Calibrate(); TFT_Fill_Screen(0); InitializeObjects(); display_width = Screen1.Width; display_height = Screen1.Height; DrawScreen(&Screen1); }
void Start_TP() { Init_MCU(); InitializeTouchPanel(); // You can get calibration constants using touch panel calibration example TP_TFT_Set_Calibration_Consts(76, 907, 77, 915); // Set calibration constants InitializeObjects(); display_width = Screen1.Width; display_height = Screen1.Height; DrawScreen(&Screen1); }
void Start_TP() { Init_MCU(); InitializeTouchPanel(); // Delay_ms(1000); // TFTIntern_Fill_Screen(0); CalibrateIntern(); // TFTIntern_Fill_Screen(0); InitializeObjects(); display_width = HomeScreen.Width; display_height = HomeScreen.Height; DrawScreen(&HomeScreen); }
void dd::Systems::KrakenSystem::Initialize() { std::random_device rd; m_RandomGenerator = std::mt19937(rd()); EVENT_SUBSCRIBE_MEMBER(m_EPause, &KrakenSystem::OnPause); EVENT_SUBSCRIBE_MEMBER(m_EResume, &KrakenSystem::OnResume); EVENT_SUBSCRIBE_MEMBER(m_EContact, &KrakenSystem::OnContact); EVENT_SUBSCRIBE_MEMBER(m_EKrakenAppear, &KrakenSystem::OnKrakenAppear); EVENT_SUBSCRIBE_MEMBER(m_EKrakenAttack, &KrakenSystem::OnKrakenAttack); EVENT_SUBSCRIBE_MEMBER(m_EKrakenHit, &KrakenSystem::OnKrakenHit); EVENT_SUBSCRIBE_MEMBER(m_EKrakenDefeated, &KrakenSystem::OnKrakenDefeated); EVENT_SUBSCRIBE_MEMBER(m_EBrickGenerating, &KrakenSystem::OnBrickGenerating); EVENT_SUBSCRIBE_MEMBER(m_EArrivedAtNewStage, &KrakenSystem::OnArrivedAtNewStage); EntityID ent = m_World->CreateEntity(); auto transform = m_World->AddComponent<Components::Transform>(ent); transform->Position = glm::vec3(50, 50, -10); auto model = m_World->AddComponent<Components::Model>(ent); model->ModelFile = "Models/Kraken/Body.dae"; auto animationComponent = m_World->AddComponent<Components::Animation>(ent); animationComponent->Speed = 0.6f; auto kraken = m_World->AddComponent<Components::Kraken>(ent); std::shared_ptr<Components::RectangleShape> cRect = m_World->AddComponent<Components::RectangleShape>(ent); cRect->Dimensions = glm::vec2(10.f, 4.f); //cCircle->Radius = 2; std::shared_ptr<Components::Physics> cPhys = m_World->AddComponent<Components::Physics>(ent); cPhys->CollisionType = CollisionType::Type::Static; cPhys->GravityScale = 0.f; cPhys->Category = CollisionLayer::Type::Brick; cPhys->Mask = static_cast<CollisionLayer::Type>(CollisionLayer::Type::Ball | CollisionLayer::Type::Projectile | CollisionLayer::Type::Wall | CollisionLayer::LifeBuoy); std::shared_ptr<Components::Template> cTemplate = m_World->AddComponent<Components::Template>(ent); auto travels = m_World->AddComponent<Components::Travels>(ent); travels->CurrentlyTraveling = false; //sound auto collisionSound = m_World->AddComponent<Components::CollisionSound>(ent); collisionSound->FilePath = "Sounds/Boss/boss-hit.wav"; m_World->CommitEntity(ent); m_KrakenTemplate = ent; InitializeObjects(); }
void UI_Setup() { GPIO_Config(&GPIO_PORTA, 0b00001000, _GPIO_DIR_OUTPUT, _GPIO_CFG_DIGITAL_ENABLE | _GPIO_CFG_DRIVE_8mA, 0); // Init back light GPIO TFT_BACKLIGHT = 0; // We need to Unlock PR7 before we can use it as GPIO (MCU specific) GPIO_Unlock(_GPIO_COMMIT_PIN_B7); GPIO_Digital_Input(&GPIO_PORTB, _GPIO_PINMASK_0 | _GPIO_PINMASK_7); // Set Up and Left as digital input GPIO_Digital_Input(&GPIO_PORTE, _GPIO_PINMASK_4 | _GPIO_PINMASK_5); // Set Right and Down as digital input GPIO_Digital_Input(&GPIO_PORTH, _GPIO_PINMASK_2); // Set Center as digital input Delay_100ms(); TFT_Init(320, 240); TFT_Fill_Screen(0); InitializeObjects(); display_width = LoadingScreen.Width; display_height = LoadingScreen.Height; UI_LoadingScreen("Fetching IP address"); TFT_BACKLIGHT = 1; }
void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settings) { /* Make sure there isn't any window that can influence anything * related to the new game we're about to start/load. */ UnInitWindowSystem(); AllocateMap(size_x, size_y); _pause_mode = PM_UNPAUSED; _fast_forward = 0; _tick_counter = 0; _cur_tileloop_tile = 0; _thd.redsq = INVALID_TILE; if (reset_settings) MakeNewgameSettingsLive(); if (reset_date) { SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1), 0); InitializeOldNames(); } PoolBase::Clean(PT_NORMAL); ResetPersistentNewGRFData(); InitializeSound(); InitializeMusic(); InitializeVehicles(); InitNewsItemStructs(); InitializeLandscape(); InitializeRailGui(); InitializeRoadGui(); InitializeAirportGui(); InitializeDockGui(); InitializeObjectGui(); InitializeAIGui(); InitializeTrees(); InitializeIndustries(); InitializeObjects(); InitializeBuildingCounts(); InitializeNPF(); InitializeCompanies(); AI::Initialize(); Game::Initialize(); InitializeCheats(); InitTextEffects(); #ifdef ENABLE_NETWORK NetworkInitChatMessage(); #endif /* ENABLE_NETWORK */ InitializeAnimatedTiles(); InitializeEconomy(); ResetObjectToPlace(); GamelogReset(); GamelogStartAction(GLAT_START); GamelogRevision(); GamelogMode(); GamelogGRFAddList(_grfconfig); GamelogStopAction(); }
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance , LPSTR lpszCmdParam, int nCmdShow) { #if defined (DEBUG) | defined (_DEBUG) _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif //아이콘 로드 HICON hIcon = reinterpret_cast<HICON>(::LoadImage(hInstance, MAKEINTRESOURCE(IDI_ICON2), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR)); WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), hIcon, NULL, NULL, NULL, GENERIC::gAppName.c_str(), hIcon }; RegisterClassEx(&wc); DWORD style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX; HWND hWnd = CreateWindow(GENERIC::gAppName.c_str(), GENERIC::gAppName.c_str(), style, CW_USEDEFAULT, 0, GENERIC::windowWidth, GENERIC::windowHeight, GetDesktopWindow(), NULL, wc.hInstance, NULL); Console::Get()->Initialize("Debug Console", hInstance, hPrevInstance, lpszCmdParam, nCmdShow); DEBUG_CONSOLE("Hello!\n"); gAppPuased = false; InitializeObjects(hWnd); SetWindowRect(hWnd); ShowWindow(hWnd, SW_SHOWDEFAULT); UpdateWindow(hWnd); MSG msg; ZeroMemory(&msg, sizeof(msg)); while (msg.message != WM_QUIT) { if (PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } GameTimer::Get()->UpdateTickCount(); if (!gAppPuased) { float tick = GameTimer::Get()->DeltaTime(); General::Get()->Update(tick); //RenderDevice::Get()->UpdateScene(tick); RenderDevice::Get()->Render11(); CalculateFrameStats(hWnd); } else { Sleep(1); } } RenderDevice::Get()->Release(); UnregisterClass(GENERIC::gAppName.c_str(), wc.hInstance); return 0; }