• 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

Revision358 (tree)
Time2023-07-01 22:53:49
Authorxops-mikan

Log Message

DirectXのシェーダーにおける2D描画処理を変更

Change Summary

Incremental Difference

--- trunk/d3dgraphics-directx.cpp (revision 357)
+++ trunk/d3dgraphics-directx.cpp (revision 358)
@@ -59,12 +59,12 @@
5959 pPixelShader = NULL;
6060 pPSConstantTable = NULL;
6161 hPSViewPos = NULL;
62+ hPSEnable2DRendering = NULL;
6263 hPSEnableTexture = NULL;
6364 hPSEnableFog = NULL;
6465 hPSFogColor = NULL;
6566 hPSFogStart = NULL;
6667 hPSFogEnd = NULL;
67- hPSEnable2DRender = NULL;
6868 #endif
6969
7070 BlockDataIF = NULL;
@@ -245,6 +245,8 @@
245245 //ピクセルシェーダーの関連変数
246246 hPSViewPos = pPSConstantTable->GetConstantByName(NULL, "ViewPos");
247247 //if( hPSViewPos == NULL ){ return 1; }
248+ hPSEnable2DRendering = pPSConstantTable->GetConstantByName(NULL, "Enable2DRendering");
249+ //if( hPSEnable2DRendering == NULL ){ return 1; }
248250 hPSEnableTexture = pPSConstantTable->GetConstantByName(NULL, "EnableTexture");
249251 if( hPSEnableTexture == NULL ){ return 1; }
250252 hPSEnableFog = pPSConstantTable->GetConstantByName(NULL, "EnableFog");
@@ -255,8 +257,6 @@
255257 if( hPSFogStart == NULL ){ return 1; }
256258 hPSFogEnd = pPSConstantTable->GetConstantByName(NULL, "FogEnd");
257259 if( hPSFogEnd == NULL ){ return 1; }
258- hPSEnable2DRender = pPSConstantTable->GetConstantByName(NULL, "Enable2DRender");
259- //if( hPSEnable2DRender == NULL ){ return 1; }
260260
261261 D3DXMatrixIdentity(&VSWorldPosMatrix);
262262 D3DXMatrixIdentity(&VSViewPosMatrix);
@@ -1542,6 +1542,7 @@
15421542 pd3dDevice->SetTexture(0, ptextures[mapTextureID[textureID]] );
15431543 }
15441544 #else
1545+ if( hPSEnable2DRendering != NULL ){ pPSConstantTable->SetBool(pd3dDevice, hPSEnable2DRendering, false); }
15451546 if( mapTextureID[textureID] == -1 ){
15461547 pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE);
15471548 pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
@@ -1594,6 +1595,7 @@
15941595 pd3dDevice->SetTexture(0, ptextures[mapTextureID[textureID]] );
15951596 }
15961597 #else
1598+ if( hPSEnable2DRendering != NULL ){ pPSConstantTable->SetBool(pd3dDevice, hPSEnable2DRendering, false); }
15971599 if( mapTextureID[textureID] == -1 ){
15981600 pd3dDevice->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE);
15991601 pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
@@ -1727,6 +1729,7 @@
17271729 pd3dDevice->SetTexture( 0, ptextures[id_texture] );
17281730 }
17291731 #else
1732+ if( hPSEnable2DRendering != NULL ){ pPSConstantTable->SetBool(pd3dDevice, hPSEnable2DRendering, false); }
17301733 if( id_texture == -1 ){
17311734 pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
17321735 pd3dDevice->SetTexture(0, NULL);
@@ -1799,6 +1802,7 @@
17991802
18001803 //テクスチャとデータ形式を設定し描画
18011804 #if GRAPHIC_ENGINE == 1
1805+ if( hPSEnable2DRendering != NULL ){ pPSConstantTable->SetBool(pd3dDevice, hPSEnable2DRendering, false); }
18021806 pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, true);
18031807 #endif
18041808 pd3dDevice->SetTexture(0, ptextures[id_texture]);
@@ -1861,6 +1865,7 @@
18611865 }
18621866
18631867 #if GRAPHIC_ENGINE == 1
1868+ if( hPSEnable2DRendering != NULL ){ pPSConstantTable->SetBool(pd3dDevice, hPSEnable2DRendering, false); }
18641869 pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
18651870 #endif
18661871 pd3dDevice->SetTexture(0, NULL);
@@ -2021,12 +2026,6 @@
20212026 #else
20222027 pPSConstantTable->SetBool(pd3dDevice, hPSEnableFog, false);
20232028 #endif
2024-
2025-#if GRAPHIC_ENGINE == 1
2026- if( hPSEnable2DRender != NULL ){
2027- pPSConstantTable->SetBool(pd3dDevice, hPSEnable2DRender, true);
2028- }
2029-#endif
20302029 }
20312030
20322031 //! @brief テクスチャフォントサイズ計算
@@ -2083,6 +2082,7 @@
20832082
20842083 //テクスチャをフォントテクスチャに設定
20852084 #if GRAPHIC_ENGINE == 1
2085+ if( hPSEnable2DRendering != NULL ){ pPSConstantTable->SetBool(pd3dDevice, hPSEnable2DRendering, true); }
20862086 pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, true);
20872087 #endif
20882088 pd3dDevice->SetTexture( 0, ptextures[TextureFont] );
@@ -2220,6 +2220,7 @@
22202220
22212221 //テクスチャをフォントテクスチャに設定
22222222 #if GRAPHIC_ENGINE == 1
2223+ if( hPSEnable2DRendering != NULL ){ pPSConstantTable->SetBool(pd3dDevice, hPSEnable2DRendering, true); }
22232224 pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, true);
22242225 #endif
22252226 pd3dDevice->SetTexture( 0, ptextures[TextureDebugFont] );
@@ -2302,6 +2303,7 @@
23022303 }
23032304
23042305 #if GRAPHIC_ENGINE == 1
2306+ if( hPSEnable2DRendering != NULL ){ pPSConstantTable->SetBool(pd3dDevice, hPSEnable2DRendering, true); }
23052307 pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
23062308 #endif
23072309 pd3dDevice->SetTexture(0, NULL);
@@ -2342,6 +2344,7 @@
23422344 }
23432345
23442346 #if GRAPHIC_ENGINE == 1
2347+ if( hPSEnable2DRendering != NULL ){ pPSConstantTable->SetBool(pd3dDevice, hPSEnable2DRendering, true); }
23452348 pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
23462349 #endif
23472350 pd3dDevice->SetTexture(0, NULL);
@@ -2388,6 +2391,7 @@
23882391 }
23892392
23902393 #if GRAPHIC_ENGINE == 1
2394+ if( hPSEnable2DRendering != NULL ){ pPSConstantTable->SetBool(pd3dDevice, hPSEnable2DRendering, true); }
23912395 pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, false);
23922396 #endif
23932397 pd3dDevice->SetTexture(0, NULL);
@@ -2460,6 +2464,7 @@
24602464
24612465 //テクスチャとデータ形式を設定し、描画
24622466 #if GRAPHIC_ENGINE == 1
2467+ if( hPSEnable2DRendering != NULL ){ pPSConstantTable->SetBool(pd3dDevice, hPSEnable2DRendering, true); }
24632468 pPSConstantTable->SetBool(pd3dDevice, hPSEnableTexture, true);
24642469 #endif
24652470 pd3dDevice->SetTexture( 0, ptextures[id] );
@@ -2503,12 +2508,6 @@
25032508 pPSConstantTable->SetBool(pd3dDevice, hPSEnableFog, true);
25042509 #endif
25052510 }
2506-
2507-#if GRAPHIC_ENGINE == 1
2508- if( hPSEnable2DRender != NULL ){
2509- pPSConstantTable->SetBool(pd3dDevice, hPSEnable2DRender, false);
2510- }
2511-#endif
25122511 }
25132512
25142513 //! @brief 画面のスクリーンショットを保存
--- trunk/d3dgraphics.h (revision 357)
+++ trunk/d3dgraphics.h (revision 358)
@@ -197,12 +197,12 @@
197197 LPDIRECT3DPIXELSHADER9 pPixelShader; //!< ピクセルシェーダー
198198 LPD3DXCONSTANTTABLE pPSConstantTable; //!< ピクセルシェーダーの定数テーブル
199199 D3DXHANDLE hPSViewPos; //!< ピクセルシェーダーのカメラ座標
200+ D3DXHANDLE hPSEnable2DRendering; //!< ピクセルシェーダーの2D描画フラグ
200201 D3DXHANDLE hPSEnableTexture; //!< ピクセルシェーダーのテクスチャフラグ
201202 D3DXHANDLE hPSEnableFog; //!< ピクセルシェーダーのフォグ有効フラグ
202203 D3DXHANDLE hPSFogColor; //!< ピクセルシェーダーのフォグ色
203204 D3DXHANDLE hPSFogStart; //!< ピクセルシェーダーのフォグの開始深度
204205 D3DXHANDLE hPSFogEnd; //!< ピクセルシェーダーのフォグの終了深度
205- D3DXHANDLE hPSEnable2DRender; //!< ピクセルシェーダーの2D描画フラグ
206206 D3DXMATRIX VSWorldPosMatrix; //!< 頂点シェーダーに与えた変換行列
207207 D3DXMATRIX VSViewPosMatrix; //!< 頂点シェーダーに与えた変換行列
208208 D3DXMATRIX VSViewProjMatrix; //!< 頂点シェーダーに与えた変換行列