void GameStart::Enter(Scene *pScene){ debug_printf("now enter GameStart\n"); GetMyApp()->ClearTexts(); std::string str = "now gamestart"; GetMyApp()->AddText(str); }
void GameStart::Render(){ GetMyApp()->RenderText(0,0); }
void Option::Render(){ GetMyApp()->RenderText(0,0); }
void Option::Enter(Scene *pScene){ debug_printf("now enter Option\n"); GetMyApp()->ClearTexts(); std::string str = "now option"; GetMyApp()->AddText(str); }
void CApp::MainThread(){ // シーンコントローラーにSceneFactoryを渡してやる CSceneControl sc(smart_ptr<CSceneFactory>(new Cf3SceneFactory(this),true)); int scene = FIRST_SCENE; // テストじゃないかな? { CLineParser l; l.SetLine(CAppInitializer::GetCmdLine()); if (l.IsMatch("TEST")) { scene = GAME_SCENE; CGameScene::m_bTest = true; l.GetStr(m_StageFileName); m_StageFileName += ".f3s"; l.GetNum(CGameScene::m_nStage); CGameScene::m_bVisibleHit = l.IsMatch("VISIBLEHIT"); }ef(l.IsMatch("REPLAY")) { scene = REPLAY_SCENE; l.GetStr(m_StageFileName); m_StageFileName += ".f3r"; }ef(l.IsMatch("RECORD")) { CReplayScene::record = true; m_Setting.m_FullScreen = false; scene = REPLAY_SCENE; l.GetStr(m_StageFileName); m_StageFileName += ".f3r"; } } sc.JumpScene(scene); // 準備完了まで著作権表示 m_Backup.CreateSurface(320, 240); SetFullScreen(m_Setting.m_FullScreen!=0); { CTextDIB32 tx; int w,h; tx.GetFont()->SetText("TokioSoft"); tx.GetFont()->SetSize(32); tx.GetFont()->SetColor(0xffffff); tx.GetFont()->SetBackColor(0x303030); tx.UpdateText(); tx.GetSize(w,h); GetDIB()->Blt(&tx,160-w/2,120-h/2); m_Draw.OnDraw(NULL,false); } // で、準備 CFPSTimer& t = *(m_FPS = new CFPSTimer); CFPSLayer l(&t); t.SetFPS((m_Setting.m_TimeMaster&&m_Setting.m_FPS)?m_Setting.m_FPS:40); m_BGM = new CBGMBase; m_BGMMode = BGMM_NONE; ChangeBGM((BGMMode)m_Setting.m_BGMMode); f3Input.Init(m_Setting.m_Key); Cf3Map::SetEffect(m_Setting.m_DrawMethod); Cf3MapObjectMain::SetInput(&KeyInput); ResourceManager.Init(); while (IsThreadValid()) { if (m_Setting.m_Background||GetForegroundWindow()==GetMyApp()->GetHWnd()) { if (m_Setting.m_Background>=2||GetForegroundWindow()==GetMyApp()->GetHWnd()) f3Input.Input(); if (f3Input.GetKeyPushed(F3KEY_EXIT)) break; // BGMの操作 if (m_AutoDraw) { if (f3Input.GetKeyPushed(F3KEY_BGMNONE)) ChangeBGM(BGMM_NONE); if (f3Input.GetKeyPushed(F3KEY_BGMDEF )) ChangeBGM(BGMM_DEFAULT); if (f3Input.GetKeyPushed(F3KEY_BGMUSER)) ChangeBGM(BGMM_USER); } m_BGM->Update(); // CPlaneBaseじゃなくてCDIB32を使って呼び出す(これでCDIB32の全ての機能が使える) if (sc.OnDraw(GetDIB())) break; if (m_AutoDraw) { l.Enable(f3Input.GetKeyPressed(F3KEY_FPS)); m_Draw.OnDraw(); if (f3Input.GetKeyPushed(F3KEY_CAPTURE)) ScreenCapture(); if (m_AVI) m_AVI->Write(GetDIB()); } } t.WaitFrame(); } ResourceManager.Quit(); }