Mercurial > mm7
comparison Render.cpp @ 63:a96ebf3123d2
23.01.13 (Rotate)
author | Ritor1 |
---|---|
date | Wed, 23 Jan 2013 13:14:10 +0600 |
parents | 63cfe63ac4c5 |
children | f6e7d7110512 |
comparison
equal
deleted
inserted
replaced
51:63cfe63ac4c5 | 63:a96ebf3123d2 |
---|---|
1619 } | 1619 } |
1620 while ( v116 < v107 ); | 1620 while ( v116 < v107 ); |
1621 } | 1621 } |
1622 v103 = abs((int)pIndoorCamera->uMapGridCellZ - terrain_76D9C8[v70]); | 1622 v103 = abs((int)pIndoorCamera->uMapGridCellZ - terrain_76D9C8[v70]); |
1623 v104 = abs((int)pIndoorCamera->uMapGridCellX - terrain_76DBC8[v70]); | 1623 v104 = abs((int)pIndoorCamera->uMapGridCellX - terrain_76DBC8[v70]); |
1624 if ( pRenderer->pRenderD3D ) | 1624 //if ( pRenderer->pRenderD3D ) |
1625 Render::DrawTerrainD3D(v111, 0, (int)&v102); | 1625 //Render::DrawTerrainD3D(v111, 0, (int)&v102); |
1626 else | 1626 //else |
1627 Render::DrawTerrainSW(v111, 0, (int)&v102); | 1627 //Render::DrawTerrainSW(v111, 0, (int)&v102); |
1628 } | 1628 } |
1629 } | 1629 } |
1630 else | 1630 else |
1631 { | 1631 { |
1632 for ( i = v69; i >= 1; --i ) | 1632 for ( i = v69; i >= 1; --i ) |
1684 } | 1684 } |
1685 while ( v116 < v107 ); | 1685 while ( v116 < v107 ); |
1686 } | 1686 } |
1687 v103 = abs((int)pIndoorCamera->uMapGridCellX - terrain_76DBC8[v86]); | 1687 v103 = abs((int)pIndoorCamera->uMapGridCellX - terrain_76DBC8[v86]); |
1688 v104 = abs((int)pIndoorCamera->uMapGridCellZ - terrain_76D9C8[v86]); | 1688 v104 = abs((int)pIndoorCamera->uMapGridCellZ - terrain_76D9C8[v86]); |
1689 if ( pRenderer->pRenderD3D ) | 1689 //if ( pRenderer->pRenderD3D ) |
1690 Render::DrawTerrainD3D(v111, 1, (int)&v102); | 1690 //Render::DrawTerrainD3D(v111, 1, (int)&v102); |
1691 else | 1691 //else |
1692 Render::DrawTerrainSW(v111, 1, (int)&v102); | 1692 //Render::DrawTerrainSW(v111, 1, (int)&v102); |
1693 } | 1693 } |
1694 } | 1694 } |
1695 result = v126; | 1695 result = v126; |
1696 pOutdoorCamera->field_40 = v126; | 1696 pOutdoorCamera->field_40 = v126; |
1697 return result; | 1697 return result; |
2834 DWORD v11; // eax@13 | 2834 DWORD v11; // eax@13 |
2835 int v12; // eax@13 | 2835 int v12; // eax@13 |
2836 int v13; // eax@14 | 2836 int v13; // eax@14 |
2837 RenderBillboardTransform_local0 billboard; // [sp+4h] [bp-60h]@1 | 2837 RenderBillboardTransform_local0 billboard; // [sp+4h] [bp-60h]@1 |
2838 int v15; // [sp+54h] [bp-10h]@13 | 2838 int v15; // [sp+54h] [bp-10h]@13 |
2839 int v16; // [sp+58h] [bp-Ch]@1 | 2839 int i; // [sp+58h] [bp-Ch]@1 |
2840 int v17; // [sp+5Ch] [bp-8h]@2 | 2840 int v17; // [sp+5Ch] [bp-8h]@2 |
2841 int v18; // [sp+60h] [bp-4h]@13 | 2841 int v18; // [sp+60h] [bp-4h]@13 |
2842 | 2842 |
2843 billboard.uParentBillboardID = -1; | 2843 billboard.uParentBillboardID = -1; |
2844 billboard.pTarget = pRenderer->pTargetSurface; | 2844 billboard.pTarget = pRenderer->pTargetSurface; |
2848 billboard.uViewportY = pViewport->uViewportY; | 2848 billboard.uViewportY = pViewport->uViewportY; |
2849 billboard.uViewportZ = pViewport->uViewportZ - 1; | 2849 billboard.uViewportZ = pViewport->uViewportZ - 1; |
2850 billboard.uViewportW = pViewport->uViewportW; | 2850 billboard.uViewportW = pViewport->uViewportW; |
2851 v0 = 0; | 2851 v0 = 0; |
2852 pOutdoorCamera->uNumBillboards = uNumBillboardsToDraw; | 2852 pOutdoorCamera->uNumBillboards = uNumBillboardsToDraw; |
2853 v16 = 0; | 2853 //v16 = 0; |
2854 if ( (signed int)uNumBillboardsToDraw > 0 ) | 2854 for (i = 0; i < uNumBillboardsToDraw; ++i)//if ( (signed int)uNumBillboardsToDraw > 0 ) |
2855 { | 2855 { |
2856 v17 = 0; | 2856 v17 = 0; |
2857 struct RenderBillboard *pBillboard; | |
2858 pBillboard = &pBillboardRenderList[i]; | |
2857 v1 = (char *)&pBillboardRenderList[0].uScreenSpaceY; | 2859 v1 = (char *)&pBillboardRenderList[0].uScreenSpaceY; |
2858 do | 2860 //do |
2859 { | 2861 //{ |
2860 billboard.uScreenSpaceX = *((short *)v1 - 1); | 2862 billboard.uScreenSpaceX = pBillboard->uScreenSpaceX;; |
2861 v2 = *((short *)v1 - 5); | 2863 v2 = pBillboard->field_1E; |
2862 billboard.uScreenSpaceY = *(short *)v1; | 2864 billboard.uScreenSpaceY = pBillboard->uScreenSpaceY; |
2863 v3 = *((int *)v1 - 10); | 2865 //v3 = *((int *)v1 - 10); |
2864 billboard.uParentBillboardID = v0; | 2866 billboard.uParentBillboardID = i; |
2865 v4 = *((int *)v1 + 1); | 2867 //v4 = *((int *)v1 + 1); |
2866 billboard.field_10 = v3; | 2868 billboard.field_10 = pBillboard->field_0; |
2867 v5 = *((int *)v1 - 9); | 2869 //v5 = *((int *)v1 - 9); |
2868 billboard.uTintColor = v4; | 2870 billboard.uTintColor = pBillboard->uTintColor; |
2869 v6 = *((short *)v1 - 8); | 2871 //v6 = *((short *)v1 - 8); |
2870 billboard.field_14 = v5; | 2872 billboard.field_14 = pBillboard->field_4; |
2871 v7 = *((int *)v1 - 6); | 2873 //v7 = *((int *)v1 - 6); |
2872 billboard.sZValue = *((int *)v1 - 6); | 2874 billboard.sZValue = pBillboard->sZValue; |
2873 billboard.uFlags = v2; | 2875 billboard.uFlags = pBillboard->field_1E; |
2874 if ( v6 != -1 ) | 2876 if ( pBillboard->uHwSpriteID != -1 ) |
2875 { | 2877 { |
2876 v8 = *((short *)v1 + 1); | 2878 v8 = pBillboard->uPaletteSubindex;; |
2877 if ( pRenderer->pRenderD3D ) | 2879 //if ( pRenderer->pRenderD3D ) |
2878 { | 2880 //{ |
2879 billboard.sZValue = v7; | 2881 billboard.sZValue = pBillboard->sZValue; |
2880 billboard.uFlags = v2; | 2882 billboard.uFlags = pBillboard->field_1E; |
2881 pRenderer->TransformBillboard(&billboard, &pSprites_LOD->pHardwareSprites[v6], v8, (RenderBillboard *)(v1 - 40)); | 2883 pRenderer->TransformBillboard(&billboard, &pSprites_LOD->pHardwareSprites[pBillboard->uHwSpriteID], pBillboard->uPaletteSubindex, pBillboard); |
2882 } | 2884 //} |
2883 else | 2885 //else |
2884 { | 2886 //{ |
2885 if ( *(v1 - 10) & 2 ) | 2887 /*if ( *(v1 - 10) & 2 ) |
2886 v9 = PaletteManager::Get_Dark_or_Red_LUT(*((short *)v1 - 7), 0, 1); | 2888 v9 = PaletteManager::Get_Dark_or_Red_LUT(*((short *)v1 - 7), 0, 1); |
2887 else | 2889 else |
2888 v9 = GetBillboardPalette((RenderBillboard *)(v1 - 40), *((short *)v1 - 7), v7, *((short *)v1 + 1)); | 2890 v9 = GetBillboardPalette((RenderBillboard *)(v1 - 40), *((short *)v1 - 7), v7, *((short *)v1 + 1)); |
2889 v10 = (*(v1 - 9) & 1) == 0; | 2891 v10 = (*(v1 - 9) & 1) == 0; |
2890 billboard.pPalette = v9; | 2892 billboard.pPalette = v9; |
2898 v18 = (unsigned __int64)(15i64 * v15) >> 16; | 2900 v18 = (unsigned __int64)(15i64 * v15) >> 16; |
2899 billboard.pPalette2 = PaletteManager::Get_Dark_or_Red_LUT(*((short *)v1 - 7), 15 - v18, 1); | 2901 billboard.pPalette2 = PaletteManager::Get_Dark_or_Red_LUT(*((short *)v1 - 7), 15 - v18, 1); |
2900 } | 2902 } |
2901 v13 = *((short *)v1 - 8); | 2903 v13 = *((short *)v1 - 8); |
2902 if ( v13 >= 0 ) | 2904 if ( v13 >= 0 ) |
2903 pSprites_LOD->pSpriteHeaders[v13]._4ACC38(&billboard, 1); | 2905 pSprites_LOD->pSpriteHeaders[v13]._4ACC38(&billboard, 1);*/ |
2904 } | 2906 //} |
2905 } | 2907 } |
2906 v17 += 5; | 2908 v17 += 5; |
2907 v0 = v16 + 1; | 2909 //v0 = i + 1; |
2908 v1 += 52; | 2910 v1 += 52; |
2909 ++v16; | 2911 //++v16; |
2910 } | 2912 //} |
2911 while ( v16 < (signed int)uNumBillboardsToDraw ); | 2913 //while ( v16 < (signed int)uNumBillboardsToDraw ); |
2912 } | 2914 } |
2913 } | 2915 } |
2914 | 2916 |
2915 | 2917 |
2916 //----- (0047AF11) -------------------------------------------------------- | 2918 //----- (0047AF11) -------------------------------------------------------- |
7077 return; | 7079 return; |
7078 | 7080 |
7079 if (pRenderD3D) | 7081 if (pRenderD3D) |
7080 { | 7082 { |
7081 pGame->draw_debug_outlines(); | 7083 pGame->draw_debug_outlines(); |
7082 DoRenderBillboards_D3D(); //Ritor1: it's temporarily | 7084 //DoRenderBillboards_D3D(); //Ritor1: it's temporarily |
7083 pGame->pStru6Instance->RenderSpecialEffects(); | 7085 pGame->pStru6Instance->RenderSpecialEffects(); |
7084 pRenderD3D->pDevice->EndScene(); | 7086 pRenderD3D->pDevice->EndScene(); |
7085 } | 7087 } |
7086 else | 7088 else |
7087 pGame->pStru6Instance->RenderSpecialEffects(); | 7089 pGame->pStru6Instance->RenderSpecialEffects(); |