Mercurial > mm7
comparison _deleted.cpp @ 2069:259df09dfb50
32bits almost there
author | Nomad |
---|---|
date | Tue, 03 Dec 2013 20:18:17 +0200 |
parents | b2a434d65344 |
children | 92511cd8fcdb |
comparison
equal
deleted
inserted
replaced
2061:b2a434d65344 | 2069:259df09dfb50 |
---|---|
13194 bool Render::UsingDirect3D() | 13194 bool Render::UsingDirect3D() |
13195 { | 13195 { |
13196 return bUserDirect3D == 0; | 13196 return bUserDirect3D == 0; |
13197 } | 13197 } |
13198 | 13198 |
13199 | |
13200 //----- (004A46E6) -------------------------------------------------------- | |
13201 int __fastcall sr_4A46E6_draw_particle_segment(unsigned int x, signed int y, signed int _z, int a4, unsigned int lightColor) | |
13202 { | |
13203 int v5; // eax@1 | |
13204 int z; // eax@1 | |
13205 unsigned int v7; // eax@9 | |
13206 unsigned int v8; // ecx@9 | |
13207 int v9; // eax@9 | |
13208 unsigned int v10; // eax@10 | |
13209 int *v11; // esi@10 | |
13210 int *v12; // edi@10 | |
13211 int v13; // ecx@10 | |
13212 int v14; // edx@10 | |
13213 unsigned int v15; // eax@22 | |
13214 int *v16; // esi@22 | |
13215 int *v17; // edi@22 | |
13216 int v18; // ecx@22 | |
13217 int v19; // edx@22 | |
13218 unsigned __int16 *pTarget; // [sp+Ch] [bp-8h]@9 | |
13219 int *pTargetZ; // [sp+10h] [bp-4h]@9 | |
13220 unsigned int v22; // [sp+1Ch] [bp+8h]@9 | |
13221 signed int v23; // [sp+20h] [bp+Ch]@1 | |
13222 | |
13223 v5 = a4; | |
13224 v23 = _z >> 16; | |
13225 z = x + v5; | |
13226 if ( z >= (signed int)pViewport->uViewportTL_X | |
13227 && (signed int)x <= (signed int)pViewport->uViewportBR_X | |
13228 && y >= (signed int)pViewport->uViewportTL_Y | |
13229 && y <= (signed int)pViewport->uViewportBR_Y ) | |
13230 { | |
13231 if ( (signed int)x < (signed int)pViewport->uViewportTL_X ) | |
13232 x = pViewport->uViewportTL_X; | |
13233 if ( z > (signed int)pViewport->uViewportBR_X ) | |
13234 z = pViewport->uViewportBR_X; | |
13235 pTarget = &pRenderer->pTargetSurface[x + y * pRenderer->uTargetSurfacePitch]; | |
13236 v22 = z - x; | |
13237 pTargetZ = &pRenderer->pActiveZBuffer[x + 640 * y]; | |
13238 v7 = lightColor >> 3; | |
13239 v8 = lightColor & 0xF0; | |
13240 v9 = v7 & 0x1E0000; | |
13241 if ( pRenderer->uTargetGBits == 5 ) | |
13242 { | |
13243 v10 = (v8 | (((unsigned __int16)(lightColor & 0xF000) | (unsigned int)v9) >> 3)) >> 4; | |
13244 v11 = (int *)pTarget; | |
13245 v12 = pTargetZ; | |
13246 v13 = v22; | |
13247 v14 = (v10 << 16) | v10; | |
13248 z = (unsigned __int8)pTarget & 2; | |
13249 if ( (unsigned __int8)pTarget & 2 ) | |
13250 { | |
13251 z = (unsigned int)*pTargetZ >> 16; | |
13252 if ( z > v23 ) | |
13253 { | |
13254 z = v14 + ((*pTarget & 0x7BDEu) >> 1); | |
13255 *pTarget = z; | |
13256 } | |
13257 v13 = v22 - 1; | |
13258 v11 = (int *)(pTarget + 1); | |
13259 v12 = pTargetZ + 1; | |
13260 } | |
13261 while ( v13 != 1 ) | |
13262 { | |
13263 if ( v13 < 1 ) | |
13264 return z; | |
13265 z = (unsigned int)*v12 >> 16; | |
13266 if ( z <= v23 ) | |
13267 { | |
13268 v13 -= 2; | |
13269 ++v11; | |
13270 v12 += 2; | |
13271 } | |
13272 else | |
13273 { | |
13274 v12 += 2; | |
13275 z = v14 + ((*v11 & 0x7BDE7BDEu) >> 1); | |
13276 v13 -= 2; | |
13277 *v11 = z; | |
13278 ++v11; | |
13279 } | |
13280 } | |
13281 z = (unsigned int)*v12 >> 16; | |
13282 if ( z > v23 ) | |
13283 { | |
13284 z = v14 + ((*(short *)v11 & 0x7BDEu) >> 1); | |
13285 *(short *)v11 = z; | |
13286 } | |
13287 } | |
13288 else | |
13289 { | |
13290 v15 = (v8 | (((unsigned __int16)(lightColor & 0xF800) | (unsigned int)v9) >> 2)) >> 4; | |
13291 v16 = (int *)pTarget; | |
13292 v17 = pTargetZ; | |
13293 v18 = v22; | |
13294 v19 = (v15 << 16) | v15; | |
13295 z = (unsigned __int8)pTarget & 2; | |
13296 if ( (unsigned __int8)pTarget & 2 ) | |
13297 { | |
13298 z = (unsigned int)*pTargetZ >> 16; | |
13299 if ( z > v23 ) | |
13300 { | |
13301 z = v19 + ((*pTarget & 0xF7DEu) >> 1); | |
13302 *pTarget = z; | |
13303 } | |
13304 v18 = v22 - 1; | |
13305 v16 = (int *)(pTarget + 1); | |
13306 v17 = pTargetZ + 1; | |
13307 } | |
13308 while ( v18 != 1 ) | |
13309 { | |
13310 if ( v18 < 1 ) | |
13311 return z; | |
13312 z = (unsigned int)*v17 >> 16; | |
13313 if ( z <= v23 ) | |
13314 { | |
13315 v18 -= 2; | |
13316 ++v16; | |
13317 v17 += 2; | |
13318 } | |
13319 else | |
13320 { | |
13321 v17 += 2; | |
13322 z = v19 + ((*v16 & 0xF7DEF7DEu) >> 1); | |
13323 v18 -= 2; | |
13324 *v16 = z; | |
13325 ++v16; | |
13326 } | |
13327 } | |
13328 z = (unsigned int)*v17 >> 16; | |
13329 if ( z > v23 ) | |
13330 { | |
13331 z = v19 + ((*(short *)v16 & 0xF7DEu) >> 1); | |
13332 *(short *)v16 = z; | |
13333 } | |
13334 } | |
13335 } | |
13336 return z; | |
13337 } | |
13338 | |
13339 | |
13340 //----- (004A57E9) -------------------------------------------------------- | |
13341 void Present_ColorKey() | |
13342 { | |
13343 HRESULT v0; // eax@3 | |
13344 HRESULT v1; // eax@3 | |
13345 HRESULT v2; // eax@3 | |
13346 HRESULT v3; // eax@3 | |
13347 HRESULT v4; // eax@3 | |
13348 RECT a2; // [sp+4h] [bp-14h]@3 | |
13349 //CheckHRESULT_stru0 this; // [sp+14h] [bp-4h]@3 | |
13350 | |
13351 if ( !pRenderer->uNumSceneBegins ) | |
13352 { | |
13353 if ( pRenderer->using_software_screen_buffer ) | |
13354 { | |
13355 a2.bottom = pViewport->uViewportTL_Y; | |
13356 a2.left = 0; | |
13357 a2.top = 0; | |
13358 a2.right = 640; | |
13359 ErrD3D(pRenderer->pBackBuffer4->BltFast(0, 0, pRenderer->pColorKeySurface4, &a2, 16u)); | |
13360 a2.right = 640; | |
13361 a2.left = 0; | |
13362 a2.top = pViewport->uViewportBR_Y + 1; | |
13363 a2.bottom = 480; | |
13364 ErrD3D(pRenderer->pBackBuffer4->BltFast( | |
13365 0, | |
13366 pViewport->uViewportBR_Y + 1, | |
13367 pRenderer->pColorKeySurface4, | |
13368 &a2, | |
13369 16u)); | |
13370 a2.right = pViewport->uViewportTL_X; | |
13371 a2.bottom = pViewport->uViewportBR_Y + 1; | |
13372 a2.left = 0; | |
13373 a2.top = pViewport->uViewportTL_Y; | |
13374 ErrD3D(pRenderer->pBackBuffer4->BltFast( | |
13375 0, | |
13376 pViewport->uViewportTL_Y, | |
13377 pRenderer->pColorKeySurface4, | |
13378 &a2, | |
13379 16u)); | |
13380 a2.left = pViewport->uViewportBR_X; | |
13381 a2.top = pViewport->uViewportTL_Y; | |
13382 a2.right = 640; | |
13383 a2.bottom = pViewport->uViewportBR_Y + 1; | |
13384 ErrD3D(pRenderer->pBackBuffer4->BltFast( | |
13385 pViewport->uViewportBR_X, | |
13386 pViewport->uViewportTL_Y, | |
13387 pRenderer->pColorKeySurface4, | |
13388 &a2, | |
13389 16u)); | |
13390 a2.right = pViewport->uViewportBR_X; | |
13391 a2.bottom = pViewport->uViewportBR_Y + 1; | |
13392 a2.left = pViewport->uViewportTL_X; | |
13393 a2.top = pViewport->uViewportTL_Y; | |
13394 ErrD3D(pRenderer->pBackBuffer4->BltFast( | |
13395 pViewport->uViewportTL_X, | |
13396 pViewport->uViewportTL_Y, | |
13397 pRenderer->pColorKeySurface4, | |
13398 &a2, | |
13399 17u)); | |
13400 } | |
13401 } | |
13402 } | |
13403 | |
13404 | |
13405 //----- (004A48E4) -------------------------------------------------------- | |
13406 int Render::MakeParticleBillboardAndPush_BLV_Software(int screenSpaceX, int screenSpaceY, int z, int lightColor, int a6) | |
13407 { | |
13408 int v6; // ecx@1 | |
13409 int v7; // ebx@1 | |
13410 int v8; // ecx@1 | |
13411 int v9; // edx@1 | |
13412 int v10; // edi@1 | |
13413 unsigned int x; // esi@1 | |
13414 int result; // eax@8 | |
13415 int v13; // [sp+Ch] [bp-10h]@1 | |
13416 int v14; // [sp+10h] [bp-Ch]@1 | |
13417 int v15; // [sp+14h] [bp-8h]@1 | |
13418 int v16; // [sp+18h] [bp-4h]@1 | |
13419 int v17; // [sp+24h] [bp+8h]@1 | |
13420 unsigned int v18; // [sp+28h] [bp+Ch]@1 | |
13421 int v19; // [sp+34h] [bp+18h]@1 | |
13422 | |
13423 v6 = screenSpaceX; | |
13424 v7 = (a6 >> 1) + screenSpaceY; | |
13425 v17 = 0; | |
13426 v15 = 0; | |
13427 v8 = (a6 >> 1) + v6; | |
13428 v14 = (a6 >> 1) * (a6 >> 1); | |
13429 v9 = 2 * (a6 >> 1); | |
13430 v10 = (a6 >> 1) * ((a6 >> 1) - 1); | |
13431 x = v8 - (a6 >> 1); | |
13432 v16 = (a6 >> 1) + screenSpaceY - v8; | |
13433 v19 = a6 >> 1; | |
13434 v13 = v9; | |
13435 v18 = v8; | |
13436 do | |
13437 { | |
13438 sr_4A46E6_draw_particle_segment(x, v16 + v18, z, 2 * v19, lightColor); | |
13439 if ( v15 ) | |
13440 sr_4A46E6_draw_particle_segment(x, v17 + v7, z, 2 * v19, lightColor); | |
13441 v14 -= v15; | |
13442 if ( v14 <= v10 ) | |
13443 { | |
13444 if ( v19 != v17 ) | |
13445 { | |
13446 sr_4A46E6_draw_particle_segment(v18, v16 + x, z, 2 * v17, lightColor); | |
13447 sr_4A46E6_draw_particle_segment(v18, v19 + v7, z, 2 * v17, lightColor); | |
13448 } | |
13449 --v19; | |
13450 v13 -= 2; | |
13451 ++x; | |
13452 v10 -= v13; | |
13453 } | |
13454 result = v17++; | |
13455 v15 += 2; | |
13456 --v18; | |
13457 } | |
13458 while ( result < v19 ); | |
13459 return result; | |
13460 } | |
13461 | |
13199 //----- (004637EB) -------------------------------------------------------- | 13462 //----- (004637EB) -------------------------------------------------------- |
13200 int __stdcall aWinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | 13463 int __stdcall aWinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
13201 { | 13464 { |
13202 //HANDLE v6; // eax@32 | 13465 //HANDLE v6; // eax@32 |
13203 //HDC v10; // edi@50 | 13466 //HDC v10; // edi@50 |
14043 v24 = pDecorationList->pDecorations[v26->uDecorationDescID].field_20; | 14306 v24 = pDecorationList->pDecorations[v26->uDecorationDescID].field_20; |
14044 GameUI_SetFooterString(v24); | 14307 GameUI_SetFooterString(v24); |
14045 return v19; | 14308 return v19; |
14046 } | 14309 } |
14047 | 14310 |
14311 | |
14312 //----- (0049EBF1) -------------------------------------------------------- | |
14313 void Render::_stub_49EBF1() | |
14314 { | |
14315 signed int uNumRedBits; // edx@1 | |
14316 signed int uNuGreenBits; // edi@1 | |
14317 signed int uNumBlueBits; // esi@1 | |
14318 unsigned int v4; // edx@4 | |
14319 unsigned int v5; // edi@4 | |
14320 int v6; // ebx@4 | |
14321 int v7; // edx@4 | |
14322 signed int v8; // [sp+8h] [bp-24h]@1 | |
14323 signed int v9; // [sp+Ch] [bp-20h]@1 | |
14324 signed int v10; // [sp+20h] [bp-Ch]@1 | |
14325 signed int i; // [sp+24h] [bp-8h]@2 | |
14326 signed int v12; // [sp+28h] [bp-4h]@3 | |
14327 | |
14328 v10 = 0; | |
14329 uNumRedBits = 1 << this->uTargetRBits; | |
14330 uNuGreenBits = 1 << this->uTargetGBits; | |
14331 uNumBlueBits = 1 << this->uTargetBBits; | |
14332 v9 = 1 << this->uTargetRBits; | |
14333 v8 = 1 << this->uTargetGBits; | |
14334 if ( uNumRedBits > 0 ) | |
14335 { | |
14336 do | |
14337 { | |
14338 for ( i = 0; i < uNuGreenBits; ++i ) | |
14339 { | |
14340 v12 = 0; | |
14341 if ( uNumBlueBits > 0 ) | |
14342 { | |
14343 do | |
14344 { | |
14345 v4 = this->uTargetBBits; | |
14346 v5 = v4 + this->uTargetGBits; | |
14347 v6 = (v12 >> 1) + (v10 >> 1 << v5) + (i >> 1 << this->uTargetBBits); | |
14348 v7 = (v10 << v5) + v12++ + (i << v4); | |
14349 this->unused_2C[v7] = v6; | |
14350 } | |
14351 while ( v12 < uNumBlueBits ); | |
14352 uNumRedBits = v9; | |
14353 uNuGreenBits = v8; | |
14354 } | |
14355 } | |
14356 ++v10; | |
14357 } | |
14358 while ( v10 < uNumRedBits ); | |
14359 } | |
14360 } | |
14361 | |
14362 | |
14363 //----- (004B0967) -------------------------------------------------------- | |
14364 void BspRenderer::DrawFaceOutlines() | |
14365 { | |
14366 signed int i; // edi@1 | |
14367 int v1; // esi@2 | |
14368 unsigned int v2; // ecx@4 | |
14369 int v3; // eax@4 | |
14370 int v4; // eax@6 | |
14371 unsigned __int16 *v5; // edx@6 | |
14372 int v6; // ecx@7 | |
14373 int v7; // esi@8 | |
14374 | |
14375 for ( i = 0; i < (signed int)pBspRenderer->num_faces; ++i ) | |
14376 { | |
14377 v1 = pBspRenderer->faces[i].uFaceID; | |
14378 if ( v1 >= 0 ) | |
14379 { | |
14380 if ( v1 < (signed int)pIndoor->uNumFaces ) | |
14381 { | |
14382 v2 = pBspRenderer->faces[i].uFaceID; | |
14383 pBLVRenderParams->field_7C = &pBspRenderer->nodes[pBspRenderer->faces[i].uNodeID].PortalScreenData; | |
14384 v3 = GetPortalScreenCoord(v2); | |
14385 if ( v3 ) | |
14386 { | |
14387 if ( PortalFrustrum(v3, &stru_F8A590, pBLVRenderParams->field_7C, v1) ) | |
14388 { | |
14389 v4 = stru_F8A590._viewport_space_y; | |
14390 v5 = pBLVRenderParams->pRenderTarget; | |
14391 if ( stru_F8A590._viewport_space_y <= stru_F8A590._viewport_space_w ) | |
14392 { | |
14393 v6 = 640 * stru_F8A590._viewport_space_y; | |
14394 do | |
14395 { | |
14396 v5[v6 + stru_F8A590.viewport_left_side[v4]] = -1; | |
14397 v7 = v6 + stru_F8A590.viewport_right_side[v4]; | |
14398 v6 += 640; | |
14399 v5[v7] = -1; | |
14400 ++v4; | |
14401 } | |
14402 while ( v4 <= stru_F8A590._viewport_space_w ); | |
14403 } | |
14404 } | |
14405 } | |
14406 } | |
14407 } | |
14408 } | |
14409 } | |
14410 | |
14048 */ | 14411 */ |