Game::Game(const SystemPath &path, const vector3d &pos, double time) : m_time(time), m_state(STATE_NORMAL), m_wantHyperspace(false), m_timeAccel(TIMEACCEL_1X), m_requestedTimeAccel(TIMEACCEL_1X), m_forceTimeAccel(false) { Pi::FlushCaches(); m_space.reset(new Space(this, path)); Body *b = m_space->FindBodyForPath(&path); assert(b); m_player.reset(new Player("kanara")); m_space->AddBody(m_player.get()); m_player->SetFrame(b->GetFrame()); m_player->SetPosition(pos); m_player->SetVelocity(vector3d(0,0,0)); Polit::Init(); CreateViews(); }
//初期化 void GameStage::Create(){ try{ //リソースの作成 CreateResourses(); //ビュー類を作成する CreateViews(); //プレートの作成 CreatePlate(); //追いかけるオブジェクトの作成 CreateSeekObject(); //固定のボックスの作成 CreateFixedBox(); //上下移動しているボックスの作成 CreateMoveBox(); //カプセル作成 CreateCapsule(); //球体作成 CreateSphere(); //衝突するスクエアの作成 CreateHitTestSquare(); //プレーヤーの作成 CreatePlayer(); } catch (...){ throw; } }
Game::Game(const SystemPath &path, double time) : m_time(time), m_state(STATE_NORMAL), m_wantHyperspace(false), m_timeAccel(TIMEACCEL_1X), m_requestedTimeAccel(TIMEACCEL_1X), m_forceTimeAccel(false) { Pi::FlushCaches(); m_space.reset(new Space(this, path)); SpaceStation *station = static_cast<SpaceStation*>(m_space->FindBodyForPath(&path)); assert(station); m_player.reset(new Player("kanara")); m_space->AddBody(m_player.get()); m_player->SetFrame(station->GetFrame()); m_player->SetDockedWith(station, 0); Polit::Init(); CreateViews(); }
//初期化 void GameStage::OnCreate(){ try{ //ビュー類を作成する CreateViews(); } catch (...){ throw; } }
Game::Game(const SystemPath &path, double time) : m_galaxy(GalaxyGenerator::Create()), m_time(time), m_state(STATE_NORMAL), m_wantHyperspace(false), m_timeAccel(TIMEACCEL_1X), m_requestedTimeAccel(TIMEACCEL_1X), m_forceTimeAccel(false) { // Now that we have a Galaxy, check the starting location if (!path.IsBodyPath()) throw InvalidGameStartLocation("SystemPath is not a body path"); RefCountedPtr<const Sector> s = m_galaxy->GetSector(path); if (size_t(path.systemIndex) >= s->m_systems.size()) { char buf[128]; std::sprintf(buf, "System %u in sector <%d,%d,%d> does not exist", unsigned(path.systemIndex), int(path.sectorX), int(path.sectorY), int(path.sectorZ)); throw InvalidGameStartLocation(std::string(buf)); } RefCountedPtr<StarSystem> sys = m_galaxy->GetStarSystem(path); if (path.bodyIndex >= sys->GetNumBodies()) { char buf[256]; std::sprintf(buf, "Body %d in system <%d,%d,%d : %d ('%s')> does not exist", unsigned(path.bodyIndex), int(path.sectorX), int(path.sectorY), int(path.sectorZ), unsigned(path.systemIndex), sys->GetName().c_str()); throw InvalidGameStartLocation(std::string(buf)); } m_space.reset(new Space(this, m_galaxy, path)); Body *b = m_space->FindBodyForPath(&path); assert(b); m_player.reset(new Player("kanara")); m_space->AddBody(m_player.get()); m_player->SetFrame(b->GetFrame()); if (b->GetType() == Object::SPACESTATION) { m_player->SetDockedWith(static_cast<SpaceStation*>(b), 0); } else { const SystemBody *sbody = b->GetSystemBody(); m_player->SetPosition(vector3d(0, 1.5*sbody->GetRadius(), 0)); m_player->SetVelocity(vector3d(0,0,0)); } Polit::Init(m_galaxy); CreateViews(); EmitPauseState(IsPaused()); }
//初期化 void GameStage::OnCreate(){ try{ //リソースの作成 CreateResourses(); //ビュー類を作成する CreateViews(); //プレートを作成する CreatePlate(); //ボックスの作成 CreateBox(); } catch (...){ throw; } }
void CGUIWindowPVR::OnWindowLoaded(void) { CreateViews(); CGUIMediaWindow::OnWindowLoaded(); m_viewControl.Reset(); m_viewControl.SetParentWindow(GetID()); m_viewControl.AddView(GetControl(CONTROL_LIST_CHANNELS_TV)); m_viewControl.AddView(GetControl(CONTROL_LIST_CHANNELS_RADIO)); m_viewControl.AddView(GetControl(CONTROL_LIST_RECORDINGS)); m_viewControl.AddView(GetControl(CONTROL_LIST_TIMERS)); m_viewControl.AddView(GetControl(CONTROL_LIST_GUIDE_CHANNEL)); m_viewControl.AddView(GetControl(CONTROL_LIST_GUIDE_NOW_NEXT)); m_viewControl.AddView(GetControl(CONTROL_LIST_TIMELINE)); m_viewControl.AddView(GetControl(CONTROL_LIST_SEARCH)); }
//初期化 void GameStage::OnCreate(){ try{ //リソースの作成 CreateResourses(); //ビュー類を作成する CreateViews(); //プレートを作成する CreatePlate(); //カスタムボックスの作成 CreateCustomDrawBox(); //プレーヤーの作成 CreatePlayer(); } catch (...){ throw; } }
void CGUIWindowPVR::OnInitWindow(void) { if (!CPVRManager::Get()->IsStarted() || !CPVRManager::GetClients()->HasActiveClients()) { g_windowManager.PreviousWindow(); CGUIDialogOK::ShowAndGetInput(19033,0,19045,19044); return; } CreateViews(); CSingleLock lock(m_critSection); if (m_savedSubwindow) m_savedSubwindow->OnInitWindow(); lock.Leave(); CGUIMediaWindow::OnInitWindow(); }
//初期化 void GameStage::OnCreate(){ try{ //リソースの作成 CreateResourses(); //ビュー類を作成する CreateViews(); //プレートを作成する CreatePlate(); //固定のボックスの作成 CreateFixedBox(); //プレーヤーの作成 CreatePlayer(); //Eggの作成 CreateEgg(); } catch (...){ throw; } }
//初期化 void GameStage::Create(){ try{ //リソースの作成 CreateResourses(); //ビュー類を作成する CreateViews(); //プレートを作成する CreatePlate(); //追いかけるオブジェクトの作成 CreateSeekObject(); //プレーヤーの作成 CreatePlayer(); } catch (...){ throw; } }
MidiPlayerWindow::MidiPlayerWindow() : BWindow(BRect(0, 0, 1, 1), B_TRANSLATE("MidiPlayer"), B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS) { playing = false; scopeEnabled = true; reverb = B_REVERB_BALLROOM; volume = 75; windowX = -1; windowY = -1; inputId = -1; instrLoaded = false; be_synth->SetSamplingRate(44100); bridge = new SynthBridge; //bridge->Register(); CreateViews(); LoadSettings(); InitControls(); }
Game::Game(const SystemPath &path) : m_time(0), m_state(STATE_NORMAL), m_wantHyperspace(false), m_timeAccel(TIMEACCEL_1X), m_requestedTimeAccel(TIMEACCEL_1X), m_forceTimeAccel(false) { m_space.Reset(new Space(this, path)); SpaceStation *station = static_cast<SpaceStation*>(m_space->FindBodyForPath(&path)); assert(station); CreatePlayer(); m_space->AddBody(m_player.Get()); m_player->Enable(); m_player->SetFrame(station->GetFrame()); m_player->SetDockedWith(station, 0); CreateViews(); }
//初期化 void GameStage::OnCreate(){ try{ //リソースの作成 CreateResourses(); //ビュー類を作成する CreateViews(); //プレートを作成する CreatePlate(); //固定のボックスの作成 CreateFixedBox(); //上下移動しているボックスの作成 CreateMoveBox(); //透過するボックスの作成 CreateTraceBox(); //透過する球体の作成 CreateTraceSphere(); //プレーヤーの作成 CreatePlayer(); } catch (...){ throw; } }
Game::Game(const SystemPath &path, const vector3d &pos) : m_time(0), m_state(STATE_NORMAL), m_wantHyperspace(false), m_timeAccel(TIMEACCEL_1X), m_requestedTimeAccel(TIMEACCEL_1X), m_forceTimeAccel(false) { m_space.Reset(new Space(this, path)); Body *b = m_space->FindBodyForPath(&path); assert(b); CreatePlayer(); m_space->AddBody(m_player.Get()); m_player->Enable(); m_player->SetFrame(b->GetFrame()); m_player->SetPosition(pos); m_player->SetVelocity(vector3d(0,0,0)); CreateViews(); }
HRESULT WEHDR::Create(ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext) { HRESULT hr; m_pd3dDevice = pd3dDevice; m_pImmediateContext = pd3dImmediateContext; // Create views. V_RETURN(CreateViews()); // Create shaders. ID3DBlob* pPSBlob2x2 = NULL; ID3DBlob* pPSBlob3x3 = NULL; ID3DBlob* pPSBlobBrightPass = NULL; ID3DBlob* pPSBlobBloom = NULL; ID3DBlob* pPSBlobFinal = NULL; V_RETURN(WE::CompileShaderFromFile(L"shaders\\HDR.hlsl", NULL, "DownScale2x2_Lum", "ps_5_0", &pPSBlob2x2)); V_RETURN(WE::CompileShaderFromFile(L"shaders\\HDR.hlsl", NULL, "DownScale3x3", "ps_5_0", &pPSBlob3x3)); V_RETURN(WE::CompileShaderFromFile(L"shaders\\HDR.hlsl", NULL, "DownScale3x3_BrightPass", "ps_5_0", &pPSBlobBrightPass)); V_RETURN(WE::CompileShaderFromFile(L"shaders\\HDR.hlsl", NULL, "Bloom", "ps_5_0", &pPSBlobBloom)); V_RETURN(WE::CompileShaderFromFile(L"shaders\\HDR.hlsl", NULL, "FinalPass", "ps_5_0", &pPSBlobFinal)); V_RETURN(pd3dDevice->CreatePixelShader(pPSBlob2x2->GetBufferPointer(), pPSBlob2x2->GetBufferSize(), NULL, &m_pPSDownScale2x2Lum)); V_RETURN(pd3dDevice->CreatePixelShader(pPSBlob3x3->GetBufferPointer(), pPSBlob3x3->GetBufferSize(), NULL, &m_pPSDownScale3x3)); V_RETURN(pd3dDevice->CreatePixelShader(pPSBlobBrightPass->GetBufferPointer(), pPSBlobBrightPass->GetBufferSize(), NULL, &m_pPSBrightPass)); V_RETURN(pd3dDevice->CreatePixelShader(pPSBlobBloom->GetBufferPointer(), pPSBlobBloom->GetBufferSize(), NULL, &m_pPSBloom)); V_RETURN(pd3dDevice->CreatePixelShader(pPSBlobFinal->GetBufferPointer(), pPSBlobFinal->GetBufferSize(), NULL, &m_pPSFinalPass)); SAFE_RELEASE(pPSBlob2x2); SAFE_RELEASE(pPSBlob3x3); SAFE_RELEASE(pPSBlobBrightPass); SAFE_RELEASE(pPSBlobBloom); SAFE_RELEASE(pPSBlobFinal); // Create the texture sampler state. D3D11_SAMPLER_DESC samplerDesc; samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT; samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; samplerDesc.MipLODBias = 0.0f; samplerDesc.MaxAnisotropy = 1; samplerDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS; samplerDesc.BorderColor[0] = 0; samplerDesc.BorderColor[1] = 0; samplerDesc.BorderColor[2] = 0; samplerDesc.BorderColor[3] = 0; samplerDesc.MinLOD = 0; samplerDesc.MaxLOD = D3D11_FLOAT32_MAX; V_RETURN(WE::D3DDevice()->CreateSamplerState(&samplerDesc, &m_pSamplePoint)); samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; V_RETURN(WE::D3DDevice()->CreateSamplerState(&samplerDesc, &m_pSampleLinear)); // Create the constant buffer pointer so we can access the pixel shader constant buffer from within this class. D3D11_BUFFER_DESC bufferDesc; bufferDesc.Usage = D3D11_USAGE_DYNAMIC; bufferDesc.ByteWidth = sizeof(BufferType); bufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; bufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; bufferDesc.MiscFlags = 0; bufferDesc.StructureByteStride = 0; V_RETURN(pd3dDevice->CreateBuffer(&bufferDesc, NULL, &m_pcbBloom)); // V_RETURN(CreateViews()); return S_OK; }