• 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

Revision260 (tree)
Time2021-02-13 20:34:00
Authorxops-mikan

Log Message

DirectX 9.0のシェーダーを実装(オプション)、コンソールのverコマンドの表示を修正

Change Summary

Incremental Difference

--- trunk/d3dgraphics-directx.cpp (revision 259)
+++ trunk/d3dgraphics-directx.cpp (revision 260)
@@ -31,7 +31,7 @@
3131
3232 #include "d3dgraphics.h"
3333
34-#if GRAPHIC_ENGINE == 0
34+#if (GRAPHIC_ENGINE == 0)||(GRAPHIC_ENGINE == 1)
3535
3636 //! @brief コンストラクタ
3737 D3DGraphics::D3DGraphics()
@@ -47,6 +47,18 @@
4747 ptextures[i] = NULL;
4848 }
4949
50+#if GRAPHIC_ENGINE == 1
51+ hVertexShader = NULL;
52+ hVSConstantTable = NULL;
53+ hVSWorldVertexPos = NULL;
54+ hVSWorldViewPos = NULL;
55+ hVSWorldViewProj = NULL;
56+ hVSDiffuse = NULL;
57+ pPixelShader = NULL;
58+ pPSConstantTable = NULL;
59+ hPSEnableTexture = NULL;
60+#endif
61+
5062 blockdata = NULL;
5163 for(int i=0; i<TOTAL_BLOCKTEXTURE; i++){
5264 mapTextureID[i] = -1;
@@ -158,6 +170,46 @@
158170 }
159171
160172
173+#if GRAPHIC_ENGINE == 1
174+ HRESULT hr;
175+ LPD3DXBUFFER pCode;
176+
177+ //頂点シェーダー初期化
178+ //hr = D3DXCompileShaderFromFile("DirectX_Shader01.fx", NULL, NULL, "VertexShader_Main", "vs_2_0", 0, &pCode, NULL, &hVSConstantTable);
179+ hr = D3DXCompileShaderFromResource(NULL, MAKEINTRESOURCE(HLSLFILE), NULL, NULL, "VertexShader_Main", "vs_2_0", 0, &pCode, NULL, &hVSConstantTable);
180+ if( FAILED(hr) ){ return 1; }
181+ hr = pd3dDevice->CreateVertexShader((DWORD*)pCode->GetBufferPointer(), &hVertexShader);
182+ pCode->Release();
183+ if( FAILED(hr) ){ return 1; }
184+
185+ //頂点シェーダーの関連変数
186+ hVSWorldVertexPos = hVSConstantTable->GetConstantByName(NULL, "WorldVertexPos");
187+ if( hVSWorldVertexPos == NULL ){ return 1; }
188+ hVSWorldViewPos = hVSConstantTable->GetConstantByName(NULL, "WorldViewPos");
189+ if( hVSWorldViewPos == NULL ){ return 1; }
190+ hVSWorldViewProj = hVSConstantTable->GetConstantByName(NULL, "WorldViewProj");
191+ if( hVSWorldViewProj == NULL ){ return 1; }
192+ hVSDiffuse = hVSConstantTable->GetConstantByName(NULL, "Diffuse");
193+ if( hVSDiffuse == NULL ){ return 1; }
194+
195+ //ピクセルシェーダー初期化
196+ //hr = D3DXCompileShaderFromFile("DirectX_Shader01.fx", NULL, NULL, "PixelShader_Main", "ps_2_0", 0, &pCode, NULL, &pPSConstantTable);
197+ hr = D3DXCompileShaderFromResource(NULL, MAKEINTRESOURCE(HLSLFILE), NULL, NULL, "PixelShader_Main", "ps_2_0", 0, &pCode, NULL, &pPSConstantTable);
198+ if( FAILED(hr) ){ return 1; }
199+ hr = pd3dDevice->CreatePixelShader((DWORD*)pCode->GetBufferPointer(), &pPixelShader);
200+ pCode->Release();
201+ if( FAILED(hr) ){ return 1; }
202+
203+ //ピクセルシェーダーの関連変数
204+ hPSEnableTexture = pPSConstantTable->GetConstantByName(NULL, "EnableTexture");
205+ if( hPSEnableTexture == NULL ){ return 1; }
206+
207+ D3DXMatrixIdentity(&VSWorldPosMatrix);
208+ D3DXMatrixIdentity(&VSViewPosMatrix);
209+ D3DXMatrixIdentity(&VSViewProjMatrix);
210+#endif
211+
212+
161213 //アスペクト比を設定
162214 aspect = (float)rec.right / (float)rec.bottom;
163215
@@ -273,6 +325,25 @@
273325 //リソース解放
274326 CleanupD3Dresource();
275327
328+#if GRAPHIC_ENGINE == 1
329+ if( pPSConstantTable != NULL ){
330+ pPSConstantTable->Release();
331+ pPSConstantTable = NULL;
332+ }
333+ if( pPixelShader != NULL ){
334+ pPixelShader->Release();
335+ pPixelShader = NULL;
336+ }
337+ if( hVSConstantTable != NULL ){
338+ hVSConstantTable->Release();
339+ hVSConstantTable = NULL;
340+ }
341+ if( hVertexShader != NULL ){
342+ hVertexShader->Release();
343+ hVertexShader = NULL;
344+ }
345+#endif
346+
276347 if( pd3dDevice != NULL ){
277348 pd3dDevice->Release();
278349 pd3dDevice = NULL;
@@ -819,6 +890,12 @@
819890 //Zバッファ初期化
820891 pd3dDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
821892
893+#if GRAPHIC_ENGINE == 1
894+ //頂点シェーダーとピクセルシェーダー設定
895+ pd3dDevice->SetVertexShader(hVertexShader);
896+ pd3dDevice->SetPixelShader(pPixelShader);
897+#endif
898+
822899 //座標ゼロ地点にワールド変換行列
823900 ResetWorldTransform();
824901
@@ -865,7 +942,12 @@
865942 {
866943 D3DXMATRIX matWorld;
867944 D3DXMatrixIdentity(&matWorld);
945+#if GRAPHIC_ENGINE == 0
868946 pd3dDevice->SetTransform(D3DTS_WORLD, &matWorld);
947+#else
948+ hVSConstantTable->SetMatrix(pd3dDevice, hVSWorldVertexPos, &matWorld);
949+ VSWorldPosMatrix = matWorld;
950+#endif
869951 }
870952
871953 //! @brief ワールド空間の座標・角度・拡大率を設定
@@ -904,7 +986,12 @@
904986 matWorld = matWorld5 * matWorld4 * matWorld3 * matWorld2 * matWorld1;
905987
906988 //適用
907- pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
989+#if GRAPHIC_ENGINE == 0
990+ pd3dDevice->SetTransform(D3DTS_WORLD, &matWorld);
991+#else
992+ hVSConstantTable->SetMatrix(pd3dDevice, hVSWorldVertexPos, &matWorld);
993+ VSWorldPosMatrix = matWorld;
994+#endif
908995 }
909996
910997 //! @brief ワールド空間の座標・角度・拡大率を設定(エフェクト用)
@@ -931,7 +1018,12 @@
9311018 matWorld = matWorld5 * matWorld4 * matWorld3 * matWorld2 * matWorld1;
9321019
9331020 //適用
934- pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
1021+#if GRAPHIC_ENGINE == 0
1022+ pd3dDevice->SetTransform(D3DTS_WORLD, &matWorld);
1023+#else
1024+ hVSConstantTable->SetMatrix(pd3dDevice, hVSWorldVertexPos, &matWorld);
1025+ VSWorldPosMatrix = matWorld;
1026+#endif
9351027 }
9361028
9371029 //! @brief ワールド空間を人が武器を持つ場所に設定
@@ -960,7 +1052,12 @@
9601052 matWorld = matWorld5 * matWorld4 * matWorld3 * matWorld2 * matWorld1;
9611053
9621054 //適用
963- pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
1055+#if GRAPHIC_ENGINE == 0
1056+ pd3dDevice->SetTransform(D3DTS_WORLD, &matWorld);
1057+#else
1058+ hVSConstantTable->SetMatrix(pd3dDevice, hVSWorldVertexPos, &matWorld);
1059+ VSWorldPosMatrix = matWorld;
1060+#endif
9641061 }
9651062
9661063 //! @brief ワールド空間を所持している武器を描画する場所に設定
@@ -989,12 +1086,20 @@
9891086
9901087 pd3dDevice->GetViewport(&pViewport);
9911088
1089+#if GRAPHIC_ENGINE == 0
9921090 //カメラ座標
9931091 pd3dDevice->GetTransform(D3DTS_VIEW, &matWorldV);
9941092
9951093 //カメラ設定(射影変換行列)viewangle
9961094 pd3dDevice->GetTransform(D3DTS_PROJECTION, &matProj);
1095+#else
1096+ //カメラ座標
1097+ matWorldV = VSViewPosMatrix;
9971098
1099+ //カメラ設定(射影変換行列)viewangle
1100+ matProj = VSViewProjMatrix;
1101+#endif
1102+
9981103 D3DXMatrixIdentity(&matWorld);
9991104
10001105 //スクリーン空間からオブジェクト空間にベクトルを射影
@@ -1018,7 +1123,12 @@
10181123 matWorld = matWorld6 * matWorld5 * matWorld3 * matWorld2 * matWorld1;
10191124
10201125 //適用
1021- pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
1126+#if GRAPHIC_ENGINE == 0
1127+ pd3dDevice->SetTransform(D3DTS_WORLD, &matWorld);
1128+#else
1129+ hVSConstantTable->SetMatrix(pd3dDevice, hVSWorldVertexPos, &matWorld);
1130+ VSWorldPosMatrix = matWorld;
1131+#endif
10221132 }
10231133
10241134 //! @brief ワールド空間の座標を取得
@@ -1028,7 +1138,11 @@
10281138 void D3DGraphics::GetWorldTransformPos(float *x, float *y, float *z)
10291139 {
10301140 D3DXMATRIX matWorld;
1031- pd3dDevice->GetTransform( D3DTS_WORLD, &matWorld );
1141+#if GRAPHIC_ENGINE == 0
1142+ pd3dDevice->GetTransform(D3DTS_WORLD, &matWorld);
1143+#else
1144+ matWorld = VSWorldPosMatrix;
1145+#endif
10321146 *x = matWorld._41;
10331147 *y = matWorld._42;
10341148 *z = matWorld._43;
@@ -1101,7 +1215,12 @@
11011215 }
11021216
11031217 D3DXMatrixIdentity(&matWorld);
1218+#if GRAPHIC_ENGINE == 0
11041219 pd3dDevice->SetTransform(D3DTS_WORLD, &matWorld);
1220+#else
1221+ hVSConstantTable->SetMatrix(pd3dDevice, hVSWorldVertexPos, &matWorld);
1222+ VSWorldPosMatrix = matWorld;
1223+#endif
11051224
11061225 //カメラ座標
11071226 D3DXVECTOR3 vEyePt( camera_x, camera_y, camera_z );
@@ -1108,12 +1227,22 @@
11081227 D3DXVECTOR3 vLookatPt( cos(camera_rx)*cos(camera_ry) + camera_x, sin(camera_ry) + camera_y, sin(camera_rx)*cos(camera_ry) + camera_z );
11091228 D3DXVECTOR3 vUpVec( 0.0f, vUpVecF, 0.0f );
11101229 D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec );
1111- pd3dDevice->SetTransform( D3DTS_VIEW, &matView );
1230+#if GRAPHIC_ENGINE == 0
1231+ pd3dDevice->SetTransform(D3DTS_VIEW, &matView);
1232+#else
1233+ hVSConstantTable->SetMatrix(pd3dDevice, hVSWorldViewPos, &matView);
1234+ VSViewPosMatrix = matView;
1235+#endif
11121236
11131237 //カメラ設定(射影変換行列)viewangle
11141238 D3DXMATRIXA16 matProj;
11151239 D3DXMatrixPerspectiveFovLH( &matProj, viewangle, aspect, CLIPPINGPLANE_NEAR, CLIPPINGPLANE_FAR);
1240+#if GRAPHIC_ENGINE == 0
11161241 pd3dDevice->SetTransform(D3DTS_PROJECTION, &matProj);
1242+#else
1243+ hVSConstantTable->SetMatrix(pd3dDevice, hVSWorldViewProj, &matProj);
1244+ VSViewProjMatrix = matProj;
1245+#endif
11171246 }
11181247
11191248 //! @brief マップデータを取り込む
@@ -1274,6 +1403,7 @@
12741403
12751404 for(textureID=0; textureID<TOTAL_BLOCKTEXTURE; textureID++){
12761405 //テクスチャが正常に読み込めていなければ設定
1406+#if GRAPHIC_ENGINE == 0
12771407 if( mapTextureID[textureID] == -1 ){
12781408 pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE);
12791409 pd3dDevice->SetTexture(0, NULL);
@@ -1286,6 +1416,23 @@
12861416 pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
12871417 pd3dDevice->SetTexture(0, ptextures[mapTextureID[textureID]] );
12881418 }
1419+#else
1420+ if( mapTextureID[textureID] == -1 ){
1421+ pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE);
1422+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
1423+ pd3dDevice->SetTexture(0, NULL);
1424+ }
1425+ else if( ptextures[ mapTextureID[textureID] ] == NULL ){
1426+ pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE);
1427+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
1428+ pd3dDevice->SetTexture(0, NULL);
1429+ }
1430+ else{
1431+ pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
1432+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, true);
1433+ pd3dDevice->SetTexture(0, ptextures[mapTextureID[textureID]] );
1434+ }
1435+#endif
12891436
12901437 for(int i=0; i<bs; i++){
12911438 //データ取得
@@ -1308,6 +1455,7 @@
13081455
13091456 for(textureID=0; textureID<TOTAL_BLOCKTEXTURE; textureID++){
13101457 //テクスチャが正常に読み込めていなければ設定
1458+#if GRAPHIC_ENGINE == 0
13111459 if( mapTextureID[textureID] == -1 ){
13121460 pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE);
13131461 pd3dDevice->SetTexture(0, NULL);
@@ -1320,6 +1468,23 @@
13201468 pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
13211469 pd3dDevice->SetTexture(0, ptextures[mapTextureID[textureID]] );
13221470 }
1471+#else
1472+ if( mapTextureID[textureID] == -1 ){
1473+ pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE);
1474+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
1475+ pd3dDevice->SetTexture(0, NULL);
1476+ }
1477+ else if( ptextures[ mapTextureID[textureID] ] == NULL ){
1478+ pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE);
1479+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
1480+ pd3dDevice->SetTexture(0, NULL);
1481+ }
1482+ else{
1483+ pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
1484+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, true);
1485+ pd3dDevice->SetTexture(0, ptextures[mapTextureID[textureID]] );
1486+ }
1487+#endif
13231488
13241489 for(int i=0; i<bs; i++){
13251490 //データ取得
@@ -1415,12 +1580,18 @@
14151580 pd3dDevice->SetRenderState(D3DRS_LIGHTING, TRUE);
14161581
14171582 //色合い設定
1583+#if GRAPHIC_ENGINE == 0
14181584 D3DMATERIAL9 mtrl;
14191585 ZeroMemory(&mtrl, sizeof(mtrl));
14201586 mtrl.Emissive = D3DXCOLOR(Brightness, Brightness, Brightness, 1.0f);
14211587 pd3dDevice->SetMaterial(&mtrl);
1588+#else
1589+ float DiffuseColor[4] = {Brightness, Brightness, Brightness, 1.0f};
1590+ hVSConstantTable->SetFloatArray(pd3dDevice, hVSDiffuse, DiffuseColor, 4);
1591+#endif
14221592
14231593 //テクスチャ設定
1594+#if GRAPHIC_ENGINE == 0
14241595 if( id_texture == -1 ){
14251596 pd3dDevice->SetTexture(0, NULL);
14261597 }
@@ -1430,6 +1601,20 @@
14301601 else{
14311602 pd3dDevice->SetTexture( 0, ptextures[id_texture] );
14321603 }
1604+#else
1605+ if( id_texture == -1 ){
1606+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
1607+ pd3dDevice->SetTexture(0, NULL);
1608+ }
1609+ else if( ptextures[id_texture] == NULL ){
1610+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
1611+ pd3dDevice->SetTexture(0, NULL);
1612+ }
1613+ else{
1614+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, true);
1615+ pd3dDevice->SetTexture( 0, ptextures[id_texture] );
1616+ }
1617+#endif
14331618
14341619 //描画
14351620 for(int i=0; i<(signed)nummaterials[id_model]; i=i+1){
@@ -1436,6 +1621,12 @@
14361621 pmesh[id_model]->DrawSubset(i);
14371622 }
14381623
1624+#if GRAPHIC_ENGINE == 1
1625+ //色合い再設定
1626+ float DiffuseColor2[4] = {0.0f, 0.0f, 0.0f, 0.0f};
1627+ hVSConstantTable->SetFloatArray(pd3dDevice, hVSDiffuse, DiffuseColor2, 4);
1628+#endif
1629+
14391630 //ライティング無効化
14401631 pd3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
14411632 }
@@ -1482,6 +1673,9 @@
14821673 pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE);
14831674
14841675 //テクスチャとデータ形式を設定し描画
1676+#if GRAPHIC_ENGINE == 1
1677+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, true);
1678+#endif
14851679 pd3dDevice->SetTexture(0, ptextures[id_texture]);
14861680 pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
14871681 pd3dDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, BoardVertices, sizeof(VERTEXTXTA));
@@ -1541,6 +1735,9 @@
15411735 mv[i].tv = 0.0f;
15421736 }
15431737
1738+#if GRAPHIC_ENGINE == 1
1739+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
1740+#endif
15441741 pd3dDevice->SetTexture(0, NULL);
15451742 pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
15461743 pd3dDevice->DrawPrimitiveUP(D3DPT_LINELIST, 1, mv, sizeof(VERTEXTXTA));
@@ -1686,6 +1883,9 @@
16861883 ResetWorldTransform();
16871884
16881885 //テクスチャをフォントテクスチャに設定
1886+#if GRAPHIC_ENGINE == 1
1887+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, true);
1888+#endif
16891889 pd3dDevice->SetTexture( 0, ptextures[TextureFont] );
16901890
16911891 //データ形式を設定
@@ -1780,6 +1980,9 @@
17801980 ResetWorldTransform();
17811981
17821982 //テクスチャをフォントテクスチャに設定
1983+#if GRAPHIC_ENGINE == 1
1984+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, true);
1985+#endif
17831986 pd3dDevice->SetTexture( 0, ptextures[TextureDebugFont] );
17841987
17851988 //データ形式を設定
@@ -1859,6 +2062,9 @@
18592062 pLineVertices[i].tv = 0.0f;
18602063 }
18612064
2065+#if GRAPHIC_ENGINE == 1
2066+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
2067+#endif
18622068 pd3dDevice->SetTexture(0, NULL);
18632069
18642070 //データ形式を設定し、描画。
@@ -1896,6 +2102,9 @@
18962102 pLineVertices[i].tv = 0.0f;
18972103 }
18982104
2105+#if GRAPHIC_ENGINE == 1
2106+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
2107+#endif
18992108 pd3dDevice->SetTexture(0, NULL);
19002109
19012110 //データ形式を設定し、描画。
@@ -1939,6 +2148,9 @@
19392148 pBoxVertices[i].tv = 0.0f;
19402149 }
19412150
2151+#if GRAPHIC_ENGINE == 1
2152+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
2153+#endif
19422154 pd3dDevice->SetTexture(0, NULL);
19432155
19442156 //データ形式を設定し、描画。
@@ -1993,6 +2205,9 @@
19932205 }
19942206
19952207 //テクスチャとデータ形式を設定し、描画
2208+#if GRAPHIC_ENGINE == 1
2209+ pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, true);
2210+#endif
19962211 pd3dDevice->SetTexture( 0, ptextures[id] );
19972212 pd3dDevice->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1);
19982213 pd3dDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pBoxVertices, sizeof(TLVERTX));
--- trunk/d3dgraphics.h (revision 259)
+++ trunk/d3dgraphics.h (revision 260)
@@ -57,9 +57,9 @@
5757 #endif
5858 #include "main.h"
5959
60-#define GRAPHIC_ENGINE 0 //!< @brief 使用するグラフィックスコアの選択 @details DirectX 9.0c:0 OpenGL 1.1:8
60+#define GRAPHIC_ENGINE 0 //!< @brief 使用するグラフィックスコアの選択 @details DirectX 9.0c(固定パイプライン):0 DirectX 9.0c(シェーダー):1 OpenGL 1.1:8
6161
62-#if GRAPHIC_ENGINE == 0
62+#if (GRAPHIC_ENGINE == 0)||(GRAPHIC_ENGINE == 1)
6363
6464 #define BLOCKDATA_GPUMEMORY //!< @brief ブロックデータを格納するメモリーを選択 @details 定数宣言有効:GPUメモリー 定数宣言無効(コメント化):メインメモリー
6565
@@ -70,7 +70,12 @@
7070 #pragma comment(lib, "d3d9.lib")
7171 #pragma comment(lib, "d3dx9.lib")
7272
73-#define GRAPHICS_CORE "DirectX 9.0" //!< バージョン表示用情報
73+#if GRAPHIC_ENGINE == 0
74+ #define GRAPHICS_CORE "DirectX 9.0" //!< バージョン表示用情報
75+#else
76+ #define GRAPHICS_CORE "DirectX 9.0 (Shader)" //!< バージョン表示用情報
77+ #define HLSLFILE 201 //!< リソース内のHLSLファイル
78+#endif
7479
7580 #elif GRAPHIC_ENGINE == 8
7681
@@ -93,7 +98,7 @@
9398
9499 #endif //GRAPHIC_ENGINE
95100
96-#if GRAPHIC_ENGINE == 0
101+#if (GRAPHIC_ENGINE == 0)||(GRAPHIC_ENGINE == 1)
97102
98103 //! 3Dポリゴン描画用構造体
99104 struct VERTEXTXTA
@@ -157,7 +162,7 @@
157162 class D3DGraphics
158163 {
159164
160-#if GRAPHIC_ENGINE == 0
165+#if (GRAPHIC_ENGINE == 0)||(GRAPHIC_ENGINE == 1)
161166
162167 LPDIRECT3D9 pD3D; //!< DIRECT3D9のポインタ
163168 LPDIRECT3DDEVICE9 pd3dDevice; //!< DIRECT3DDEVICE9のポインタ
@@ -167,6 +172,21 @@
167172 DWORD nummaterials[MAX_MODEL]; //!< (Xファイル用)マテリアル数
168173 LPDIRECT3DTEXTURE9 ptextures[MAX_TEXTURE]; //!< テクスチャを格納
169174
175+#if GRAPHIC_ENGINE == 1
176+ LPDIRECT3DVERTEXSHADER9 hVertexShader; //!< 頂点シェーダー
177+ LPD3DXCONSTANTTABLE hVSConstantTable; //!< 頂点シェーダーの定数テーブル
178+ D3DXHANDLE hVSWorldVertexPos; //!< 頂点シェーダーの変換行列
179+ D3DXHANDLE hVSWorldViewPos; //!< 頂点シェーダーの変換行列
180+ D3DXHANDLE hVSWorldViewProj; //!< 頂点シェーダーの変換行列
181+ D3DXHANDLE hVSDiffuse; //!< 頂点シェーダーのディフューズ色
182+ LPDIRECT3DPIXELSHADER9 pPixelShader; //!< ピクセルシェーダー
183+ LPD3DXCONSTANTTABLE pPSConstantTable; //!< ピクセルシェーダーの定数テーブル
184+ D3DXHANDLE hPSEnableTexture; //!< ピクセルシェーダーのテクスチャフラグ
185+ D3DXMATRIX VSWorldPosMatrix; //!< 頂点シェーダーに与えた変換行列
186+ D3DXMATRIX VSViewPosMatrix; //!< 頂点シェーダーに与えた変換行列
187+ D3DXMATRIX VSViewProjMatrix; //!< 頂点シェーダーに与えた変換行列
188+#endif
189+
170190 class BlockDataInterface* blockdata; //!< 読み込んだブロックデータを格納するクラスへのポインタ
171191 int bs; //!< ブロック数
172192 int mapTextureID[TOTAL_BLOCKTEXTURE]; //!< テクスチャ番号
--- trunk/gamemain.cpp (revision 259)
+++ trunk/gamemain.cpp (revision 260)
@@ -1028,7 +1028,7 @@
10281028 scrollbar_license.SetColor(d3dg->GetColorCode(0.5f,0.5f,0.5f,0.5f), d3dg->GetColorCode(0.6f,0.6f,0.25f,1.0f), d3dg->GetColorCode(0.8f,0.8f,0.25f,1.0f),
10291029 d3dg->GetColorCode(0.4f,0.67f,0.57f,1.0f), d3dg->GetColorCode(0.38f,0.77f,0.64f,1.0f), d3dg->GetColorCode(0.6f,0.3f,0.25f,1.0f), d3dg->GetColorCode(0.8f,0.3f,0.25f,1.0f));
10301030
1031-#if GRAPHIC_ENGINE == 0
1031+#if (GRAPHIC_ENGINE == 0)||(GRAPHIC_ENGINE == 1)
10321032 //ライセンス文章
10331033 licenseinfo[0] = "";
10341034 licenseinfo[1] = "OpenXOPS";
@@ -4380,8 +4380,12 @@
43804380 if( strcmp(NewCommand, "ver") == 0 ){
43814381 sprintf(str, "%s Version:%s", GAMENAME, GAMEVERSION);
43824382 AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str);
4383- sprintf(str, " (Graphics:%s Sound:%s Input:%s)", GRAPHICS_CORE, SOUND_CORE, INPUT_CORE);
4383+ sprintf(str, " Graphics : %s", GRAPHICS_CORE);
43844384 AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str);
4385+ sprintf(str, " Sound : %s", SOUND_CORE);
4386+ AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str);
4387+ sprintf(str, " Input : %s", INPUT_CORE);
4388+ AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str);
43854389 }
43864390
43874391 //ゲームの実行速度
--- trunk/gamemain.h (revision 259)
+++ trunk/gamemain.h (revision 260)
@@ -84,7 +84,7 @@
8484 #define OPTIONS_P3_X ((SCREEN_WIDTH - OPTIONS_P3_W)/2) //!< オプション画面 No.3 X座標
8585 #define OPTIONS_P3_Y (105 + (SCREEN_HEIGHT-105 - OPTIONS_P3_H)/2) //!< オプション画面 No.3 Y座標
8686 #define OPTIONS_P3_DATAS 1 //!< オプション画面 No.3 リンクテキストの数
87-#if GRAPHIC_ENGINE == 0
87+#if (GRAPHIC_ENGINE == 0)||(GRAPHIC_ENGINE == 1)
8888 #define OPTIONS_LICENSELINE 26 //!< ライセンス文の行数
8989 #elif GRAPHIC_ENGINE == 8
9090 #define OPTIONS_LICENSELINE 6 //!< ライセンス文の行数