• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。


Commit MetaInfo

Revision159 (tree)
Time2017-01-09 23:53:27
Authorxops-mikan

Log Message

オープニングシーンのカメラワークなどを改善、メニュー画面のスクロールバーに関するバグの修正

Change Summary

Incremental Difference

--- trunk/gamemain.cpp (revision 158)
+++ trunk/gamemain.cpp (revision 159)
@@ -172,7 +172,13 @@
172172
173173 //! @brief コンストラクタ
174174 opening::opening()
175-{}
175+{
176+ add_camera_x = 0.0f;
177+ add_camera_y = 0.0f;
178+ add_camera_z = 0.0f;
179+ add_camera_rx = 0.0f;
180+ add_camera_ry = 0.0f;
181+}
176182
177183 //! @brief ディストラクタ
178184 opening::~opening()
@@ -225,6 +231,17 @@
225231 inputCtrl->MoveMouseCenter();
226232 framecnt = 0;
227233
234+ camera_x = -5.0f;
235+ camera_y = 58.0f;
236+ camera_z = 29.0f;
237+ camera_rx = DegreeToRadian(206);
238+ camera_ry = DegreeToRadian(12);
239+ add_camera_x = 0.0f;
240+ add_camera_y = 0.0f;
241+ add_camera_z = 0.0f;
242+ add_camera_rx = 0.0f;
243+ add_camera_ry = 0.0f;
244+
228245 GameState->NextState();
229246 return 0;
230247 }
@@ -272,23 +289,45 @@
272289 HumanAI[i].Process();
273290 }
274291
275- //カメラワークを求める
276- if( framecnt < 3*((int)GAMEFPS) ){
277- camera_x = -5.0f;
278- camera_y = 58.0f;
279- camera_z = 29.0f;
280- camera_rx = DegreeToRadian(206);
281- camera_ry = DegreeToRadian(12);
292+ //カメラワークを求める(座標)
293+ if( framecnt < (int)(4.0f*GAMEFPS) ){
294+ add_camera_z = 0.0f;
295+ add_camera_y = 0.0f;
282296 }
283- else if( framecnt < 5*((int)GAMEFPS) ){
284- camera_rx += DegreeToRadian(1.1f);
285- camera_ry -= DegreeToRadian(0.7f);
297+ else if( framecnt < (int)(5.0f*GAMEFPS) ){
298+ add_camera_z += (0.08f - add_camera_z) / 5.0f;
299+ add_camera_y += (-0.05f - add_camera_y) / 5.0f;
286300 }
287- else if( framecnt < 17*((int)GAMEFPS) ){
288- camera_z += 0.08f;
289- camera_y -= 0.05f;
301+ else{
302+ add_camera_z = 0.08f;
303+ add_camera_y = -0.05f;
290304 }
291- else {
305+ camera_x += add_camera_x;
306+ camera_y += add_camera_y;
307+ camera_z += add_camera_z;
308+
309+ //カメラワークを求める(回転)
310+ if( framecnt < (int)(2.6f*GAMEFPS) ){
311+ add_camera_rx = 0.0f;
312+ add_camera_ry = 0.0f;
313+ }
314+ else if( framecnt < (int)(3.6f*GAMEFPS) ){
315+ add_camera_rx += (DegreeToRadian(0.9f) - add_camera_rx) / 5.0f;
316+ add_camera_ry += (DegreeToRadian(-0.6f) - add_camera_ry) / 5.0f;
317+ }
318+ else if( framecnt < (int)(5.0f*GAMEFPS) ){
319+ add_camera_rx = DegreeToRadian(0.9f);
320+ add_camera_ry = DegreeToRadian(-0.6f);
321+ }
322+ else{
323+ add_camera_rx *= 0.8f;
324+ add_camera_ry *= 0.8f;
325+ }
326+ camera_rx += add_camera_rx;
327+ camera_ry += add_camera_ry;
328+
329+ //16秒経ったら終了
330+ if( framecnt >= 16*((int)GAMEFPS) ){
292331 GameState->PushMouseButton();
293332 }
294333
@@ -353,16 +392,16 @@
353392 }
354393
355394 //スタッフ名・その1
356- if( ((int)(4.0f*GAMEFPS) < framecnt)&&(framecnt < (int)(8.0f*GAMEFPS)) ){
395+ if( ((int)(4.5f*GAMEFPS) < framecnt)&&(framecnt < (int)(8.5f*GAMEFPS)) ){
357396 float effectA = 1.0f;
358- if( framecnt < (int)(5.0f*GAMEFPS) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 4.0f, false); }
359- if( framecnt > (int)(7.0f*GAMEFPS) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 7.0f, true); }
397+ if( framecnt < (int)(5.5f*GAMEFPS) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 4.5f, false); }
398+ if( framecnt > (int)(7.5f*GAMEFPS) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 7.5f, true); }
360399 d3dg->Draw2DTextureFontText(60, 150, "ORIGINAL", d3dg->GetColorCode(1.0f,1.0f,1.0f,effectA), 20, 20);
361400 }
362- if( ((int)(4.5f*GAMEFPS) < framecnt)&&(framecnt < (int)(8.5f*GAMEFPS)) ){
401+ if( ((int)(5.0f*GAMEFPS) < framecnt)&&(framecnt < (int)(9.0f*GAMEFPS)) ){
363402 float effectA = 1.0f;
364- if( framecnt < (int)(5.5f*GAMEFPS) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 4.5f, false); }
365- if( framecnt > (int)(7.5f*GAMEFPS) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 7.5f, true); }
403+ if( framecnt < (int)(6.0f*GAMEFPS) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 5.0f, false); }
404+ if( framecnt > (int)(8.0f*GAMEFPS) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 8.0f, true); }
366405 d3dg->Draw2DTextureFontText(100, 180, "nine-two", d3dg->GetColorCode(1.0f,1.0f,1.0f,effectA), 20, 20);
367406 d3dg->Draw2DTextureFontText(100, 210, "TENNKUU", d3dg->GetColorCode(1.0f,1.0f,1.0f,effectA), 20, 20);
368407 }
@@ -383,13 +422,13 @@
383422 }
384423
385424 //ゲーム名
386- if( (int)(12.0f*GAMEFPS) <= framecnt ){ //framecnt < (int)(17.0f*GAMEFPS)
425+ if( (int)(12.0f*GAMEFPS) <= framecnt ){ //framecnt < (int)(16.0f*GAMEFPS)
387426 char str[32];
388427 float effectA = 1.0f;
389428 sprintf(str, GAMENAME);
390429 if( framecnt < (int)(13.0f*GAMEFPS) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 12.0f, false); }
391- if( ((int)(16.0f*GAMEFPS) < framecnt)&&(framecnt < (int)(17.0f*GAMEFPS)) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 16.0f, true); }
392- if( framecnt >= (int)(17.0f*GAMEFPS) ){ effectA = 0.0f; }
430+ if( ((int)(15.0f*GAMEFPS) < framecnt)&&(framecnt < (int)(16.0f*GAMEFPS)) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 15.0f, true); }
431+ if( framecnt >= (int)(16.0f*GAMEFPS) ){ effectA = 0.0f; }
393432 d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - strlen(str)*22/2, (SCREEN_HEIGHT-11)/2, str, d3dg->GetColorCode(1.0f,0.0f,0.0f,effectA), 22, 22);
394433 }
395434 }
@@ -512,8 +551,8 @@
512551 mainmenu_scrollbar_addon_scale = 0.0f;
513552 }
514553
515- mainmenu_scrollbar_official_y = 141;
516- mainmenu_scrollbar_addon_y = 141;
554+ mainmenu_scrollbar_official_y = MAINMENU_Y+1 + (int)(mainmenu_scrollbar_official_scale*mainmenu_scrollitems_official);
555+ mainmenu_scrollbar_addon_y = MAINMENU_Y+1 + (int)(mainmenu_scrollbar_addon_scale*mainmenu_scrollitems_addon);
517556 mainmenu_scrollbar_flag = false;
518557 inputCtrl->MoveMouseCenter();
519558 framecnt = 0;
@@ -2110,19 +2149,7 @@
21102149
21112150 //デバック用・ゲーム情報の表示
21122151 if( (ShowInfo_Debugmode == true)||(Camera_Debugmode == true) ){
2113- //システムフォントによる表示 日本語可・重い
2114- /*
2115- sprintf(str, "OpenXOPS テスト\ncamera x:%.2f y:%.2f z:%.2f rx:%.2f ry:%.2f\n"
2116- "human[%d]:x:%.2f y:%.2f z:%.2f rx:%.2f\n"
2117- "I:%02dms PO:%02dms PA:%02dms PE:%02dms R:%02dms",
2118- camera_x, camera_y, camera_z, camera_rx, camera_ry,
2119- ObjMgr.GetPlayerID(), human_x, human_y, human_z, human_rx,
2120- time_input, time_process_object, time_process_ai, time_process_event, time_render);
2121- d3dg->Draw2DMSFontText(10+1, 10+1, str, d3dg->GetColorCode(0.1f,0.1f,0.1f,1.0f));
2122- d3dg->Draw2DMSFontText(10, 10, str, d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f));
2123- */
2124-
2125- //テクスチャフォントによる表示 軽い・半角英数字と記号のみ  
2152+ //テクスチャフォントによる表示(半角英数字と記号のみ)
21262153 sprintf(str, "frame:%d time %02d:%02d", framecnt, framecnt/(int)GAMEFPS/60, framecnt/(int)GAMEFPS%60);
21272154 d3dg->Draw2DTextureDebugFontText(10+1, 10+1, str, d3dg->GetColorCode(0.1f,0.1f,0.1f,1.0f));
21282155 d3dg->Draw2DTextureDebugFontText(10, 10, str, d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f));
--- trunk/gamemain.h (revision 158)
+++ trunk/gamemain.h (revision 159)
@@ -92,6 +92,11 @@
9292 //! @details オープニング画面を管理します。
9393 class opening : public D3Dscene
9494 {
95+ float add_camera_x; //!< カメラ座標 Xの増減量
96+ float add_camera_y; //!< カメラ座標 Yの増減量
97+ float add_camera_z; //!< カメラ座標 Zの増減量
98+ float add_camera_rx; //!< カメラ回転角度 RXの増減量
99+ float add_camera_ry; //!< カメラ回転角度 RYの増減量
95100 //int opening_banner; //!< オープニングで表示するテクスチャID
96101 void Render3D();
97102 void Render2D();