X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。
リビジョン | 342 (tree) |
---|---|
日時 | 2022-12-14 08:55:53 |
作者 | ![]() |
DirectXのデバイスロスト時のリセット処理を改善
@@ -155,9 +155,9 @@ | ||
155 | 155 | //リストを正しく解放するため、予め呼ぶ。 |
156 | 156 | Resource.CleanupHumanTexture(); |
157 | 157 | |
158 | - int rtn = d3dg.ResetD3D(WindowCtrl); | |
158 | + int ReturnCode = d3dg.ResetD3D(WindowCtrl); | |
159 | 159 | |
160 | - if( rtn == 0 ){ | |
160 | + if( ReturnCode == 0 ){ | |
161 | 161 | //リソースを初期化 |
162 | 162 | Resource.LoadHumanModel(); |
163 | 163 | Resource.LoadWeaponModelTexture(); |
@@ -169,10 +169,10 @@ | ||
169 | 169 | //WindowCtrl->ErrorInfo("Recovery..."); |
170 | 170 | return 0; |
171 | 171 | } |
172 | - if( rtn == 1 ){ | |
172 | + if( ReturnCode == 1 ){ | |
173 | 173 | return 1; |
174 | 174 | } |
175 | - //if( rtn == 2 ){ | |
175 | + //if( ReturnCode == 2 ){ | |
176 | 176 | //WindowCtrl->ErrorInfo("Resetに失敗しました"); |
177 | 177 | //WindowCtrl->CloseWindow(); |
178 | 178 | return -1; |
@@ -4858,11 +4858,13 @@ | ||
4858 | 4858 | Opening->Sound(); |
4859 | 4859 | if( (GameConfig.GetFrameskipFlag() == false)||(framecnt%2 == 0) ){ |
4860 | 4860 | if( Opening->RenderMain() == true ){ |
4861 | - if( ResetGame(WindowCtrl) != 0 ){ | |
4861 | + int ReturnCode; | |
4862 | + ReturnCode = ResetGame(WindowCtrl); | |
4863 | + if( ReturnCode == 2 ){ | |
4862 | 4864 | WindowCtrl->ErrorInfo("Resetに失敗しました"); |
4863 | 4865 | WindowCtrl->CloseWindow(); |
4864 | 4866 | } |
4865 | - else{ | |
4867 | + else if( ReturnCode == 0 ){ | |
4866 | 4868 | Opening->Recovery(); |
4867 | 4869 | |
4868 | 4870 | //現在の画面を再スタートさせる |
@@ -4898,11 +4900,13 @@ | ||
4898 | 4900 | MainMenu->Sound(); |
4899 | 4901 | if( (GameConfig.GetFrameskipFlag() == false)||(framecnt%2 == 0) ){ |
4900 | 4902 | if( MainMenu->RenderMain() == true ){ |
4901 | - if( ResetGame(WindowCtrl) != 0 ){ | |
4903 | + int ReturnCode; | |
4904 | + ReturnCode = ResetGame(WindowCtrl); | |
4905 | + if( ReturnCode == 2 ){ | |
4902 | 4906 | WindowCtrl->ErrorInfo("Resetに失敗しました"); |
4903 | 4907 | WindowCtrl->CloseWindow(); |
4904 | 4908 | } |
4905 | - else{ | |
4909 | + else if( ReturnCode == 0 ){ | |
4906 | 4910 | MainMenu->Recovery(); |
4907 | 4911 | |
4908 | 4912 | //現在の画面を再スタートさせる |
@@ -4932,11 +4936,13 @@ | ||
4932 | 4936 | Briefing->Process(); |
4933 | 4937 | if( (GameConfig.GetFrameskipFlag() == false)||(framecnt%2 == 0) ){ |
4934 | 4938 | if( Briefing->RenderMain() == true ){ |
4935 | - if( ResetGame(WindowCtrl) != 0 ){ | |
4939 | + int ReturnCode; | |
4940 | + ReturnCode = ResetGame(WindowCtrl); | |
4941 | + if( ReturnCode == 2 ){ | |
4936 | 4942 | WindowCtrl->ErrorInfo("Resetに失敗しました"); |
4937 | 4943 | WindowCtrl->CloseWindow(); |
4938 | 4944 | } |
4939 | - else{ | |
4945 | + else if( ReturnCode == 0 ){ | |
4940 | 4946 | Briefing->Recovery(); |
4941 | 4947 | |
4942 | 4948 | //現在の画面を再スタートさせる |
@@ -4974,11 +4980,13 @@ | ||
4974 | 4980 | } |
4975 | 4981 | if( (GameConfig.GetFrameskipFlag() == false)||(framecnt%2 == 0) ){ |
4976 | 4982 | if( MainGame->RenderMain() == true ){ |
4977 | - if( ResetGame(WindowCtrl) != 0 ){ | |
4983 | + int ReturnCode; | |
4984 | + ReturnCode = ResetGame(WindowCtrl); | |
4985 | + if( ReturnCode == 2 ){ | |
4978 | 4986 | WindowCtrl->ErrorInfo("Resetに失敗しました"); |
4979 | 4987 | WindowCtrl->CloseWindow(); |
4980 | 4988 | } |
4981 | - else{ | |
4989 | + else if( ReturnCode == 0 ){ | |
4982 | 4990 | MainGame->Recovery(); |
4983 | 4991 | |
4984 | 4992 | //現在の画面を再スタートさせる |
@@ -5004,11 +5012,13 @@ | ||
5004 | 5012 | Result->Process(); |
5005 | 5013 | if( (GameConfig.GetFrameskipFlag() == false)||(framecnt%2 == 0) ){ |
5006 | 5014 | if( Result->RenderMain() == true ){ |
5007 | - if( ResetGame(WindowCtrl) != 0 ){ | |
5015 | + int ReturnCode; | |
5016 | + ReturnCode = ResetGame(WindowCtrl); | |
5017 | + if( ReturnCode == 2 ){ | |
5008 | 5018 | WindowCtrl->ErrorInfo("Resetに失敗しました"); |
5009 | 5019 | WindowCtrl->CloseWindow(); |
5010 | 5020 | } |
5011 | - else{ | |
5021 | + else if( ReturnCode == 0 ){ | |
5012 | 5022 | Result->Recovery(); |
5013 | 5023 | |
5014 | 5024 | //現在の画面を再スタートさせる |