[C++] FULL DirectX 9 Güncellemesi Zemin Bozulması ve CWebBrowser Fixli

Kaptan Yosun

Moderatör
Moderatör
Geliştirici
Yardımsever Üye
Mesaj
1.263
Çözümler
46
Beğeni
1.805
Puan
1.339
Ticaret Puanı
0
:mmt-hakkinda:
Öncelikle, bizimle bunu paylaştığı için @hasanmacit 'e teşekkür etmek istiyorum.

Ancak malumunuz, @hasanmacit 'in paylaştığı DirectX9 güncellemesinde bir takım problemler var. CWebBrowser'ın bozulması veya aynı anda iki Client çalışınca birindeki zemin dokusunun bozulması gibi.

zeminbozulmasi.webp

Ben bu problemleri, GrpDevice gibi bazı kısımları değiştirerek düzelttim.

Aşağıda verdiğim DirectX9_Fixed.diff dosyasını
Linkleri görebilmek için giriş yap veya kayıt ol.
'ye yükleyip, gerekli satırları kendi projenizin kaynak kodu içinde düzenlerseniz, problemsiz bir DirectX9 güncellemesi yapmış olacaksınız. Anlatım Mainline'a göre yapıldı. Benim dosyalarımda sizde olan bazı dosyalar veya fonksiyonlar olmayabilir(örn MapOutdoorRenderSTP.cpp), bende olmayıp sizde olan kısımları @hasanmacit 'in konusundaki anlatımdan alabilirsiniz.

:mmt-resimler:

1748201012096.webp



:mmt-indir:
Burayı görüntülemek için üye girişi yapmalı veya kayıt olmalısınız.
 
Son düzenleme:
Usta / Premium üye koşulunu kaldırdım arkadaşlar faydalanabilirsiniz.
 
:mmt-حول:
أولاً، أود أن أشكر @hasanmacit على مشاركة هذا معنا.
[محتوى التضمين = "thread-12861"]https://www.mmotutkunlari.com/konu/dev-payla%C5%9F%C4%B1m-directx9-g%C3%BCncelmeleri.12861/[/EMBED]

ومع ذلك، كما تعلمون، هناك بعض المشاكل مع تحديث DirectX9 الذي شاركه @hasanmacit. مثل تعطل متصفح CWebBrowser أو تعطل نسيج الأرض عند تشغيل عميلين في نفس الوقت.


لقد قمت بإصلاح هذه المشاكل عن طريق تغيير بعض الأجزاء مثل GrpDevice.

إذا قمت بتحميل ملف DirectX9_Fixed .diff الذي قدمته أدناه إلى
Linkleri görebilmek için giriş yap veya kayıt ol.
وقمت بتحرير الأسطر الضرورية في الكود المصدر الخاص بمشروعك، فسوف تحصل على تحديث DirectX9 خاليًا من المشاكل. تمت الرواية حسب Mainline. قد لا تحتوي ملفاتي على بعض الملفات أو الوظائف الموجودة لديك (على سبيل المثال MapOutdoorRenderSTP.cpp). يمكنك الحصول على الأجزاء التي لا أملكها ولكن لديك من الشرح الموجود في موضوع @hasanmacit.

:mmt-صور:

23631 eklentisini görüntüle


:mmt-download:
[SPECIALC="اقتباس"][/SPECIALC]​
شكرًا
 
Arkadaşlar ufak bir patch paylaşıyorum. Ana konudaki rehberi zaten uyguladıysanız bu patchi de yapın. Şimdi ana konudaki dosyayı da güncelledim.
@Sys 'ye yardımları için teşekkürler.

DirectX9_Patch1.diff:
Genişlet Daralt Kopyala
diff --git a/Client/ClientSource/source/EterGrnLib/ModelInstanceRender.cpp b/Client/ClientSource/source/EterGrnLib/ModelInstanceRender.cpp
index e831414..f6cd21b 100644
--- a/Client/ClientSource/source/EterGrnLib/ModelInstanceRender.cpp
+++ b/Client/ClientSource/source/EterGrnLib/ModelInstanceRender.cpp
@@ -231,7 +231,7 @@ void CGrannyModelInstance::RenderMeshNodeListWithOneTexture (CGrannyMesh::EType
 
             CGrannyMaterial& rkMtrl = m_kMtrlPal.GetMaterialRef (pTriGroupNode->mtrlIndex);
             rkMtrl.ApplyRenderState();
-            STATEMANAGER.DrawIndexedPrimitive (D3DPT_TRIANGLELIST, vtxMeshBasePos, vtxCount, pTriGroupNode->idxPos, pTriGroupNode->triCount);
+            STATEMANAGER.DrawIndexedPrimitive (D3DPT_TRIANGLELIST, 0, vtxCount, pTriGroupNode->idxPos, pTriGroupNode->triCount, vtxMeshBasePos);
             rkMtrl.RestoreRenderState();
 
             pTriGroupNode = pTriGroupNode->pNextTriGroupNode;
@@ -270,7 +270,7 @@ void CGrannyModelInstance::RenderMeshNodeListWithTwoTexture (CGrannyMesh::EType
             const CGrannyMaterial& rkMtrl = m_kMtrlPal.GetMaterialRef (pTriGroupNode->mtrlIndex);
             STATEMANAGER.SetTexture (0, rkMtrl.GetD3DTexture (0));
             STATEMANAGER.SetTexture (1, rkMtrl.GetD3DTexture (1));
-            STATEMANAGER.DrawIndexedPrimitive (D3DPT_TRIANGLELIST, vtxMeshBasePos, vtxCount, pTriGroupNode->idxPos, pTriGroupNode->triCount);
+            STATEMANAGER.DrawIndexedPrimitive (D3DPT_TRIANGLELIST, 0, vtxCount, pTriGroupNode->idxPos, pTriGroupNode->triCount, vtxMeshBasePos);
             pTriGroupNode = pTriGroupNode->pNextTriGroupNode;
         }
         /////
@@ -304,7 +304,7 @@ void CGrannyModelInstance::RenderMeshNodeListWithoutTexture (CGrannyMesh::EType
         while (pTriGroupNode)
         {
             ms_faceCount += pTriGroupNode->triCount;
-            STATEMANAGER.DrawIndexedPrimitive (D3DPT_TRIANGLELIST, vtxMeshBasePos, vtxCount, pTriGroupNode->idxPos, pTriGroupNode->triCount);
+            STATEMANAGER.DrawIndexedPrimitive (D3DPT_TRIANGLELIST, 0, vtxCount, pTriGroupNode->idxPos, pTriGroupNode->triCount, vtxMeshBasePos);
             pTriGroupNode = pTriGroupNode->pNextTriGroupNode;
         }
         /////
diff --git a/Client/ClientSource/source/EterLib/StateManager.cpp b/Client/ClientSource/source/EterLib/StateManager.cpp
index 09149ad..3fdbe28 100644
--- a/Client/ClientSource/source/EterLib/StateManager.cpp
+++ b/Client/ClientSource/source/EterLib/StateManager.cpp
@@ -895,9 +895,9 @@ HRESULT CStateManager::DrawPrimitiveUP (D3DPRIMITIVETYPE PrimitiveType, UINT Pri
     return (m_lpD3DDev->DrawPrimitiveUP (PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride));
 }
 
-HRESULT CStateManager::DrawIndexedPrimitive (D3DPRIMITIVETYPE PrimitiveType, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount)
+HRESULT CStateManager::DrawIndexedPrimitive (D3DPRIMITIVETYPE PrimitiveType, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount, INT baseVertexIndex)
 {
-    return (m_lpD3DDev->DrawIndexedPrimitive (PrimitiveType, minIndex, 0, NumVertices, startIndex, primCount));
+    return (m_lpD3DDev->DrawIndexedPrimitive (PrimitiveType, baseVertexIndex, minIndex, NumVertices, startIndex, primCount));
 }
 
 HRESULT CStateManager::DrawIndexedPrimitiveUP (D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, CONST void* pIndexData,
diff --git a/Client/ClientSource/source/EterLib/StateManager.h b/Client/ClientSource/source/EterLib/StateManager.h
index f0b9af7..b5cb639 100644
--- a/Client/ClientSource/source/EterLib/StateManager.h
+++ b/Client/ClientSource/source/EterLib/StateManager.h
@@ -358,7 +358,7 @@ class CStateManager : public CSingleton<CStateManager>
 
         HRESULT DrawPrimitive (D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
         HRESULT DrawPrimitiveUP (D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, const void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
-        HRESULT DrawIndexedPrimitive (D3DPRIMITIVETYPE PrimitiveType, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount);
+        HRESULT DrawIndexedPrimitive (D3DPRIMITIVETYPE PrimitiveType, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount, INT baseVertexIndex = 0);
         HRESULT DrawIndexedPrimitiveUP (D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, CONST void* pIndexData,
                                         D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
 
:mmt-hakkinda:
Öncelikle, bizimle bunu paylaştığı için @hasanmacit 'e teşekkür etmek istiyorum.

Ancak malumunuz, @hasanmacit 'in paylaştığı DirectX9 güncellemesinde bir takım problemler var. CWebBrowser'ın bozulması veya aynı anda iki Client çalışınca birindeki zemin dokusunun bozulması gibi.


Ben bu problemleri, GrpDevice gibi bazı kısımları değiştirerek düzelttim.

Aşağıda verdiğim DirectX9_Fixed.diff dosyasını
Linkleri görebilmek için giriş yap veya kayıt ol.
'ye yükleyip, gerekli satırları kendi projenizin kaynak kodu içinde düzenlerseniz, problemsiz bir DirectX9 güncellemesi yapmış olacaksınız. Anlatım Mainline'a göre yapıldı. Benim dosyalarımda sizde olan bazı dosyalar veya fonksiyonlar olmayabilir(örn MapOutdoorRenderSTP.cpp), bende olmayıp sizde olan kısımları @hasanmacit 'in konusundaki anlatımdan alabilirsiniz.

:mmt-resimler:

23631 eklentisini görüntüle


:mmt-indir:
Alıntılarda özel içerikler gözükmez.

hocam kullandığım client'de;
#include <d3dx8.h> bu şekilde sizin verdiğiniz diff ise #include <DirectX8/d3dx8.h> yani böylemi yapmam gerekiyor #include <DirectX9/d3dx9.h>
yada clientde olduğu gibi sadece include <d3dx9.h> böyle güncellememmi gerekiyor ?
 
Kendi extern düzeninize göre. Benim include headerlarım klasörler altında olduğu için öyle, seninkiler include ana dizinindeyse klasör adı yazma tabi.

1750077145106.webp
 
Geri
Üst