comparison Render.cpp @ 595:55d6b756e03a

Cave textures
author Nomad
date Wed, 06 Mar 2013 16:51:23 +0200
parents 7e8f5124056c
children f2697c2b4109
comparison
equal deleted inserted replaced
594:badd65dff4e7 595:55d6b756e03a
7798 int v15; // edx@10 7798 int v15; // edx@10
7799 Texture *v16; // edx@10 7799 Texture *v16; // edx@10
7800 double v17; // st6@10 7800 double v17; // st6@10
7801 //char v18; // zf@10 7801 //char v18; // zf@10
7802 Texture *v19; // edx@10 7802 Texture *v19; // edx@10
7803 Texture *v23; // edx@16 7803 //Texture *v23; // edx@16
7804 char *v24; // ecx@16 7804 //char *v24; // ecx@16
7805 char *v25; // eax@16 7805 //char *v25; // eax@16
7806 double v26; // st6@17 7806 //double v26; // st6@17
7807 int v27; // esi@17 7807 //int v27; // esi@17
7808 double v28; // st6@17 7808 //double v28; // st6@17
7809 unsigned int v33; // ecx@18 7809 //unsigned int v33; // ecx@18
7810 char *v34; // eax@19 7810 //char *v34; // eax@19
7811 //Texture *v45; // edx@23 7811 //Texture *v45; // edx@23
7812 //char *v46; // ecx@23 7812 //char *v46; // ecx@23
7813 //char *v47; // eax@23 7813 //char *v47; // eax@23
7814 //double v48; // st6@24 7814 //double v48; // st6@24
7815 //int v49; // esi@24 7815 //int v49; // esi@24
7906 uNumVertices, 7906 uNumVertices,
7907 28)); 7907 28));
7908 } 7908 }
7909 else 7909 else
7910 { 7910 {
7911 __debugbreak(); 7911 for (uint i = 0; i < uNumVertices; ++i)
7912 if ( (signed int)uNumVertices > 0 ) 7912 {
7913 { 7913 d3d_vertex_buffer[i].pos.x = array_507D30[i].vWorldViewProjX;
7914 v23 = pTex; 7914 d3d_vertex_buffer[i].pos.y = array_507D30[i].vWorldViewProjY;
7915 v24 = (char *)&array_507D30[0].vWorldViewPosition; 7915 d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / (array_507D30[i].vWorldViewPosition.x * 0.061758894);
7916 v25 = (char *)&d3d_vertex_buffer[0].pos.y; 7916 d3d_vertex_buffer[i].rhw = 1.0 / array_507D30[i].vWorldViewPosition.x;
7917 pTex = (Texture *)uNumVertices; 7917 d3d_vertex_buffer[i].diffuse = uColor;
7918 uint v18; 7918 d3d_vertex_buffer[i].specular = 0;
7919 do 7919 d3d_vertex_buffer[i].texcoord.x = array_507D30[i].u / (double)pTex->uTextureWidth;
7920 { 7920 d3d_vertex_buffer[i].texcoord.y = array_507D30[i].v / (double)pTex->uTextureHeight;
7921 v26 = *(float *)v24 * 0.061758894; 7921 }
7922 v27 = *((int *)v24 + 3); 7922 //__debugbreak();
7923 *((int *)v25 + 4) = 0; 7923 //if ( (signed int)uNumVertices > 0 )
7924 *((int *)v25 - 1) = v27; 7924 //{
7925 *(int *)v25 = *((int *)v24 + 4); 7925 //v23 = pTex;
7926 *((int *)v25 + 3) = uColor; 7926 //v24 = (char *)&array_507D30[0].vWorldViewPosition;
7927 v25 += 32; 7927 //v25 = (char *)&d3d_vertex_buffer[0].pos.y;
7928 *((float *)v25 - 7) = 1.0 - 1.0 / v26; 7928 //pTex = (Texture *)uNumVertices;
7929 v28 = 1.0 / *(float *)v24; 7929 //uint v18;
7930 v24 += 48; 7930 //do
7931 v18 = pTex == (Texture *)1; 7931 //{
7932 pTex = (Texture *)((char *)pTex - 1); 7932 //v26 = *(float *)v24 * 0.061758894;
7933 *((float *)v25 - 6) = v28; 7933 //v27 = *((int *)v24 + 3);
7934 //*((int *)v25 + 4) = 0;
7935 //*((int *)v25 - 1) = v27;
7936 //*(int *)v25 = *((int *)v24 + 4);
7937 //*((int *)v25 + 3) = uColor;
7938 //v25 += 32;
7939 //*((float *)v25 - 7) = 1.0 - 1.0 / v26;
7940 //v28 = 1.0 / *(float *)v24;
7941 //v24 += 48;
7942 //v18 = pTex == (Texture *)1;
7943 //pTex = (Texture *)((char *)pTex - 1);
7944 //*((float *)v25 - 6) = v28;
7934 //a3 = (BLVFace *)v23->uTextureWidth; 7945 //a3 = (BLVFace *)v23->uTextureWidth;
7935 *((float *)v25 - 3) = *((float *)v24 - 6) / (double)(signed int)v23->uTextureWidth; 7946 //*((float *)v25 - 3) = *((float *)v24 - 6) / (double)(signed int)v23->uTextureWidth;
7936 //a3 = (BLVFace *)v23->uTextureHeight; 7947 //a3 = (BLVFace *)v23->uTextureHeight;
7937 *((float *)v25 - 2) = *((float *)v24 - 5) / (double)(signed int)v23->uTextureHeight; 7948 //*((float *)v25 - 2) = *((float *)v24 - 5) / (double)(signed int)v23->uTextureHeight;
7938 } 7949 //}
7939 while ( !v18 ); 7950 //while ( !v18 );
7940 } 7951 //}
7941 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, false)); 7952 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, false));
7942 ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP)); 7953 ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP));
7943 ErrD3D(pRenderD3D->pDevice->SetTexture(0, nullptr)); 7954 ErrD3D(pRenderD3D->pDevice->SetTexture(0, nullptr));
7944 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, 7955 ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN,
7945 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, 7956 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1,
7946 d3d_vertex_buffer, 7957 d3d_vertex_buffer,
7947 uNumVertices, 7958 uNumVertices,
7948 28)); 7959 28));
7949 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, 1)); 7960
7961 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE));
7950 pGame->pLightmapBuilder->_45D74F_MessWithLight(-1, 0); 7962 pGame->pLightmapBuilder->_45D74F_MessWithLight(-1, 0);
7951 v33 = uNumVertices; 7963
7964 for (uint i = 0; i < uNumVertices; ++i)
7965 d3d_vertex_buffer[i].diffuse = uCorrectedColor;
7966 /*v33 = uNumVertices;
7952 if ( (signed int)uNumVertices > 0 ) 7967 if ( (signed int)uNumVertices > 0 )
7953 { 7968 {
7954 v34 = (char *)&d3d_vertex_buffer[0].diffuse; 7969 v34 = (char *)&d3d_vertex_buffer[0].diffuse;
7955 do 7970 do
7956 { 7971 {
7957 *(int *)v34 = uCorrectedColor; 7972 *(int *)v34 = uCorrectedColor;
7958 v34 += 32; 7973 v34 += 32;
7959 --v33; 7974 --v33;
7960 } 7975 }
7961 while ( v33 ); 7976 while ( v33 );
7962 } 7977 }*/
7963 ErrD3D(pRenderD3D->pDevice->SetTexture(0, pHwTex)); 7978 ErrD3D(pRenderD3D->pDevice->SetTexture(0, pHwTex));
7964 ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP)); 7979 ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP));
7965 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, TRUE)); 7980 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, TRUE));
7966 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE)); 7981 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE));
7967 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ZERO)); 7982 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ZERO));