• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

MIDITrail をピカピカにする。鍵盤方向自動切替・多ポート・歌詞対応等


Commit MetaInfo

Revision886c22a2abbe462bafb6ec32ed18d4d0e3117802 (tree)
Time2016-10-30 13:12:00
Authoryoshy <yoshy@user...>
Commiteryoshy

Log Message

[ADD] PianoRoll3D: 逆方向にライトを追加

Change Summary

Incremental Difference

--- a/MIDITrail/DXDirLight.cpp
+++ b/MIDITrail/DXDirLight.cpp
@@ -107,11 +107,25 @@ D3DXVECTOR3 DXDirLight::GetDirection()
107107 //******************************************************************************
108108 // デバイス登録
109109 //******************************************************************************
110+// >>> add 20121229 yossiepon begin
111+//デバイスへのライト登録
110112 int DXDirLight::SetDevice(
111113 LPDIRECT3DDEVICE9 pD3DDevice,
112114 BOOL isLightON
113115 )
114116 {
117+ return SetDevice(pD3DDevice, 0, isLightON);
118+}
119+// <<< add 20121229 yossiepon end
120+
121+int DXDirLight::SetDevice(
122+ LPDIRECT3DDEVICE9 pD3DDevice,
123+// >>> add 20121229 yossiepon begin
124+ DWORD index,
125+// <<< add 20121229 yossiepon end
126+ BOOL isLightON
127+ )
128+{
115129 int result = 0;
116130 HRESULT hresult = D3D_OK;
117131
@@ -132,14 +146,14 @@ int DXDirLight::SetDevice(
132146 }
133147
134148 // ライトをレンダリングパイプラインに設定
135- hresult = pD3DDevice->SetLight(0, &m_Light);
149+ hresult = pD3DDevice->SetLight(index, &m_Light);
136150 if (FAILED(hresult)) {
137151 result = YN_SET_ERR("DirectX API error.", hresult, 0);
138152 goto EXIT;
139153 }
140154
141155 //ライト有効化
142- hresult = pD3DDevice->LightEnable(0, isLightON);
156+ hresult = pD3DDevice->LightEnable(index, isLightON);
143157 if (FAILED(hresult)) {
144158 result = YN_SET_ERR("DirectX API error.", hresult, isLightON);
145159 goto EXIT;
--- a/MIDITrail/DXDirLight.h
+++ b/MIDITrail/DXDirLight.h
@@ -43,6 +43,15 @@ public:
4343 BOOL isLightON
4444 );
4545
46+// >>> add 20121229 yossiepon begin
47+ //デバイスへのライト登録
48+ int SetDevice(
49+ LPDIRECT3DDEVICE9 pD3DDevice,
50+ DWORD index,
51+ BOOL isLightON
52+ );
53+// <<< add 20121229 yossiepon end
54+
4655 private:
4756
4857 D3DLIGHT9 m_Light;
--- a/MIDITrail/MIDITrail.rc
+++ b/MIDITrail/MIDITrail.rc
@@ -123,9 +123,9 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1
123123 BEGIN
124124 ICON IDI_MIDITRAIL,IDC_STATIC,74,12,20,20
125125 CTEXT "MIDITrail",IDC_STATIC,16,42,138,8,SS_NOPREFIX
126-// >>> modify 20120728 yossiepon begin
127- CTEXT "Version 1.2.0 mod. yossiepon_20120728",IDC_STATIC,16,63,138,8
128-// <<< modify 20120728 yossiepon end
126+// >>> modify 20121229 yossiepon begin
127+ CTEXT "Version 1.2.0 mod. yossiepon_20121229",IDC_STATIC,16,63,138,8
128+// <<< modify 20121229 yossiepon end
129129 CTEXT "Copyright (C) 2010-2012 WADA Masashi",IDC_STATIC,1,84,168,8
130130 DEFPUSHBUTTON "OK",IDOK,58,108,53,14,WS_GROUP
131131 END
@@ -299,9 +299,9 @@ END
299299
300300 STRINGTABLE
301301 BEGIN
302-// >>> modify 20120728 yossiepon begin
303- IDS_APP_TITLE "MIDITrail 1.2.0 mod. yossiepon_20120728"
304-// <<< modify 20120728 yossiepon end
302+// >>> modify 20121229 yossiepon begin
303+ IDS_APP_TITLE "MIDITrail 1.2.0 mod. yossiepon_20121229"
304+// <<< modify 20121229 yossiepon end
305305 IDC_MIDITRAIL "MIDITRAIL"
306306 END
307307
--- a/MIDITrail/MTScenePianoRoll3D.cpp
+++ b/MIDITrail/MTScenePianoRoll3D.cpp
@@ -94,7 +94,9 @@ int MTScenePianoRoll3D::Create(
9494 m_DirLight.SetDirection(D3DXVECTOR3(1.0f, -1.0f, 2.0f));
9595
9696 //ライトのデバイス登録
97- result = m_DirLight.SetDevice(pD3DDevice, m_IsEnableLight);
97+// >>> moidfy 20121229 yossiepon begin
98+ result = m_DirLight.SetDevice(pD3DDevice, 0, m_IsEnableLight);
99+// <<< moidfy 20121229 yossiepon end
98100 if (result != 0) goto EXIT;
99101
100102 //----------------------------------
--- a/MIDITrail/MTScenePianoRoll3D.h
+++ b/MIDITrail/MTScenePianoRoll3D.h
@@ -133,6 +133,10 @@ protected:
133133
134134 virtual void _Reset();
135135
136+// >>> modify access level to protected 20121229 yossiepon begin
137+ void _SetLightColor(DXDirLight* pLight);
138+// <<< modify 20121229 yossiepon end
139+
136140 // <<< modify 20120728 yossiepon end
137141
138142 private:
@@ -156,7 +160,6 @@ private:
156160 MTNoteDesign m_NoteDesign;
157161
158162 // >>> modify 20120728 yossiepon begin
159- void _SetLightColor(DXDirLight* pLight);
160163 // <<< modify 20120728 yossiepon end
161164
162165 };
--- a/MIDITrail/MTScenePianoRoll3DMod.cpp
+++ b/MIDITrail/MTScenePianoRoll3DMod.cpp
@@ -48,6 +48,23 @@ int MTScenePianoRoll3DMod::Create(
4848 if (result != 0) goto EXIT;
4949
5050 //----------------------------------
51+ // ライト2
52+ //----------------------------------
53+ //ライト2初期化
54+ result = m_DirLightBack.Initialize();
55+ if (result != 0) goto EXIT;
56+
57+ //ライト2色
58+ _SetLightColor(&m_DirLightBack);
59+
60+ //ライト2方向
61+ m_DirLightBack.SetDirection(D3DXVECTOR3(-1.0f, 1.0f, -2.0f));
62+
63+ //ライトのデバイス登録
64+ result = m_DirLightBack.SetDevice(pD3DDevice, 1, m_IsEnableLight);
65+ if (result != 0) goto EXIT;
66+
67+ //----------------------------------
5168 // 描画オブジェクト
5269 //----------------------------------
5370
--- a/MIDITrail/MTScenePianoRoll3DMod.h
+++ b/MIDITrail/MTScenePianoRoll3DMod.h
@@ -59,6 +59,9 @@ protected:
5959
6060 private:
6161
62+ // ライト2
63+ DXDirLight m_DirLightBack;
64+
6265 //描画オブジェクト
6366 MTGridBoxMod m_GridBoxMod;
6467 MTNoteBoxMod m_NoteBoxMod;