Mercurial > mm7
comparison Render.cpp @ 728:9f596a163257
Merge
author | Nomad |
---|---|
date | Fri, 22 Mar 2013 00:06:50 +0200 |
parents | da130dd3092a 9d13d2ec35a6 |
children | 700b58aac975 14cf77af15de |
comparison
equal
deleted
inserted
replaced
727:da130dd3092a | 728:9f596a163257 |
---|---|
7211 } | 7211 } |
7212 while ( v10 ); | 7212 while ( v10 ); |
7213 } | 7213 } |
7214 ++v7; | 7214 ++v7; |
7215 } | 7215 } |
7216 LABEL_23: | 7216 //LABEL_23: |
7217 uNumBillboardsToDraw++; | 7217 uNumBillboardsToDraw++; |
7218 return v7; | 7218 return v7; |
7219 } | 7219 } |
7220 if (z <= *(float *)v8 ) | 7220 if (z <= *(float *)v8 ) |
7221 { | 7221 { |
7229 v11 = (char *)v11 - 156; | 7229 v11 = (char *)v11 - 156; |
7230 --v12; | 7230 --v12; |
7231 } | 7231 } |
7232 while ( v12 ); | 7232 while ( v12 ); |
7233 } | 7233 } |
7234 goto LABEL_23; | 7234 //goto LABEL_23; |
7235 uNumBillboardsToDraw++; | |
7236 return v7; | |
7235 } | 7237 } |
7236 return v7; | 7238 return v7; |
7237 } | 7239 } |
7238 | 7240 |
7239 | 7241 |
8073 } | 8075 } |
8074 // 4D864C: using guessed type char byte_4D864C; | 8076 // 4D864C: using guessed type char byte_4D864C; |
8075 | 8077 |
8076 | 8078 |
8077 //----- (004A43B1) -------------------------------------------------------- | 8079 //----- (004A43B1) -------------------------------------------------------- |
8078 void Render::DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *a3, int dimming_level) | 8080 void Render::DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *pSprite, int dimming_level) |
8079 { | 8081 { |
8080 RenderBillboardTransform_local0 *v4; // ebx@2 | 8082 //RenderBillboardTransform_local0 *v4; // ebx@2 |
8081 double v5; // st7@2 | 8083 //double v5; // st7@2 |
8082 float v6; // ST08_4@2 | 8084 //float v6; // ST08_4@2 |
8083 unsigned int v7; // eax@2 | 8085 unsigned int v7; // eax@2 |
8084 int v8; // ecx@2 | 8086 //int v8; // ecx@2 |
8085 unsigned int v9; // esi@2 | 8087 //unsigned int v9; // esi@2 |
8086 Sprite *v10; // edi@5 | 8088 //Sprite *v10; // edi@5 |
8087 signed int v11; // eax@9 | 8089 signed int v11; // eax@9 |
8088 signed int v12; // eax@9 | 8090 signed int v12; // eax@9 |
8089 double v13; // st7@12 | 8091 //double v13; // st7@12 |
8090 double v14; // st6@12 | 8092 //double v14; // st6@12 |
8091 double v15; // st5@12 | 8093 double v15; // st5@12 |
8092 double v16; // st4@12 | 8094 double v16; // st4@12 |
8093 double v17; // st3@12 | 8095 double v17; // st3@12 |
8094 double v18; // st2@12 | 8096 double v18; // st2@12 |
8095 int v19; // ecx@14 | 8097 int v19; // ecx@14 |
8096 double v20; // st3@14 | 8098 double v20; // st3@14 |
8097 int v21; // ecx@16 | 8099 int v21; // ecx@16 |
8098 double v22; // st3@16 | 8100 double v22; // st3@16 |
8099 IDirect3DTexture2 *v23; // eax@18 | 8101 //IDirect3DTexture2 *v23; // eax@18 |
8100 signed int v24; // [sp+18h] [bp-18h]@5 | 8102 //signed int v24; // [sp+18h] [bp-18h]@5 |
8101 signed int v25; // [sp+1Ch] [bp-14h]@5 | 8103 //signed int v25; // [sp+1Ch] [bp-14h]@5 |
8102 Render *v26; // [sp+20h] [bp-10h]@1 | 8104 //Render *v26; // [sp+20h] [bp-10h]@1 |
8103 float v27; // [sp+24h] [bp-Ch]@5 | 8105 float v27; // [sp+24h] [bp-Ch]@5 |
8104 int v28; // [sp+28h] [bp-8h]@2 | 8106 int v28; // [sp+28h] [bp-8h]@2 |
8105 float v29; // [sp+2Ch] [bp-4h]@5 | 8107 float v29; // [sp+2Ch] [bp-4h]@5 |
8106 float pSoftBillboarda; // [sp+38h] [bp+8h]@2 | 8108 //float pSoftBillboarda; // [sp+38h] [bp+8h]@2 |
8107 float v31; // [sp+3Ch] [bp+Ch]@5 | 8109 float v31; // [sp+3Ch] [bp+Ch]@5 |
8108 float v32; // [sp+3Ch] [bp+Ch]@12 | 8110 //float v32; // [sp+3Ch] [bp+Ch]@12 |
8109 float a1; // [sp+40h] [bp+10h]@5 | 8111 float a1; // [sp+40h] [bp+10h]@5 |
8110 | 8112 |
8111 v26 = this; | 8113 //v26 = this; |
8112 if ( this->uNumD3DSceneBegins ) | 8114 if ( this->uNumD3DSceneBegins ) |
8113 { | 8115 { |
8114 v4 = pSoftBillboard; | 8116 //v4 = pSoftBillboard; |
8115 v5 = (double)pSoftBillboard->zbuffer_depth; | 8117 //v5 = (double)pSoftBillboard->zbuffer_depth; |
8116 pSoftBillboarda = v5; | 8118 //pSoftBillboarda = pSoftBillboard->zbuffer_depth; |
8117 v6 = v5; | 8119 //v6 = pSoftBillboard->zbuffer_depth; |
8118 v7 = Billboard_ProbablyAddToListAndSortByZOrder(LODWORD(v6)); | 8120 v7 = Billboard_ProbablyAddToListAndSortByZOrder(pSoftBillboard->zbuffer_depth); |
8119 v8 = dimming_level; | 8121 //v8 = dimming_level; |
8120 v9 = v7; | 8122 //v9 = v7; |
8121 v28 = dimming_level & 0xFF000000; | 8123 v28 = dimming_level & 0xFF000000; |
8122 if ( dimming_level & 0xFF000000 ) | 8124 if ( dimming_level & 0xFF000000 ) |
8123 pBillboardRenderListD3D[v9].uOpacity = RenderBillboardD3D::Opaque_3; | 8125 pBillboardRenderListD3D[v7].uOpacity = RenderBillboardD3D::Opaque_3; |
8124 else | 8126 else |
8125 pBillboardRenderListD3D[v9].uOpacity = RenderBillboardD3D::Transparent; | 8127 pBillboardRenderListD3D[v7].uOpacity = RenderBillboardD3D::Transparent; |
8126 v10 = a3; | 8128 //v10 = a3; |
8127 pBillboardRenderListD3D[v9].field_90 = v4->field_44; | 8129 pBillboardRenderListD3D[v7].field_90 = pSoftBillboard->field_44; |
8128 pBillboardRenderListD3D[v9].sZValue = v4->sZValue; | 8130 pBillboardRenderListD3D[v7].sZValue = pSoftBillboard->sZValue; |
8129 pBillboardRenderListD3D[v9].uParentBillboardID = v4->uParentBillboardID; | 8131 pBillboardRenderListD3D[v7].uParentBillboardID = pSoftBillboard->uParentBillboardID; |
8130 v25 = v4->uScreenSpaceX; | 8132 //v25 = pSoftBillboard->uScreenSpaceX; |
8131 v24 = v4->uScreenSpaceY; | 8133 //v24 = pSoftBillboard->uScreenSpaceY; |
8132 a1 = (v4->_screenspace_x_scaler_packedfloat & 0xFFFF) * 0.000015260186 + HIWORD(v4->_screenspace_x_scaler_packedfloat); | 8134 a1 = (pSoftBillboard->_screenspace_x_scaler_packedfloat & 0xFFFF) * 0.000015260186 + HIWORD(pSoftBillboard->_screenspace_x_scaler_packedfloat); |
8133 v29 = (v4->_screenspace_y_scaler_packedfloat & 0xFFFF) * 0.000015260186 + HIWORD(v4->_screenspace_y_scaler_packedfloat); | 8135 v29 = (pSoftBillboard->_screenspace_y_scaler_packedfloat & 0xFFFF) * 0.000015260186 + HIWORD(pSoftBillboard->_screenspace_y_scaler_packedfloat); |
8134 v31 = (double)((v10->uBufferWidth >> 1) - v10->uAreaX); | 8136 v31 = (double)((pSprite->uBufferWidth >> 1) - pSprite->uAreaX); |
8135 v27 = (double)(v10->uBufferHeight - v10->uAreaY); | 8137 v27 = (double)(pSprite->uBufferHeight - pSprite->uAreaY); |
8136 if ( v4->uFlags & 4 ) | 8138 if ( pSoftBillboard->uFlags & 4 ) |
8137 v31 = v31 * -1.0; | 8139 v31 = v31 * -1.0; |
8138 if ( v4->uTintColor && v26->bTinting ) | 8140 if ( pSoftBillboard->uTintColor && this->bTinting ) |
8139 { | 8141 { |
8140 v11 = ::GetActorTintColor(dimming_level, 0, pSoftBillboarda, 0, 0); | 8142 v11 = ::GetActorTintColor(dimming_level, 0, pSoftBillboard->zbuffer_depth, 0, 0); |
8141 v12 = sub_4A19D8(v4->uTintColor, v11); | 8143 v12 = sub_4A19D8(pSoftBillboard->uTintColor, v11); |
8142 if ( v28 ) | 8144 if ( v28 ) |
8143 v12 = (unsigned int)((char *)&array_77EC08[1852].pEdgeList1[17] + 3) & ((unsigned int)v12 >> 1); | 8145 v12 = (unsigned int)((char *)&array_77EC08[1852].pEdgeList1[17] + 3) & ((unsigned int)v12 >> 1); |
8144 } | 8146 } |
8145 else | 8147 else |
8146 { | 8148 { |
8147 v12 = ::GetActorTintColor(dimming_level, 0, pSoftBillboarda, 0, 0); | 8149 v12 = ::GetActorTintColor(dimming_level, 0, pSoftBillboard->zbuffer_depth, 0, 0); |
8148 } | 8150 } |
8149 v13 = (double)v25; | 8151 //v13 = (double)v25; |
8150 pBillboardRenderListD3D[v9].pQuards[0].specular = 0; | 8152 pBillboardRenderListD3D[v7].pQuards[0].specular = 0; |
8151 pBillboardRenderListD3D[v9].pQuards[0].diffuse = v12; | 8153 pBillboardRenderListD3D[v7].pQuards[0].diffuse = v12; |
8152 pBillboardRenderListD3D[v9].pQuards[0].pos.x = v13 - v31 * a1; | 8154 pBillboardRenderListD3D[v7].pQuards[0].pos.x = pSoftBillboard->uScreenSpaceX - v31 * a1; |
8153 v14 = (double)v24; | 8155 //v14 = (double)v24; |
8154 v32 = v14; | 8156 //v32 = v14; |
8155 pBillboardRenderListD3D[v9].pQuards[0].pos.y = v14 - v27 * v29; | 8157 pBillboardRenderListD3D[v7].pQuards[0].pos.y = pSoftBillboard->uScreenSpaceY - v27 * v29; |
8156 v15 = 1.0 - 1.0 / (pSoftBillboarda * 0.061758894); | 8158 v15 = 1.0 - 1.0 / (pSoftBillboard->zbuffer_depth * 0.061758894); |
8157 pBillboardRenderListD3D[v9].pQuards[0].pos.z = v15; | 8159 pBillboardRenderListD3D[v7].pQuards[0].pos.z = v15; |
8158 v16 = 1.0 / pSoftBillboarda; | 8160 v16 = 1.0 / pSoftBillboard->zbuffer_depth; |
8159 pBillboardRenderListD3D[v9].pQuards[0].rhw = 1.0 / pSoftBillboarda; | 8161 pBillboardRenderListD3D[v7].pQuards[0].rhw = 1.0 / pSoftBillboard->zbuffer_depth; |
8160 pBillboardRenderListD3D[v9].pQuards[0].texcoord.x = 0.0; | 8162 pBillboardRenderListD3D[v7].pQuards[0].texcoord.x = 0.0; |
8161 pBillboardRenderListD3D[v9].pQuards[0].texcoord.y = 0.0; | 8163 pBillboardRenderListD3D[v7].pQuards[0].texcoord.y = 0.0; |
8162 v17 = (double)((v10->uBufferWidth >> 1) - v10->uAreaX); | 8164 v17 = (double)((pSprite->uBufferWidth >> 1) - pSprite->uAreaX); |
8163 v18 = (double)(v10->uBufferHeight - v10->uAreaY - v10->uAreaHeight); | 8165 v18 = (double)(pSprite->uBufferHeight - pSprite->uAreaY - pSprite->uAreaHeight); |
8164 if ( v4->uFlags & 4 ) | 8166 if ( pSoftBillboard->uFlags & 4 ) |
8165 v17 = v17 * -1.0; | 8167 v17 = v17 * -1.0; |
8166 pBillboardRenderListD3D[v9].pQuards[1].specular = 0; | 8168 pBillboardRenderListD3D[v7].pQuards[1].specular = 0; |
8167 pBillboardRenderListD3D[v9].pQuards[1].diffuse = v12; | 8169 pBillboardRenderListD3D[v7].pQuards[1].diffuse = v12; |
8168 pBillboardRenderListD3D[v9].pQuards[1].pos.x = v13 - v17 * a1; | 8170 pBillboardRenderListD3D[v7].pQuards[1].pos.x = pSoftBillboard->uScreenSpaceX - v17 * a1; |
8169 pBillboardRenderListD3D[v9].pQuards[1].pos.y = v32 - v18 * v29; | 8171 pBillboardRenderListD3D[v7].pQuards[1].pos.y = pSoftBillboard->uScreenSpaceY - v18 * v29; |
8170 pBillboardRenderListD3D[v9].pQuards[1].pos.z = v15; | 8172 pBillboardRenderListD3D[v7].pQuards[1].pos.z = v15; |
8171 pBillboardRenderListD3D[v9].pQuards[1].rhw = v16; | 8173 pBillboardRenderListD3D[v7].pQuards[1].rhw = v16; |
8172 pBillboardRenderListD3D[v9].pQuards[1].texcoord.x = 0.0; | 8174 pBillboardRenderListD3D[v7].pQuards[1].texcoord.x = 0.0; |
8173 pBillboardRenderListD3D[v9].pQuards[1].texcoord.y = 1.0; | 8175 pBillboardRenderListD3D[v7].pQuards[1].texcoord.y = 1.0; |
8174 v19 = v10->uBufferHeight - v10->uAreaY - v10->uAreaHeight; | 8176 v19 = pSprite->uBufferHeight - pSprite->uAreaY - pSprite->uAreaHeight; |
8175 v20 = (double)(v10->uAreaX + v10->uAreaWidth + (v10->uBufferWidth >> 1) - v10->uBufferWidth); | 8177 v20 = (double)(pSprite->uAreaX + pSprite->uAreaWidth + (pSprite->uBufferWidth >> 1) - pSprite->uBufferWidth); |
8176 if ( v4->uFlags & 4 ) | 8178 if ( pSoftBillboard->uFlags & 4 ) |
8177 v20 = v20 * -1.0; | 8179 v20 = v20 * -1.0; |
8178 pBillboardRenderListD3D[v9].pQuards[2].specular = 0; | 8180 pBillboardRenderListD3D[v7].pQuards[2].specular = 0; |
8179 pBillboardRenderListD3D[v9].pQuards[2].diffuse = v12; | 8181 pBillboardRenderListD3D[v7].pQuards[2].diffuse = v12; |
8180 pBillboardRenderListD3D[v9].pQuards[2].pos.x = v20 * a1 + v13; | 8182 pBillboardRenderListD3D[v7].pQuards[2].pos.x = v20 * a1 + pSoftBillboard->uScreenSpaceX; |
8181 pBillboardRenderListD3D[v9].pQuards[2].pos.y = v32 - (double)v19 * v29; | 8183 pBillboardRenderListD3D[v7].pQuards[2].pos.y = pSoftBillboard->uScreenSpaceY - (double)v19 * v29; |
8182 pBillboardRenderListD3D[v9].pQuards[2].pos.z = v15; | 8184 pBillboardRenderListD3D[v7].pQuards[2].pos.z = v15; |
8183 pBillboardRenderListD3D[v9].pQuards[2].rhw = v16; | 8185 pBillboardRenderListD3D[v7].pQuards[2].rhw = v16; |
8184 pBillboardRenderListD3D[v9].pQuards[2].texcoord.x = 1.0; | 8186 pBillboardRenderListD3D[v7].pQuards[2].texcoord.x = 1.0; |
8185 pBillboardRenderListD3D[v9].pQuards[2].texcoord.y = 1.0; | 8187 pBillboardRenderListD3D[v7].pQuards[2].texcoord.y = 1.0; |
8186 v21 = v10->uBufferHeight - v10->uAreaY; | 8188 v21 = pSprite->uBufferHeight - pSprite->uAreaY; |
8187 v22 = (double)(v10->uAreaX + v10->uAreaWidth + (v10->uBufferWidth >> 1) - v10->uBufferWidth); | 8189 v22 = (double)(pSprite->uAreaX + pSprite->uAreaWidth + (pSprite->uBufferWidth >> 1) - pSprite->uBufferWidth); |
8188 if ( v4->uFlags & 4 ) | 8190 if ( pSoftBillboard->uFlags & 4 ) |
8189 v22 = v22 * -1.0; | 8191 v22 = v22 * -1.0; |
8190 pBillboardRenderListD3D[v9].pQuards[3].specular = 0; | 8192 pBillboardRenderListD3D[v7].pQuards[3].specular = 0; |
8191 pBillboardRenderListD3D[v9].pQuards[3].diffuse = v12; | 8193 pBillboardRenderListD3D[v7].pQuards[3].diffuse = v12; |
8192 pBillboardRenderListD3D[v9].pQuards[3].pos.x = v22 * a1 + v13; | 8194 pBillboardRenderListD3D[v7].pQuards[3].pos.x = v22 * a1 + pSoftBillboard->uScreenSpaceX; |
8193 pBillboardRenderListD3D[v9].pQuards[3].pos.y = v32 - (double)v21 * v29; | 8195 pBillboardRenderListD3D[v7].pQuards[3].pos.y = pSoftBillboard->uScreenSpaceY - (double)v21 * v29; |
8194 pBillboardRenderListD3D[v9].pQuards[3].pos.z = v15; | 8196 pBillboardRenderListD3D[v7].pQuards[3].pos.z = v15; |
8195 pBillboardRenderListD3D[v9].pQuards[3].rhw = v16; | 8197 pBillboardRenderListD3D[v7].pQuards[3].rhw = v16; |
8196 pBillboardRenderListD3D[v9].pQuards[3].texcoord.x = 1.0; | 8198 pBillboardRenderListD3D[v7].pQuards[3].texcoord.x = 1.0; |
8197 pBillboardRenderListD3D[v9].pQuards[3].texcoord.y = 0.0; | 8199 pBillboardRenderListD3D[v7].pQuards[3].texcoord.y = 0.0; |
8198 v23 = v10->pTexture; | 8200 //v23 = pSprite->pTexture; |
8199 pBillboardRenderListD3D[v9].uNumVertices = 4; | 8201 pBillboardRenderListD3D[v7].uNumVertices = 4; |
8200 pBillboardRenderListD3D[v9].z_order = pSoftBillboarda; | 8202 pBillboardRenderListD3D[v7].z_order = pSoftBillboard->zbuffer_depth; |
8201 pBillboardRenderListD3D[v9].pTexture = v23; | 8203 pBillboardRenderListD3D[v7].pTexture = pSprite->pTexture; |
8202 } | 8204 } |
8203 } | 8205 } |
8204 | 8206 |
8205 | 8207 |
8206 | 8208 |