Mercurial > mm7
changeset 62:80484cf3a683
23.01.13 DrawParticles_ODM
author | Ritor1 |
---|---|
date | Wed, 23 Jan 2013 00:50:28 +0600 |
parents | 6c2cefdaea3e |
children | f6e7d7110512 |
files | LightmapBuilder.cpp Outdoor.cpp ParticleEngine.cpp Render.cpp Vis.cpp |
diffstat | 5 files changed, 98 insertions(+), 118 deletions(-) [+] |
line wrap: on
line diff
--- a/LightmapBuilder.cpp Tue Jan 22 18:41:17 2013 +0600 +++ b/LightmapBuilder.cpp Wed Jan 23 00:50:28 2013 +0600 @@ -964,7 +964,7 @@ RenderD3D *v13; // ecx@11 char v14; // dl@11 - __debugbreak(); + //__debugbreak(); v6 = pLight->uRadius; if ( v6 > 0
--- a/Outdoor.cpp Tue Jan 22 18:41:17 2013 +0600 +++ b/Outdoor.cpp Wed Jan 23 00:50:28 2013 +0600 @@ -138,7 +138,7 @@ if ( !pOutdoorCamera->bDoNotRenderDecorations ) pRenderer->DrawDecorations(); pRenderer->DrawLayingItems_Shooting_Magic_ODM(); - pRenderer->TransformBillboardsAndSetPalettesODM(); + pRenderer->TransformBillboardsAndSetPalettesODM();//Ritor1: do comment to test sub_485F53((Vec2_int_ *)unnamed_6BE060); }
--- a/ParticleEngine.cpp Tue Jan 22 18:41:17 2013 +0600 +++ b/ParticleEngine.cpp Wed Jan 23 00:50:28 2013 +0600 @@ -707,121 +707,115 @@ //----- (0048BEEF) -------------------------------------------------------- void ParticleEngine::DrawParticles_ODM() { - ParticleEngine *v1; // esi@1 - int v2; // eax@1 + ParticleEngine *pParticleEngine; // esi@1 + int pParticleNum; // eax@1 unsigned __int8 v3; // zf@1 char v4; // sf@1 unsigned __int8 v5; // of@1 char *v7; // edi@2 int v8; // eax@6 - signed int v9; // eax@8 + signed int pNumLines; // eax@8 int v10; // eax@14 int v11; // ecx@16 int v12; // edx@16 - Particle *v13; // eax@24 - RenderBillboardTransform_local0 v14; // [sp+Ch] [bp-58h]@1 + Particle *pParticle; // eax@24 + RenderBillboardTransform_local0 pBillboard; // [sp+Ch] [bp-58h]@1 int v15; // [sp+5Ch] [bp-8h]@9 int v16; // [sp+60h] [bp-4h]@1 - v14.uParentBillboardID = -1; - v1 = this; - v2 = this->uStartParticle; - v5 = v2 > this->uEndParticle;// v5 = __OFSUB__(v2, this->uEndParticle); - v3 = v2 == this->uEndParticle; - v4 = v2 - this->uEndParticle < 0; - v16 = this->uStartParticle; - if ( (unsigned __int8)(v4 ^ v5) | v3 ) + pBillboard.uParentBillboardID = -1; + pParticleEngine = this; + //v2 = this->uStartParticle; + //v5 = v2 > this->uEndParticle;// v5 = __OFSUB__(v2, this->uEndParticle); + //v3 = v2 == this->uEndParticle; + //v4 = v2 - this->uEndParticle < 0; + //v16 = this->uStartParticle; + for (pParticleNum = this->uStartParticle; pParticleNum <= this->uEndParticle; ++pParticleNum) { - v7 = (char *)&this->pParticles[v2].sZValue + 2; - do - { - if ( *(int *)(v7 - 82) && v1->_48B5B3(v2) ) + v7 = (char *)&this->pParticles[pParticleNum].sZValue + 2; + //do + //{ + if ( *(_DWORD *)(v7 - 82) && pParticleEngine->_48B5B3(pParticleNum) )//*(_DWORD *)(v7 - 82) = this->pParticles[pParticleNum] or this->pParticles[pParticleNum].uType { if ( pRenderer->pRenderD3D ) { - v8 = *(int *)(v7 - 82); + v8 = *(_DWORD *)(v7 - 82); if ( BYTE1(v8) & 1 ) { - v13 = &v1->pParticles[v16]; - v14.field_10 = v13->field_58 >> 2; - v14.field_14 = v13->field_58 >> 2; - v14.uScreenSpaceX = v13->uScreenSpaceX; - v14.uScreenSpaceY = v13->uScreenSpaceY; - v14.sZValue = v13->sZValue; - pRenderer->MakeParticleBillboardAndPush_ODM(&v14, 0, v13->uLightColor, v13->_rotation); + pParticle = &pParticleEngine->pParticles[pParticleNum]; + pBillboard.field_10 = pParticle->field_58 >> 2; + pBillboard.field_14 = pParticle->field_58 >> 2; + pBillboard.uScreenSpaceX = pParticle->uScreenSpaceX; + pBillboard.uScreenSpaceY = pParticle->uScreenSpaceY; + pBillboard.sZValue = pParticle->sZValue; + pRenderer->MakeParticleBillboardAndPush_ODM(&pBillboard, 0, pParticle->uLightColor, pParticle->_rotation); return; } if ( BYTE1(v8) & 2 ) { - v9 = v1->pLines.uNumLines; - if ( v9 < 100 ) + pNumLines = pParticleEngine->pLines.uNumLines; + if ( pNumLines < 100 ) { - v1->pLines.pLineVertices[2 * v9].pos.x = (double)*(signed int *)(v7 - 18); - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].pos.y = (double)*(signed int *)(v7 - 14); - v15 = *(short *)v7; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].pos.z = 1.0 - 1.0 / ((double)v15 * 1000.0 / (double)pOutdoorCamera->shading_dist_mist); - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].rhw = 1.0; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].diffuse = *(int *)(v7 + 18); - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].specular = 0; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].texcoord.x = 0.0; - *((float *)&v1->pParticles[0].uType + 16 * (v1->pLines.uNumLines + 813)) = 0.0; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].pos.x = (double)*(signed int *)(v7 - 10); - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].pos.y = (double)*(signed int *)(v7 - 6); - v15 = *(short *)v7; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].pos.z = 1.0 - 1.0 / ((double)v15 * 1000.0 / (double)pOutdoorCamera->shading_dist_mist); - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].rhw = 1.0; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].diffuse = *(int *)(v7 + 18); - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].specular = 0; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].texcoord.x = 0.0; - v1->pLines.pLineVertices[2 * v1->pLines.uNumLines++ + 1].texcoord.y = 0.0; + pParticleEngine->pLines.pLineVertices[2 * pNumLines].pos.x = (double)*(signed int *)(v7 - 18); + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines].pos.y = (double)*(signed int *)(v7 - 14); + v15 = *(_DWORD *)v7; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines].pos.z = 1.0 - 1.0 / ((double)v15 * 1000.0 / (double)pOutdoorCamera->shading_dist_mist); + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines].rhw = 1.0; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines].diffuse = *(_DWORD *)(v7 + 18); + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines].specular = 0; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines].texcoord.x = 0.0; + *((float *)&pParticleEngine->pParticles[0].uType + 16 * (pParticleEngine->pLines.uNumLines + 813)) = 0.0; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].pos.x = (double)*(signed int *)(v7 - 10); + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].pos.y = (double)*(signed int *)(v7 - 6); + v15 = *(_DWORD *)v7; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].pos.z = 1.0 - 1.0 / ((double)v15 * 1000.0 / (double)pOutdoorCamera->shading_dist_mist); + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].rhw = 1.0; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].diffuse = *(_DWORD *)(v7 + 18); + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].specular = 0; + pParticleEngine->pLines.pLineVertices[2 * pParticleEngine->pLines.uNumLines + 1].texcoord.x = 0.0; + __debugbreak();//v1->pLines.pLineVertices[2 * v1->pLines.uNumLines++ + 1].texcoord.y = 0.0; } } if ( *(v7 - 81) & 4 ) { - v14.field_10 = *(int *)(v7 + 6); - v14.field_14 = *(int *)(v7 + 6); - v14.uScreenSpaceX = *(int *)(v7 - 18); - v14.uScreenSpaceY = *(int *)(v7 - 14); - v14.sZValue = *(int *)(v7 - 2); - pRenderer->MakeParticleBillboardAndPush_ODM(&v14, pBitmaps_LOD->pHardwareTextures[*(int *)(v7 - 46)], *(int *)(v7 + 18), *(int *)(v7 - 22)); + pBillboard.field_10 = *(_DWORD *)(v7 + 6); + pBillboard.field_14 = *(_DWORD *)(v7 + 6); + pBillboard.uScreenSpaceX = *(_DWORD *)(v7 - 18); + pBillboard.uScreenSpaceY = *(_DWORD *)(v7 - 14); + pBillboard.sZValue = *(_DWORD *)(v7 - 2); + pRenderer->MakeParticleBillboardAndPush_ODM(&pBillboard, pBitmaps_LOD->pHardwareTextures[*(_DWORD *)(v7 - 46)], *(_DWORD *)(v7 + 18), *(_DWORD *)(v7 - 22)); } if ( *(v7 - 81) & 8 ) { - v14.field_10 = *(int *)(v7 + 6); - v14.field_14 = *(int *)(v7 + 6); - v14.uScreenSpaceX = *(int *)(v7 - 18); - v14.uScreenSpaceY = *(int *)(v7 - 14); - v14.sZValue = *(int *)(v7 - 2); - pRenderer->MakeParticleBillboardAndPush_ODM(&v14, pSprites_LOD->pHardwareSprites[*(int *)(v7 - 46)].pTexture, *(int *)(v7 + 18), - *(int *)(v7 - 22)); + pBillboard.field_10 = *(_DWORD *)(v7 + 6); + pBillboard.field_14 = *(_DWORD *)(v7 + 6); + pBillboard.uScreenSpaceX = *(_DWORD *)(v7 - 18); + pBillboard.uScreenSpaceY = *(_DWORD *)(v7 - 14); + pBillboard.sZValue = *(_DWORD *)(v7 - 2); + pRenderer->MakeParticleBillboardAndPush_ODM(&pBillboard, pSprites_LOD->pHardwareSprites[*(_DWORD *)(v7 - 46)].pTexture, *(_DWORD *)(v7 + 18), + *(_DWORD *)(v7 - 22)); } } else { - v10 = 13 * *(int *)(v7 + 6) >> 16; + v10 = 13 * *(_DWORD *)(v7 + 6) >> 16; if ( v10 > 30 ) v10 = 30; - v11 = *(int *)(v7 - 18) - (v10 >> 1); - v12 = *(int *)(v7 - 14) - v10; - if ( v11 + v10 < (signed int)pViewport->uViewportX - || v11 >= (signed int)pViewport->uViewportZ - || *(int *)(v7 - 14) < (signed int)pViewport->uViewportY + v11 = *(_DWORD *)(v7 - 18) - (v10 >> 1); + v12 = *(_DWORD *)(v7 - 14) - v10; + if ( v11 + v10 < pViewport->uViewportX + || v11 >= pViewport->uViewportZ + || *(_DWORD *)(v7 - 14) < pViewport->uViewportY || v12 >= (signed int)pViewport->uViewportW ) { ; } else { - pRenderer->MakeParticleBillboardAndPush_BLV_Software(v11, v12, *(int *)(v7 - 2), *(int *)(v7 + 18), v10); + pRenderer->MakeParticleBillboardAndPush_BLV_Software(v11, v12, *(_DWORD *)(v7 - 2), *(_DWORD *)(v7 + 18), v10); } } } - v7 += 104; - v2 = v16 + 1; - v5 = v16 + 1 > v1->uEndParticle;// v5 = __OFSUB__(v16 + 1, v1->uEndParticle); - v3 = v16 + 1 == v1->uEndParticle; - v4 = v16++ + 1 - v1->uEndParticle < 0; - } - while ( (unsigned __int8)(v4 ^ v5) | v3 ); + } } \ No newline at end of file
--- a/Render.cpp Tue Jan 22 18:41:17 2013 +0600 +++ b/Render.cpp Wed Jan 23 00:50:28 2013 +0600 @@ -1001,7 +1001,7 @@ char v102; // [sp+Ch] [bp-68h]@191 __int16 v103; // [sp+10h] [bp-64h]@190 __int16 v104; // [sp+12h] [bp-62h]@190 - int v105; // [sp+1Ch] [bp-58h]@1 + int pHeight; // [sp+1Ch] [bp-58h]@1 int v106; // [sp+20h] [bp-54h]@3 int v107; // [sp+24h] [bp-50h]@3 int v108; // [sp+28h] [bp-4Ch]@9 @@ -1025,7 +1025,7 @@ float v126; // [sp+70h] [bp-4h]@9 memset(&v102, 0, sizeof(v102)); - v105 = pIndoorCamera->sRotationY / ((signed int)stru_5C6E00->uIntegerHalfPi / 2); + pHeight = pIndoorCamera->sRotationY / ((signed int)stru_5C6E00->uIntegerHalfPi / 2); v0 = stru_5C6E00->uDoublePiMask & (stru_5C6E00->uIntegerDoublePi - pIndoorCamera->sRotationY); v1 = stru_5C6E00->uDoublePiMask & (stru_5C6E00->uIntegerPi + v0); LODWORD(v124) = (signed int)((pIndoorCamera->uMapGridCellX << 16) @@ -1149,7 +1149,7 @@ LODWORD(v126) = 0; v17 = v117 - 1; v18 = v116 - 1; - switch ( v105 ) + switch ( pHeight ) { case 0: case 7: @@ -1561,7 +1561,7 @@ ptr_801A08 = pVerticesSR_806210; ptr_801A04 = pVerticesSR_801A10; LODWORD(v126) = v69; - if ( v105 && v105 != 7 && v105 != 3 && v105 != 4 ) + if ( pHeight && pHeight != 7 && pHeight != 3 && pHeight != 4 ) { for ( i = v69; i >= 1; --i ) { @@ -1590,21 +1590,21 @@ v127 = 0; v79 = (v73 - 66) << 9; v116 = v77; - v105 = v79; + pHeight = v79; v111 = v75 - v77; do {// âûñîòà ÷åòûðåõ âåðøèí ÿ÷åéêè - *(float *)&v106 = (double)v105; + *(float *)&v106 = (double)pHeight; *(float *)((char *)&ptr_801A08->vWorldPosition.x + v127) = *(float *)&v106;//x - v105 = (64 - *(int *)((char *)terrain_76D9C8 + v70)) << 9; - *(float *)((char *)&ptr_801A08->vWorldPosition.y + v127) = (double)v105;//y - v105 = pOutdoor->GetHeightOnTerrain(v112, *(int *)((char *)terrain_76D9C8 + v70)); - *(float *)((char *)&ptr_801A08->vWorldPosition.z + v127) = (double)v105;//z + pHeight = (64 - *(int *)((char *)terrain_76D9C8 + v70)) << 9; + *(float *)((char *)&ptr_801A08->vWorldPosition.y + v127) = (double)pHeight;//y + pHeight = pOutdoor->GetHeightOnTerrain(v112, *(int *)((char *)terrain_76D9C8 + v70)); + *(float *)((char *)&ptr_801A08->vWorldPosition.z + v127) = (double)pHeight;//z *(float *)((char *)&ptr_801A04->vWorldPosition.x + v127) = *(float *)&v106;//x - v105 = (63 - *(int *)((char *)terrain_76D9C8 + v70)) << 9; - *(float *)((char *)&ptr_801A04->vWorldPosition.y + v127) = (double)v105;//y - v105 = pOutdoor->GetHeightOnTerrain(v112, *(int *)((char *)terrain_76D9C8 + v70) + 1); - *(float *)((char *)&ptr_801A04->vWorldPosition.z + v127) = (double)v105;//z + pHeight = (63 - *(int *)((char *)terrain_76D9C8 + v70)) << 9; + *(float *)((char *)&ptr_801A04->vWorldPosition.y + v127) = (double)pHeight;//y + pHeight = pOutdoor->GetHeightOnTerrain(v112, *(int *)((char *)terrain_76D9C8 + v70) + 1); + *(float *)((char *)&ptr_801A04->vWorldPosition.z + v127) = (double)pHeight;//z if ( !byte_4D864C || !(pGame->uFlags & 0x80) ) { a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A08 + v127, 1); @@ -1615,13 +1615,13 @@ v79 += 512; v127 += 48; ++v116; - v105 = v79; + pHeight = v79; } while ( v116 < v107 ); } v103 = abs((int)pIndoorCamera->uMapGridCellZ - terrain_76D9C8[v70]); v104 = abs((int)pIndoorCamera->uMapGridCellX - terrain_76DBC8[v70]); - if ( pRenderer->pRenderD3D ) + if ( pRenderer->pRenderD3D )//Ritor1: do comment to test Render::DrawTerrainD3D(v111, 0, (int)&v102); else Render::DrawTerrainSW(v111, 0, (int)&v102); @@ -1653,23 +1653,23 @@ v86 = 0; v116 = v89 - 2; v92 = (66 - v89) << 9; - v105 = (66 - v89) << 9; + pHeight = (66 - v89) << 9; v111 = v90 + 2 - (v89 - 2); do { v93 = v116; v106 = (*(int *)((char *)terrain_76DBC8 + v86) - 64) << 9; *(float *)((char *)&ptr_801A08->vWorldPosition.x + v86) = (double)v106; - *(float *)&v105 = (double)v105; - *(float *)((char *)&ptr_801A08->vWorldPosition.y + v86) = *(float *)&v105; + *(float *)&pHeight = (double)pHeight; + *(float *)((char *)&ptr_801A08->vWorldPosition.y + v86) = *(float *)&pHeight; v106 = pOutdoor->GetHeightOnTerrain(*(int *)((char *)terrain_76DBC8 + v86), v93); v97 = v116; *(float *)((char *)&ptr_801A08->vWorldPosition.z + v86) = (double)v106; v106 = (*(int *)((char *)terrain_76DBC8 + v86) - 63) << 9; *(float *)((char *)&ptr_801A04->vWorldPosition.x + v86) = (double)v106; - *(float *)((char *)&ptr_801A04->vWorldPosition.y + v86) = *(float *)&v105; - v105 = pOutdoor->GetHeightOnTerrain(*(int *)((char *)terrain_76DBC8 + v86) + 1, v97); - *(float *)((char *)&ptr_801A04->vWorldPosition.z + v86) = (double)v105; + *(float *)((char *)&ptr_801A04->vWorldPosition.y + v86) = *(float *)&pHeight; + pHeight = pOutdoor->GetHeightOnTerrain(*(int *)((char *)terrain_76DBC8 + v86) + 1, v97); + *(float *)((char *)&ptr_801A04->vWorldPosition.z + v86) = (double)pHeight; if ( !byte_4D864C || !(pGame->uFlags & 0x80) ) { a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A08 + v86, 1); @@ -1680,7 +1680,7 @@ v92 -= 512; v86 += 48; ++v116; - v105 = v92; + pHeight = v92; } while ( v116 < v107 ); } @@ -1851,11 +1851,11 @@ v13 = v8->vWorldPosition.y + 6.755399441055744e15, sY = LODWORD(v13), thisd = (v10->vWorldPosition.x + v8->vWorldPosition.x) * 0.5, - v14 = WorldPosToGridCellX(floorf(thisd + 0.5f)), + v14 = WorldPosToGridCellX(floorf(thisd + 0.5f)),//maybe current camera position X v15 = v9->vWorldPosition.y + v8->vWorldPosition.y, v89 = v14, thise = v15 * 0.5, - _this = (LightmapBuilder *)WorldPosToGridCellZ(floorf(thisd + 0.5f)), + _this = (LightmapBuilder *)WorldPosToGridCellZ(floorf(thisd + 0.5f)),//maybe current camera position Z WorldPosToGridCellX(sX), WorldPosToGridCellZ(sY), !byte_4D864C) @@ -2110,24 +2110,10 @@ a8 = (RenderVertexSoft *)(this_3a ? 3 : v108 != 0 ? 5 : 0); static_sub_0048034E_stru_76D590._49B0C9(v99, *(float *)&a4); if ( pDecalBuilder->uNumDecals > 0 ) - pDecalBuilder->ApplyDecals( - 31 - v40->field_58, - 4, - &static_sub_0048034E_stru_76D590, - uNumVertices, - array_50AC10, - 0, - (char)a8, - -1); + pDecalBuilder->ApplyDecals(31 - v40->field_58, 4, &static_sub_0048034E_stru_76D590, uNumVertices, array_50AC10, 0, (char)a8, -1); } if ( stru_F8AD28.uNumLightsApplied > 0 ) - v96->ApplyLights( - &stru_F8AD28, - &static_sub_0048034E_stru_76D590, - uNumVertices, - array_50AC10, - 0, - (char)a8); + v96->ApplyLights(&stru_F8AD28, &static_sub_0048034E_stru_76D590, uNumVertices, array_50AC10, 0, (char)a8); v55 = uNumVertices; v35 = byte_4D864C == 0; v40->uNumVertices = uNumVertices; @@ -4289,7 +4275,7 @@ { if ( !v54 || byte_4D864C && pGame->uFlags & 2 ) { - ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, 1u)); + ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, 1u));//Ðåæèìû âèçóàëèçàöèè òî÷å÷íûõ ñïðàéòîâ ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_CW)); if (bUsingSpecular) { @@ -7079,7 +7065,7 @@ if (pRenderD3D) { pGame->draw_debug_outlines(); - DoRenderBillboards_D3D(); //Ritor1: it's temporarily + //DoRenderBillboards_D3D(); //Ritor1: it's temporarily pGame->pStru6Instance->RenderSpecialEffects(); pRenderD3D->pDevice->EndScene(); }
--- a/Vis.cpp Tue Jan 22 18:41:17 2013 +0600 +++ b/Vis.cpp Wed Jan 23 00:50:28 2013 +0600 @@ -1605,7 +1605,7 @@ stru1.uNumPointers = 0; CastPickRay(pMouseRay, fMouseX, fMouseY, fDepth); - PickBillboards(fDepth, fMouseX, fMouseY, &stru1, a5); + PickBillboards(fDepth, fMouseX, fMouseY, &stru1, a5);//Ritor1: do comment to test if (uCurrentlyLoadedLevelType == LEVEL_Indoor) PickIndoor(fDepth, pMouseRay, &stru1, a6); else