In RealSpace2 project:
Remove these files: RBspObject.h and RBspObject.cpp.
Add all files in the MOD folder to the project.
Add the "MOD" folder path to the includes in the project Properties.
Add the "Include" folder path to the includes in the project Properties.
Go to the file in bold:
Add the headers in green (at the top of the file)
pair(red/green) = serach for red -> change to green
Include the .lib provided in "lib" folder to gunz project.Code:Gunz/ZActor.cpp - RBspObject* r_map = ZGetGame()->GetWorld()->GetBsp(); + IBspObject* r_map = ZGetGame()->GetWorld()->GetBsp(); Gunz/ZCharacter.cpp - RBspObject* r_map = ZGetGame()->GetWorld()->GetBsp(); + IBspObject* r_map = ZGetGame()->GetWorld()->GetBsp(); Gunz/ZInterfaceBackground.h - RBspObject* m_pLogin; + IBspObject* m_pLogin; - RBspObject* GetChurchEnd() { return m_pLogin; } + IBspObject* GetChurchEnd() { return m_pLogin; } Gunz/ZInterfaceBackground.cpp + #include "BspLoader.h" - m_pLogin = new RBspObject(); - m_pLogin->Open( DIR_LOGIN"/login.rs", descExt); + m_pLogin = BspLoader::Load(DIR_LOGIN"/login.rs", descExt); Gunz/ZMapDesc.h - bool Open(RBspObject* pBspObject); + bool Open(IBspObject* pBspObject); Gunz/ZMapDesc.cpp - bool ZMapDesc::Open(RBspObject* pBspObject) + bool ZMapDesc::Open(IBspObject* pBspObject) Gunz/ZShadow.cpp -bool ZShadow::setMatrix( RVisualMesh& vmesh, float size_ /* = 100.f */, RBspObject* p_map /* = 0 */) +bool ZShadow::setMatrix( RVisualMesh& vmesh, float size_ /* = 100.f */, IBspObject* p_map /* = 0 */) Gunz/ZShadow.h - bool setMatrix( RVisualMesh& vmesh, float size_ = 100.f, RBspObject* p_map = 0 ); + bool setMatrix( RVisualMesh& vmesh, float size_ = 100.f, IBspObject* p_map = 0 ); Gunz/ZWorld.cpp + #include "BspLoader.h" - m_pBsp = new RBspObject; + m_pBsp = BspLoader::Load(m_szBspName, descExt); - if(!m_pBsp->Open(m_szBspName, descExt, RBspObject::ROF_RUNTIME,ZWorldProgressCallBack,pLoading)) + if (!m_pBsp) Gunz/ZWorld.h - RBspObject *m_pBsp; + IBspObject *m_pBsp; - RBspObject *GetBsp() { return m_pBsp; } + IBspObject *GetBsp() { return m_pBsp; } RealSpace2/Include/RLenzFlare.h - bool Render( rvector& light_pos, rvector& centre_, RBspObject* pbsp_ ); + bool Render( rvector& light_pos, rvector& centre_, IBspObject* pbsp_ ); - bool Render( rvector& centre_ , RBspObject* pbsp_ ); + bool Render( rvector& centre_ , IBspObject* pbsp_ ); RealSpace2/Source/RLenzFlare.cpp - bool RLenzFlare::Render( rvector& light_pos_, rvector& centre_, RBspObject* pbsp_ ) + bool RLenzFlare::Render( rvector& light_pos_, rvector& centre_, IBspObject* pbsp_ ) -bool RLenzFlare::Render( rvector& centre_, RBspObject* pbsp_ ) +bool RLenzFlare::Render( rvector& centre_, IBspObject* pbsp_ ) RealSpace2/Source/RealSpace2.cpp + #include "CustomMap.h" search for: HRESULT hr=g_pd3dDevice->Reset(&g_d3dpp); paste: + CustomMap::OnLost(); before HRESULT hr=g_pd3dDevice->Reset(&g_d3dpp); + CustomMap::OnReset(); after HRESULT hr=g_pd3dDevice->Reset(&g_d3dpp);
Compile everything and copy *.txt and Interface.dll to gunz client folder.
If the client crash when throwing grenades, debug the client find the code where it occurs the "access violation" and add an "if (ptr != NULL)" test.
If you find any bug or client crash (it's probably because I forgot to list some code change).
So you can post the error, where it occurs and I will try fix it and reply with a patch.
How to add RS3 maps: http://forum.ragezone.com/f245/runna...2-maps-934903/
As this release is open-source any changes/improvements you made in the code you should release it too for free to ragezone community.
Correction:This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
In ZWorld.cpp: (ZWorld::Create function)
Added attachment with Interface.dll src.Code:previous: Gunz/ZWorld.cpp + #include "BspLoader.h" - m_pBsp = new RBspObject; - if(!m_pBsp->Open(m_szBspName, descExt, RBspObject::ROF_RUNTIME,ZWorldProgressCallBack,pLoading)) + if (!m_pBsp) ----------------------------------------------------- Corrected: in line: - m_pBsp = new RBspObject; change to : + m_pBsp = BspLoader::Load(m_szBspName, descExt);



![[TUTORIAL+CODE]Adding support to RS3 maps in gunz 1.5](http://ragezone.com/hyper728.png)


