You last visited: Today at 01:57
Advertisement
Model Change Problem
Discussion on Model Change Problem within the Flyff Private Server forum part of the Flyff category.
12/15/2016, 08:25
#1
elite*gold: 0
Join Date: Dec 2012
Posts: 239
Received Thanks: 33
Model Change Problem
I trying to fix the Model change from Pixel Source, however, after a couple of Minutes of Loading it crashing neuz and there's an error message saying
Error
Neuz.exe caused an EXCEPTION_ACCESS_VIOLATION in module Neuz.exe at 001B:005E9351, CWndModelChange::OnDraw()+4401 byte(s), c:\a-flyfffiles\official source\_interface\wndfield.cpp, line 30102+0011 byte(s)
- Registers
EAX=00000000 EBX=0014FC24 ECX=00000000 EDX=00B1CC04 ESI=00000052
EDI=77837FB0 EBP=0014FC10 ESP=0014F310 EIP=005E9351 FLG=00210293
CS=001B DS=0023 SS=0023 ES=0023 FS=003B GS=0000
001B:005E9351 Neuz.exe, CWndModelChange::OnDraw()+4401 byte(s)
001B:0053AB54 Neuz.exe, CWndBase::Paint()+0644 byte(s)
001B:0053A7CE Neuz.exe, CWndBase::PaintRoot()+0574 byte(s)
001B:00474ADE Neuz.exe, CNeuzApp::Render()+0590 byte(s)
001B:004B2E9A Neuz.exe, CD3DApplication::Render3DEnvironment()+0442 byte(s)
001B:004B2CA1 Neuz.exe, CD3DApplication::Run()+0305 byte(s)
001B:0047C94C Neuz.exe, WinMain()+0332 byte(s)
001B:0097936C Neuz.exe, WinMainCRTStartup()+0388 byte(s)
001B:77828E94 KERNEL32.DLL, BaseThreadInitThunk()+0036 byte(s)
001B:77BAE9F2 ntdll.dll, RtlClearAllBits()+1026 byte(s)
001B:77BAE9C1 ntdll.dll, RtlClearAllBits()+0977 byte(s)
OnDraw Func.:
Code:
void CWndModelChange::OnDraw( C2DRender* p2DRender )
{
if( m_bStart )
{
static CRect rectStaticTemp;
LPWNDCTRL lpStatic = GetWndCtrl( WIDC_PC_DELAY );
rectStaticTemp.TopLeft().y = lpStatic->rect.top+2;
rectStaticTemp.TopLeft().x = lpStatic->rect.left+2;
rectStaticTemp.BottomRight().y = lpStatic->rect.bottom;
int nGaugeWidth(lpStatic->rect.left + static_cast<int>(static_cast<float>(lpStatic->rect.right - lpStatic->rect.left) * m_fGaugeRate));
nGaugeWidth = nGaugeWidth < lpStatic->rect.right ? nGaugeWidth : lpStatic->rect.right;
rectStaticTemp.BottomRight().x = nGaugeWidth;
assert(m_pVBSmeltGauge != NULL);
m_pTheme->RenderGauge(p2DRender, &rectStaticTemp, 0xffffffff, m_pVBSmeltGauge, &m_texGauEmptyNormal);
}
if( m_pMainItem && m_pItemElem )
{
CItemElem* pCurrentElem = m_pItemElem;
LPDIRECT3DDEVICE9 pd3dDevice = p2DRender->m_pd3dDevice;
pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW );
pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, FALSE );
pd3dDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
pd3dDevice->SetSamplerState ( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
pd3dDevice->SetSamplerState ( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
pd3dDevice->SetRenderState( D3DRS_AMBIENT, D3DCOLOR_ARGB( 255, 255,255,255) );
pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
CRect rect = GetClientRect();
if( pCurrentElem->GetProp()->dwItemKind1 != IK1_ARMOR )
{
D3DVIEWPORT9 viewport;
D3DXMATRIXA16 matWorld;
D3DXMATRIXA16 matScale;
D3DXMATRIXA16 matRot;
D3DXMATRIXA16 matTrans;
D3DXCOLOR color;
D3DXMatrixIdentity(&matScale);
D3DXMatrixIdentity(&matTrans);
D3DXMatrixIdentity(&matWorld);
D3DXVECTOR3 vEyePt(0.0f, 0.0f, 0.0f);
D3DXVECTOR3 vLookatPt(0.0f, 0.0f, 0.0f);
D3DXVECTOR3 vUpVec(0.0f, 1.0f, 0.0f);
if( (pCurrentElem->GetProp()->dwItemKind3 == IK3_AXE || pCurrentElem->GetProp()->dwItemKind3 == IK3_SWD ) )
{
if(pCurrentElem->GetProp()->dwHanded == HD_ONE)
{
vEyePt.x = 0.0f;
vEyePt.y = 3.0f;
vEyePt.z = 0.0f;
vLookatPt.x = 0.6f;
vLookatPt.y = -0.2f;
vLookatPt.z = 0.0f;
}
else if(pCurrentElem->GetProp()->dwHanded == HD_TWO )
{
vEyePt.x = 1.0f;
vEyePt.y = 5.0f;
vEyePt.z = 0.0f;
vLookatPt.x = 1.2f;
vLookatPt.y = -0.2f;
vLookatPt.z = 0.0f;
}
}
else if(pCurrentElem->GetProp()->dwItemKind3 == IK3_YOYO ||
pCurrentElem->GetProp()->dwItemKind3 == IK3_KNUCKLEHAMMER ||
pCurrentElem->GetProp()->dwItemKind3 == IK3_BOW
#ifdef __16_DATA
|| pCurrentElem->GetProp()->dwItemKind3 == IK3_CROSSBOW
#endif
)
{
vEyePt.x = 0.0f;
vEyePt.y = 3.0f;
vEyePt.z = 0.0f;
vLookatPt.x = 0.01f;
vLookatPt.y = -0.2f;
vLookatPt.z = 0.0f;
}
else if(pCurrentElem->GetProp()->dwItemKind3 == IK3_WAND)
{
vEyePt.x = 0.0f;
vEyePt.y = 3.0f;
vEyePt.z = 0.0f;
vLookatPt.x = 0.4f;
vLookatPt.y = -0.2f;
vLookatPt.z = 0.0f;
}
else if(pCurrentElem->GetProp()->dwItemKind3 == IK3_CHEERSTICK ||
pCurrentElem->GetProp()->dwItemKind3 == IK3_STAFF)
{
vEyePt.x = 0.0f;
vEyePt.y = 4.0f;
vEyePt.z = 0.0f;
vLookatPt.x = 0.01f;
vLookatPt.y = -0.2f;
vLookatPt.z = 0.0f;
}
if(m_nStatus == 1)
{
vEyePt.y += m_nEyeYPos;
}
D3DXMATRIXA16 matView;
D3DXMatrixLookAtLH(&matView, &vEyePt, &vLookatPt, &vUpVec);
pd3dDevice->SetTransform(D3DTS_VIEW, &matView);
D3DXMATRIXA16 matProj;
D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f );
pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
m_fRotate += m_fAddRot;
D3DXMatrixRotationX(&matRot, D3DXToRadian( m_fRotate ) );
D3DXMatrixScaling(&matScale, 1.5f, 1.5f, 1.5f);
LPWNDCTRL lpFace = GetWndCtrl( WIDC_CUSTOM1 );
viewport.X = p2DRender->m_ptOrigin.x + lpFace->rect.left;
viewport.Y = p2DRender->m_ptOrigin.y + lpFace->rect.top;
viewport.Width = lpFace->rect.Width();
viewport.Height = lpFace->rect.Height();
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
pd3dDevice->SetViewport(&viewport);
pd3dDevice->Clear(0, NULL, D3DCLEAR_ZBUFFER, 0xffa08080, 1.0f, 0 );
D3DXMatrixMultiply(&matWorld,&matWorld,&matScale);
D3DXMatrixMultiply(&matWorld, &matWorld, &matRot );
D3DXMatrixMultiply(&matWorld, &matWorld, &matTrans );
pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
pd3dDevice->SetRenderState( D3DRS_FOGENABLE, FALSE );
pd3dDevice->SetRenderState( D3DRS_LIGHTING, FALSE );
::SetLight( FALSE );
::SetFog( FALSE );
SetDiffuse( 1.0f, 1.0f, 1.0f );
SetAmbient( 1.0f, 1.0f, 1.0f );
D3DXVECTOR4 vConst( 1.0f, 1.0f, 1.0f, 1.0f );
pd3dDevice->SetVertexShaderConstantF( 95, (float*)&vConst, 1 );
::SetTransformView( matView );
::SetTransformProj( matProj );
m_pMainItem->Render( p2DRender->m_pd3dDevice, &matWorld );
viewport.X = p2DRender->m_ptOrigin.x;
viewport.Y = p2DRender->m_ptOrigin.y;
viewport.Width = p2DRender->m_clipRect.Width();
viewport.Height = p2DRender->m_clipRect.Height();
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
pd3dDevice->SetViewport(&viewport);
pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );
pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
}
else
{
D3DVIEWPORT9 viewport;
LPWNDCTRL lpFace = GetWndCtrl( WIDC_CUSTOM1 );
viewport.X = p2DRender->m_ptOrigin.x + lpFace->rect.left;
viewport.Y = p2DRender->m_ptOrigin.y + lpFace->rect.top;
viewport.Width = lpFace->rect.Width();
viewport.Height = lpFace->rect.Height();
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
pd3dDevice->SetViewport(&viewport);
pd3dDevice->Clear(0, NULL, D3DCLEAR_ZBUFFER, 0xffa08080, 1.0f, 0 ) ;
POINT point = GetMousePoint();
point.x -= 280;
point.y -= 15;
CRect rectViewport( 0, 0, viewport.Width, viewport.Height );
D3DXMATRIX matProj;
D3DXMatrixIdentity( &matProj );
FLOAT fAspect = ( (FLOAT) viewport.Width ) / (FLOAT) viewport.Height ;
FLOAT fov = D3DX_PI / 4.0f;//796.0f;
FLOAT h = cos( fov / 2 ) / sin( fov / 2 );
FLOAT w = h * fAspect;
D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f );
pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
D3DXMATRIX matView;
D3DXVECTOR3 vecLookAt( 0.0f, 0.0f, 3.0f );
D3DXVECTOR3 vecPos( 0.0f, 0.0f, -5.0f );
if(m_nStatus == 1)
{
vecPos.y += m_nEyeYPos;
}
D3DXMatrixLookAtLH( &matView, &vecPos, &vecLookAt, &D3DXVECTOR3(0.0f,1.0f,0.0f) );
pd3dDevice->SetTransform( D3DTS_VIEW, &matView );
D3DXMATRIXA16 matWorld;
D3DXMATRIXA16 matScale;
D3DXMATRIXA16 matRot;
D3DXMATRIXA16 matTrans;
D3DXMatrixIdentity(&matScale);
D3DXMatrixIdentity(&matRot);
D3DXMatrixIdentity(&matTrans);
D3DXMatrixIdentity(&matWorld);
m_fRotate += m_fAddRot;
D3DXMatrixRotationY(&matRot, D3DXToRadian( m_fRotate ) );
D3DXMatrixScaling(&matScale,1.5f,1.5f,1.5f);//1.4f,1.4f,1.4f
D3DXMatrixTranslation(&matTrans,0.0f,-1.1f,0.0f);
D3DXMatrixMultiply(&matWorld,&matWorld,&matScale);
D3DXMatrixMultiply(&matWorld, &matWorld,&matRot);
D3DXMatrixMultiply(&matWorld, &matWorld, &matTrans );
pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_FOGENABLE, FALSE );
pd3dDevice->SetRenderState( D3DRS_LIGHTING, FALSE );//m_bViewLight );
::SetLight( FALSE );
::SetFog( FALSE );
SetDiffuse( 1.0f, 1.0f, 1.0f );
SetAmbient( 1.0f, 1.0f, 1.0f );
m_pMainItem->FrameMove();
D3DXVECTOR4 vConst( 1.0f, 1.0f, 1.0f, 1.0f );
#ifdef __YENV
g_Neuz.m_pEffect->SetVector( g_Neuz.m_hvFog, &vConst );
#else //__YENV
pd3dDevice->SetVertexShaderConstantF( 95, (float*)&vConst, 1 );
#endif //__YENV
::SetTransformView( matView );
::SetTransformProj( matProj );
O3D_ELEMENT* pElem = m_pMainItem->GetParts( PARTS_HAIR );
if( pElem && pElem->m_pObject3D )
{
if( m_Player.m_bySex == SEX_MALE )
{
pElem->m_pObject3D->m_fAmbient[0] = (nMaleHairColor[m_Player.m_byHairMesh][0])/255.f;
pElem->m_pObject3D->m_fAmbient[1] = (nMaleHairColor[m_Player.m_byHairMesh][1])/255.f;
pElem->m_pObject3D->m_fAmbient[2] = (nMaleHairColor[m_Player.m_byHairMesh][2])/255.f;
}
else
{
pElem->m_pObject3D->m_fAmbient[0] = (nFeMaleHairColor[m_Player.m_byHairMesh][0])/255.f;
pElem->m_pObject3D->m_fAmbient[1] = (nFeMaleHairColor[m_Player.m_byHairMesh][1])/255.f;
pElem->m_pObject3D->m_fAmbient[2] = (nFeMaleHairColor[m_Player.m_byHairMesh][2])/255.f;
}
}
m_pMainItem->Render( p2DRender->m_pd3dDevice, &matWorld );
p2DRender->m_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
p2DRender->m_pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );
viewport.X = p2DRender->m_ptOrigin.x;// + 5;
viewport.Y = p2DRender->m_ptOrigin.y;// + 5;
viewport.Width = p2DRender->m_clipRect.Width();
viewport.Height = p2DRender->m_clipRect.Height();
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
pd3dDevice->SetViewport(&viewport);
}
}
//Test Costumbox 2
if( m_pSkinItem && m_pSkinElem > NULL )
{
CItemElem* pCurrentElem = m_pSkinElem;
LPDIRECT3DDEVICE9 pd3dDevice = p2DRender->m_pd3dDevice;
pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW );
pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, FALSE );
pd3dDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
pd3dDevice->SetSamplerState ( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
pd3dDevice->SetSamplerState ( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
pd3dDevice->SetRenderState( D3DRS_AMBIENT, D3DCOLOR_ARGB( 255, 255,255,255) );
pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
CRect rect = GetClientRect();
if( pCurrentElem->GetProp()->dwItemKind1 != IK1_ARMOR )
{
D3DVIEWPORT9 viewport;
D3DXMATRIXA16 matWorld;
D3DXMATRIXA16 matScale;
D3DXMATRIXA16 matRot;
D3DXMATRIXA16 matTrans;
D3DXCOLOR color;
D3DXMatrixIdentity(&matScale);
D3DXMatrixIdentity(&matTrans);
D3DXMatrixIdentity(&matWorld);
D3DXVECTOR3 vEyePt(0.0f, 0.0f, 0.0f);
D3DXVECTOR3 vLookatPt(0.0f, 0.0f, 0.0f);
D3DXVECTOR3 vUpVec(0.0f, 1.0f, 0.0f);
if( (pCurrentElem->GetProp()->dwItemKind3 == IK3_AXE || pCurrentElem->GetProp()->dwItemKind3 == IK3_SWD ) )
{
if(pCurrentElem->GetProp()->dwHanded == HD_ONE)
{
vEyePt.x = 0.0f;
vEyePt.y = 3.0f;
vEyePt.z = 0.0f;
vLookatPt.x = 0.6f;
vLookatPt.y = -0.2f;
vLookatPt.z = 0.0f;
}
else if(pCurrentElem->GetProp()->dwHanded == HD_TWO )
{
vEyePt.x = 1.0f;
vEyePt.y = 5.0f;
vEyePt.z = 0.0f;
vLookatPt.x = 1.2f;
vLookatPt.y = -0.2f;
vLookatPt.z = 0.0f;
}
}
else if(pCurrentElem->GetProp()->dwItemKind3 == IK3_YOYO ||
pCurrentElem->GetProp()->dwItemKind3 == IK3_KNUCKLEHAMMER ||
pCurrentElem->GetProp()->dwItemKind3 == IK3_BOW
#ifdef __16_DATA
|| pCurrentElem->GetProp()->dwItemKind3 == IK3_CROSSBOW
#endif
)
{
vEyePt.x = 0.0f;
vEyePt.y = 3.0f;
vEyePt.z = 0.0f;
vLookatPt.x = 0.01f;
vLookatPt.y = -0.2f;
vLookatPt.z = 0.0f;
}
else if(pCurrentElem->GetProp()->dwItemKind3 == IK3_WAND)
{
vEyePt.x = 0.0f;
vEyePt.y = 3.0f;
vEyePt.z = 0.0f;
vLookatPt.x = 0.4f;
vLookatPt.y = -0.2f;
vLookatPt.z = 0.0f;
}
else if(pCurrentElem->GetProp()->dwItemKind3 == IK3_CHEERSTICK ||
pCurrentElem->GetProp()->dwItemKind3 == IK3_STAFF)
{
vEyePt.x = 0.0f;
vEyePt.y = 4.0f;
vEyePt.z = 0.0f;
vLookatPt.x = 0.01f;
vLookatPt.y = -0.2f;
vLookatPt.z = 0.0f;
}
if(m_nStatus == 1)
{
vEyePt.y += m_nEyeYPos;
}
D3DXMATRIXA16 matView;
D3DXMatrixLookAtLH(&matView, &vEyePt, &vLookatPt, &vUpVec);
pd3dDevice->SetTransform(D3DTS_VIEW, &matView);
D3DXMATRIXA16 matProj;
D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f );
pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
m_fRotate += m_fAddRot;
D3DXMatrixRotationX(&matRot, D3DXToRadian( m_fRotate ) );
D3DXMatrixScaling(&matScale, 1.5f, 1.5f, 1.5f);
LPWNDCTRL lpFace = GetWndCtrl( WIDC_CUSTOM2 );
viewport.X = p2DRender->m_ptOrigin.x + lpFace->rect.left;
viewport.Y = p2DRender->m_ptOrigin.y + lpFace->rect.top;
viewport.Width = lpFace->rect.Width();
viewport.Height = lpFace->rect.Height();
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
pd3dDevice->SetViewport(&viewport);
pd3dDevice->Clear(0, NULL, D3DCLEAR_ZBUFFER, 0xffa08080, 1.0f, 0 );
D3DXMatrixMultiply(&matWorld,&matWorld,&matScale);
D3DXMatrixMultiply(&matWorld, &matWorld, &matRot );
D3DXMatrixMultiply(&matWorld, &matWorld, &matTrans );
pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
pd3dDevice->SetRenderState( D3DRS_FOGENABLE, FALSE );
pd3dDevice->SetRenderState( D3DRS_LIGHTING, FALSE );
::SetLight( FALSE );
::SetFog( FALSE );
SetDiffuse( 1.0f, 1.0f, 1.0f );
SetAmbient( 1.0f, 1.0f, 1.0f );
D3DXVECTOR4 vConst( 1.0f, 1.0f, 1.0f, 1.0f );
pd3dDevice->SetVertexShaderConstantF( 95, (float*)&vConst, 1 );
::SetTransformView( matView );
::SetTransformProj( matProj );
m_pSkinItem->Render( p2DRender->m_pd3dDevice, &matWorld );
viewport.X = p2DRender->m_ptOrigin.x;
viewport.Y = p2DRender->m_ptOrigin.y;
viewport.Width = p2DRender->m_clipRect.Width();
viewport.Height = p2DRender->m_clipRect.Height();
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
pd3dDevice->SetViewport(&viewport);
pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );
pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
}
else
{
D3DVIEWPORT9 viewport;
LPWNDCTRL lpFace = GetWndCtrl( WIDC_CUSTOM2 );
viewport.X = p2DRender->m_ptOrigin.x + lpFace->rect.left;
viewport.Y = p2DRender->m_ptOrigin.y + lpFace->rect.top;
viewport.Width = lpFace->rect.Width();
viewport.Height = lpFace->rect.Height();
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
pd3dDevice->SetViewport(&viewport);
pd3dDevice->Clear(0, NULL, D3DCLEAR_ZBUFFER, 0xffa08080, 1.0f, 0 ) ;
POINT point = GetMousePoint();
point.x -= 280;
point.y -= 15;
CRect rectViewport( 0, 0, viewport.Width, viewport.Height );
D3DXMATRIX matProj;
D3DXMatrixIdentity( &matProj );
FLOAT fAspect = ( (FLOAT) viewport.Width ) / (FLOAT) viewport.Height ;
FLOAT fov = D3DX_PI / 4.0f;//796.0f;
FLOAT h = cos( fov / 2 ) / sin( fov / 2 );
FLOAT w = h * fAspect;
D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f );
pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
// Ä«¸Þ¶ó
D3DXMATRIX matView;
D3DXVECTOR3 vecLookAt( 0.0f, 0.0f, 3.0f );
D3DXVECTOR3 vecPos( 0.0f, 0.0f, -5.0f );
if(m_nStatus == 1)
{
vecPos.y += m_nEyeYPos;
}
D3DXMatrixLookAtLH( &matView, &vecPos, &vecLookAt, &D3DXVECTOR3(0.0f,1.0f,0.0f) );
pd3dDevice->SetTransform( D3DTS_VIEW, &matView );
D3DXMATRIXA16 matWorld;
D3DXMATRIXA16 matScale;
D3DXMATRIXA16 matRot;
D3DXMATRIXA16 matTrans;
D3DXMatrixIdentity(&matScale);
D3DXMatrixIdentity(&matRot);
D3DXMatrixIdentity(&matTrans);
D3DXMatrixIdentity(&matWorld);
m_fRotate += m_fAddRot;
D3DXMatrixRotationY(&matRot, D3DXToRadian( m_fRotate ) );
D3DXMatrixScaling(&matScale,1.5f,1.5f,1.5f);//1.4f,1.4f,1.4f
D3DXMatrixTranslation(&matTrans,0.0f,-1.1f,0.0f);
D3DXMatrixMultiply(&matWorld,&matWorld,&matScale);
D3DXMatrixMultiply(&matWorld, &matWorld,&matRot);
D3DXMatrixMultiply(&matWorld, &matWorld, &matTrans );
pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
// ·£´õ¸µ
pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_FOGENABLE, FALSE );
pd3dDevice->SetRenderState( D3DRS_LIGHTING, FALSE );//m_bViewLight );
::SetLight( FALSE );
::SetFog( FALSE );
SetDiffuse( 1.0f, 1.0f, 1.0f );
SetAmbient( 1.0f, 1.0f, 1.0f );
m_pSkinItem->FrameMove();
D3DXVECTOR4 vConst( 1.0f, 1.0f, 1.0f, 1.0f );
#ifdef __YENV
g_Neuz.m_pEffect->SetVector( g_Neuz.m_hvFog, &vConst );
#else //__YENV
pd3dDevice->SetVertexShaderConstantF( 95, (float*)&vConst, 1 );
#endif //__YENV
::SetTransformView( matView );
::SetTransformProj( matProj );
O3D_ELEMENT* pElem = m_pSkinItem->GetParts( PARTS_HAIR );
if( pElem && pElem->m_pObject3D )
{
if( m_Player.m_bySex == SEX_MALE )
{
pElem->m_pObject3D->m_fAmbient[0] = (nMaleHairColor[m_Player.m_byHairMesh][0])/255.f;
pElem->m_pObject3D->m_fAmbient[1] = (nMaleHairColor[m_Player.m_byHairMesh][1])/255.f;
pElem->m_pObject3D->m_fAmbient[2] = (nMaleHairColor[m_Player.m_byHairMesh][2])/255.f;
}
else
{
pElem->m_pObject3D->m_fAmbient[0] = (nFeMaleHairColor[m_Player.m_byHairMesh][0])/255.f;
pElem->m_pObject3D->m_fAmbient[1] = (nFeMaleHairColor[m_Player.m_byHairMesh][1])/255.f;
pElem->m_pObject3D->m_fAmbient[2] = (nFeMaleHairColor[m_Player.m_byHairMesh][2])/255.f;
}
}
m_pSkinItem->Render( p2DRender->m_pd3dDevice, &matWorld );
p2DRender->m_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
p2DRender->m_pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );
viewport.X = p2DRender->m_ptOrigin.x;// + 5;
viewport.Y = p2DRender->m_ptOrigin.y;// + 5;
viewport.Width = p2DRender->m_clipRect.Width();
viewport.Height = p2DRender->m_clipRect.Height();
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
pd3dDevice->SetViewport(&viewport);
}
}
if(m_pItemElem != NULL)
{
CTexture* pTexture;
ItemProp* pItemProp;
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_STATIC1 );//main
pItemProp = m_pItemElem->GetProp();
if(pItemProp != NULL)
{
pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ITEM, pItemProp->szIcon), 0xffff00ff );
if(pTexture != NULL)
pTexture->Render( p2DRender, CPoint( pWndCtrl->rect.left, pWndCtrl->rect.top ) );
}
}
if( m_pSkinElem != NULL )
{
CTexture* pTexture;
ItemProp* pItemProp;
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_STATIC2 );//skin
pItemProp = m_pSkinElem->GetProp();
if(pItemProp != NULL)
{
pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ITEM, pItemProp->szIcon), 0xffff00ff );
if(pTexture != NULL)
pTexture->Render( p2DRender, CPoint( pWndCtrl->rect.left, pWndCtrl->rect.top ) );
}
}
}
Appreciate your help on this
Similar Threads
model change problem
04/25/2016 - Flyff Private Server - 6 Replies
hallo zusammen
ich habe folgendes problem mit dem model change
ich kann die sachen zwar modeln und nach relogg sind die auch noch da aber nach einem serverr restart sind alle models futsch
errors bekomme ich keine woran kann das liegen ? Oo
[HELP] Model Change Ignore Parts Problem (Hair Mostly)
01/21/2016 - Flyff Private Server - 2 Replies
Hey,
As the title states i've got a small problem with the model change system, i got it working like 99% accept the problem shown below in the screen shot.
https://democracy-games.com/ShadowFlyff/images/Err or/mergeProblem.png
My code for change/updating the model is as follows
(placed in several places in the code to allow update on loading the initial character and when changing items)
ItemProp * prop = prj.GetItemProp(pEquipInfo.dwNewId);//prevent model neuz crashes
Model Change Problem
09/17/2014 - Flyff Private Server - 0 Replies
\FLYFF\Test Server\Source\_Interface\WndWorld.cpp(6319) : error C2196: case value '255' already used
DPClient.cpp
DPClient.cpp(19871) : error C2084: function 'void CDPClient::SendModelChange(DWORD,DWORD)' already has a body
d:\FLYFF\Test Server\Source\Neuz\DPClient.h(1279) : see previous definition of 'SendModelChange'
Thanks in Advance for Fast Response.
I already fix the error epvpers and when I start and log.in to the world my Neuz will crash/it will close..
Please help me...
[HELP] Model Change System Problem
09/01/2013 - Flyff Private Server - 0 Replies
This keeps happening and I have no idea why.
Screenshot by Lightshot
Screenshot by Lightshot
Min-Problem Model Change ^^
07/08/2013 - Flyff Private Server - 1 Replies
Hallo ePvper User,
habe da ein kleines Problem und zwar wird bei mir wenn ich das Model gechangt habe zwar das Neue Model angezeig und auch wenn ich schaue steht da Model-Type : Wooden Sword aber wenn ein Andere Account von mit das Eq anschaut steht bei ihm : Model-Type : Original und das Model ist auch normal.
2 Screens ^^ :
1. Das ist der Account wo ich das Model von Donate Sword zu Wooden Sword geändert habe.
http://i.epvpimg.com/OaAxh.jpg
Hier wird gezeigt das es das Normale...
All times are GMT +2. The time now is 01:57 .