Jump to content

Recommended Posts

  • Forum Moderator
2 hours ago, ItamisCZ said:

Hi, have anyone DX9 fix?  

 

When i try to compile source, visual studio give an error identifier "LPDIRECT3DTEXTURE8" is undefined.

LPDIRECT3DTEXTURE8 > LPDIRECT3DTEXTURE9

 

spacer.png

Edited by Metin2 Dev
Core X - External 2 Internal

Gurgarath
coming soon

Link to comment
Share on other sites

6 hours ago, Gurgarath said:

LPDIRECT3DTEXTURE8 > LPDIRECT3DTEXTURE9

 

spacer.png

 

I've already tried this, before i wrote comment.

 

It gives another errors.

 

 

Spoiler

Error   C2660    'IDirect3DDevice9::GetRenderTarget' : function does not take 1 arguments    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    83    
Error (active)    E0165    too few arguments in function call   eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    64    
Error (active)    E0165    too few arguments in function call   eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    78    
Error (active)    E0165    too few arguments in function call   eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    83    
Error (active)    E0167    Argument of type "LPDIRECT3DSURFACE9" is incompatible with parameter of type "DWORD".    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    85    
Error (active)    E0167    Argument of type "LPDIRECT3DSURFACE9" is incompatible with parameter of type "DWORD".    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    90    
Error (active)    E0167    Argument of type "LPDIRECT3DSURFACE9 *" is incompatible with parameter of type "DWORD".    eterlib    C:\Projects\EBin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    78    
Error (active)    E0167    Argument of type "LPDIRECT3DSURFACE9 *" is incompatible with parameter of type "DWORD".    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    83    
Error (active)    E0167    Argument of type "int" is incompatible with parameter of type "LPDIRECT3DVERTEXSHADER9".    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    156    
Error  C2664    'void CStateManager::SetVertexShader(LPDIRECT3DVERTEXSHADER9)' : cannot convert argument 1 from 'int' to 'LPDIRECT3DVERTEXSHADER9'    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    156    
Error    C2664    'void CStateManager::SetVertexShader(LPDIRECT3DVERTEXSHADER9)' : cannot convert argument 1 from 'int' to 'LPDIRECT3DVERTEXSHADER9'    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpImageInstance.cpp    91    
Error  C2660    'IDirect3DDevice9::CreateTexture' : function does not take 7 arguments    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    64    
Error  C2660    'IDirect3DDevice9::CreateDepthStencilSurface' : function does not take 5 arguments    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    78    
Error  C2664    'HRESULT IDirect3DDevice9::SetRenderTarget(DWORD,IDirect3DSurface9 *)' : cannot convert argument 1 from 'LPDIRECT3DSURFACE9' to 'DWORD'    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    85    
Error  C2664    'HRESULT IDirect3DDevice9::SetRenderTarget(DWORD,IDirect3DSurface9 *)' : cannot convert argument 1 from 'LPDIRECT3DSURFACE9' to 'DWORD'    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    90    

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Premium
On 2/11/2020 at 8:56 AM, ItamisCZ said:

 

I've already tried this, before i wrote comment.

 

It gives another errors.

 

 

  Reveal hidden contents

Error   C2660    'IDirect3DDevice9::GetRenderTarget' : function does not take 1 arguments    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    83    
Error (active)    E0165    too few arguments in function call   eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    64    
Error (active)    E0165    too few arguments in function call   eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    78    
Error (active)    E0165    too few arguments in function call   eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    83    
Error (active)    E0167    Argument of type "LPDIRECT3DSURFACE9" is incompatible with parameter of type "DWORD".    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    85    
Error (active)    E0167    Argument of type "LPDIRECT3DSURFACE9" is incompatible with parameter of type "DWORD".    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    90    
Error (active)    E0167    Argument of type "LPDIRECT3DSURFACE9 *" is incompatible with parameter of type "DWORD".    eterlib    C:\Projects\EBin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    78    
Error (active)    E0167    Argument of type "LPDIRECT3DSURFACE9 *" is incompatible with parameter of type "DWORD".    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    83    
Error (active)    E0167    Argument of type "int" is incompatible with parameter of type "LPDIRECT3DVERTEXSHADER9".    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    156    
Error  C2664    'void CStateManager::SetVertexShader(LPDIRECT3DVERTEXSHADER9)' : cannot convert argument 1 from 'int' to 'LPDIRECT3DVERTEXSHADER9'    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    156    
Error    C2664    'void CStateManager::SetVertexShader(LPDIRECT3DVERTEXSHADER9)' : cannot convert argument 1 from 'int' to 'LPDIRECT3DVERTEXSHADER9'    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpImageInstance.cpp    91    
Error  C2660    'IDirect3DDevice9::CreateTexture' : function does not take 7 arguments    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    64    
Error  C2660    'IDirect3DDevice9::CreateDepthStencilSurface' : function does not take 5 arguments    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    78    
Error  C2664    'HRESULT IDirect3DDevice9::SetRenderTarget(DWORD,IDirect3DSurface9 *)' : cannot convert argument 1 from 'LPDIRECT3DSURFACE9' to 'DWORD'    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    85    
Error  C2664    'HRESULT IDirect3DDevice9::SetRenderTarget(DWORD,IDirect3DSurface9 *)' : cannot convert argument 1 from 'LPDIRECT3DSURFACE9' to 'DWORD'    eterlib    C:\Projects\Bin (Source)\client\EterLib\GrpRenderTargetTexture.cpp    90    

 

It's not so hard u should managed fast if u read documentation from dx9

Link to comment
Share on other sites

  • 2 weeks later...
On 9/9/2019 at 10:10 AM, Rafiloni said:
 

hello I have a problem with the system. A compilation of the effective treatment course selectmodel interrupts the client.

void CRenderTarget::SelectModel(const DWORD index)
{
	if (index == 0)
	{
		//delete m_pModel;
		m_pModel.reset();
		return;
	}

	CInstanceBase::SCreateData kCreateData{};


	kCreateData.m_bType = CActorInstance::TYPE_NPC; // Dynamic Type
	kCreateData.m_dwRace = index;
	
	auto model = std::make_unique<CInstanceBase>();
	if (!model->Create(kCreateData))
	{
		if (m_pModel)
		{
			m_pModel.reset();
		}
		return;
	}
	m_pModel = std::move(model);

	m_pModel->GetGraphicThingInstancePtr()->ClearAttachingEffect();
	m_modelRotation = 0.0f;
	m_pModel->Refresh(CRaceMotionData::NAME_WAIT, true);
	m_pModel->SetLoopMotion(CRaceMotionData::NAME_WAIT);
	m_pModel->SetAlwaysRender(true);
	m_pModel->SetRotation(0.0f);

	auto& camera_manager = CCameraManager::instance();
	camera_manager.SetCurrentCamera(CCameraManager::SHOPDECO_CAMERA);
	camera_manager.GetCurrentCamera()->SetTargetHeight(110.0);
	camera_manager.ResetToPreviousCamera();
}

after function tests

kCreateData.m_bType = CActorInstance::TYPE_NPC; // Dynamic Type
	kCreateData.m_dwRace = index;
	
	auto model = std::make_unique<CInstanceBase>();
	TraceError("OK"); //displays ok
	if (!model->Create(kCreateData))
	{
		TraceError("OK"); //does not display
		if (m_pModel)
		{
			m_pModel.reset();
		}
		return;
	}
	TraceError("OK"); //does not display

the error closes the client without syser and log errors. Compiles distriubute. Please help.

I have the same problem, I can't do make_unique from the cinstancebase. The function runs through but then the client closes.

Link to comment
Share on other sites

  • 1 month later...
  • Management
17 hours ago, Cysgod said:

Original Archive (with password from start post):

This is the hidden content, please

 

Sassy Hair GIF

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 5
  • Angry 1
  • Good 6
  • Love 5
Link to comment
Share on other sites

  • 4 months later...
  • Bronze

wtfisthis.JPG

 

If you have this problem like me where RenderTarget renders the lod versions of the models you can do the the following thing to fix it. (You can also simply delete the lod files from your pack but you are gonna have to do it for every class and every armor that class wears. Besides that you can also have huge performance problems. There is a reason why LOD exists.)

 

Open EterGrnLib/ThingInstance.h

//1.)Find
    void        SetMotionAtEnd();

//2.) Add after:
    void        SetSkipLod(bool value) { m_bSkipLod = value; }
    bool        GetSkipLod() { return m_bSkipLod; }

//3.) Find:
std::map<DWORD, CGraphicThing::TRef*>    m_roMotionThingMap;
//4.) Add after:
bool                                    m_bSkipLod;

 

Open EterGrnLib/ThingInstance.cpp

//1.) Find:
	m_v3Center = D3DXVECTOR3(0.0f, 0.0f, 0.0f);
//2.) Add after:
	m_bSkipLod = false;

//3.) Find:
	CCamera* pcurCamera = CCameraManager::Instance().GetCurrentCamera();
//4.) Add before:
	if (m_bSkipLod)
		return;

 

Open EterLib/CRenderTarget.cpp

//1.) Find:
	m_pModel->GetGraphicThingInstancePtr()->ClearAttachingEffect();
//2.) Add before:
	m_pModel->GetGraphicThingInstancePtr()->SetSkipLod(true);

 

This should be enough to fix the issue. Note that this bug does not happen on every versions of granny. Just try to render a player model with render target and if your character looks like mine then you can apply this to fix it.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Good 1
Link to comment
Share on other sites

  • 9 months later...
  • 2 weeks later...
  • Silver
On 5/25/2021 at 11:31 AM, ameer668 said:

i have these errors when trying to build my client source

hvzdIb0.png

am sure i put everything in its place

i think this a missing #include problem

what can i do ?

Include the missing files via VisualStudio.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 2
Link to comment
Share on other sites

  • 2 months later...

if someone have problem with view big models.

Scaling is the solution

EterGrnLib\ThingInstance.cpp

after:
float CGraphicThingInstance::GetHeight()

add:
bool CGraphicThingInstance::GetSize(float & fHeight, float & fWidth, float & fDepth)
{
	fHeight = fWidth = fDepth = 0.0f;

	if (m_LODControllerVector.empty())
		return false;

	CGrannyModelInstance* pModelInstance = m_LODControllerVector[0]->GetModelInstance();
	if (!pModelInstance)
		return false;

	D3DXVECTOR3 vtMin, vtMax;
	pModelInstance->GetBoundBox(&vtMin, &vtMax);

	fHeight = fabs(vtMin.z - vtMax.z);
	fWidth = fabs(vtMin.x - vtMax.x);
	fDepth = fabs(vtMin.y - vtMax.y);

	return true;
}

EterGrnLib\ThingInstance.h

after:
		float		GetHeight();

add:
		bool		GetSize(float & fHeight, float & fWidth, float & fDepth);

UserInterface\InstanceBase.cpp

after:
void CInstanceBase::SetInstanceType(int iInstanceType)
  
add:
bool CInstanceBase::GetInstanceSize(float & fHeight, float & fWidth, float & fDepth)
{
	return m_GraphicThingInstance.GetSize(fHeight, fWidth, fDepth);
}

void CInstanceBase::SetScale(float fScale)
{
	m_GraphicThingInstance.SetScale(fScale, fScale, fScale, true);
}

void CInstanceBase::SetScale(float fx, float fy, float fz)
{
	m_GraphicThingInstance.SetScale(fx, fy, fz, true);
}

UserInterface\InstanceBase.h

after:
		void					SetInstanceType(int iInstanceType);

add:
		bool					GetInstanceSize(float & fHeight, float & fWidth, float & fDepth);
		void					SetScale(float fScale);
		void					SetScale(float fx, float fy, float fz);

in your CRenderTraget function use:

	if (m_pModel)
	{
		float fHieght = 0.0f, fWidth = 0.0f, fDepth = 0.0f;
		if(m_pModel->GetInstanceSize(fHieght, fWidth, fDepth))
		{
			// 150.0f is max height / width / depth of model
			float fsh = 150.0f / fHieght;
			float fsw = 150.0f / fWidth;
			float fsd = 150.0f / fDepth;

			// here u can use float fMin = std::min({fsh,fsw,fsd});
			float fMin = fsh < fsw ? fsh : fsw;
			fMin = fsd < fMin ? fsd : fMin;

			m_pModel->SetScale(fMin);
		}
	}

like: 

fuz-36d3-BzbVdQDCHtvrNUmR.jpg

Edited by Metin2 Dev
Core X - External 2 Internal
  • Good 2
Link to comment
Share on other sites

  • 2 weeks later...
  • 7 months later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.