Mercurial > mm7
comparison Render.cpp @ 2325:846e28e41fb4
for bloodsplat
author | Ritor1 |
---|---|
date | Fri, 28 Mar 2014 12:32:18 +0600 |
parents | a59892f99d31 |
children | 82851980e3d8 |
comparison
equal
deleted
inserted
replaced
2324:b2e3ac05f2b3 | 2325:846e28e41fb4 |
---|---|
7333 } | 7333 } |
7334 | 7334 |
7335 //----- (004A68EF) -------------------------------------------------------- | 7335 //----- (004A68EF) -------------------------------------------------------- |
7336 void Render::DrawMasked(signed int a2, signed int a3, Texture *pTexture, unsigned __int16 mask) | 7336 void Render::DrawMasked(signed int a2, signed int a3, Texture *pTexture, unsigned __int16 mask) |
7337 { | 7337 { |
7338 Texture *v4; // edi@2 | |
7339 unsigned int v5; // ebx@4 | 7338 unsigned int v5; // ebx@4 |
7340 //unsigned __int16 *v6; // eax@4 | |
7341 signed int v7; // edx@5 | |
7342 int v8; // edx@6 | |
7343 signed int v9; // edx@7 | |
7344 int v10; // edx@8 | 7339 int v10; // edx@8 |
7345 signed int v11; // edx@9 | 7340 signed int v11; // edx@9 |
7346 signed int v12; // esi@12 | 7341 signed int v12; // esi@12 |
7347 signed int v13; // esi@15 | 7342 signed int v13; // esi@15 |
7348 unsigned int v14; // edx@17 | |
7349 signed int v15; // esi@18 | 7343 signed int v15; // esi@18 |
7350 unsigned __int8 *v16; // ebx@22 | 7344 unsigned __int8 *v16; // ebx@22 |
7351 char v17; // zf@28 | 7345 char v17; // zf@28 |
7352 int v18; // [sp+10h] [bp-10h]@4 | 7346 int v18; // [sp+10h] [bp-10h]@4 |
7353 unsigned __int8 *v19; // [sp+18h] [bp-8h]@4 | 7347 unsigned __int8 *v19; // [sp+18h] [bp-8h]@4 |
7354 int v20; // [sp+1Ch] [bp-4h]@4 | 7348 int v20; // [sp+1Ch] [bp-4h]@4 |
7355 int v21; // [sp+28h] [bp+8h]@24 | 7349 int v21; // [sp+28h] [bp+8h]@24 |
7356 unsigned int v22; // [sp+2Ch] [bp+Ch]@22 | 7350 unsigned int v22; // [sp+2Ch] [bp+Ch]@22 |
7357 unsigned int pTexturea; // [sp+30h] [bp+10h]@11 | |
7358 | 7351 |
7359 if (!uNumSceneBegins || !pTexture) | 7352 if (!uNumSceneBegins || !pTexture) |
7360 return; | 7353 return; |
7361 | 7354 |
7362 v4 = pTexture; | 7355 if ( pTexture->pPalette16 ) |
7363 | 7356 { |
7364 if ( pTexture->pPalette16 ) | 7357 v5 = pTexture->uTextureHeight; |
7365 { | 7358 //v6 = &this->pTargetSurface[a2 + a3 * this->uTargetSurfacePitch]; |
7366 v5 = pTexture->uTextureHeight; | 7359 v19 = pTexture->pLevelOfDetail0_prolly_alpha_mask; |
7367 //v6 = &this->pTargetSurface[a2 + a3 * this->uTargetSurfacePitch]; | 7360 v20 = pTexture->uTextureWidth; |
7368 v19 = pTexture->pLevelOfDetail0_prolly_alpha_mask; | 7361 v18 = pTexture->uTextureWidth; |
7369 v20 = pTexture->uTextureWidth; | 7362 int clipped_out_x = a2; |
7370 v18 = pTexture->uTextureWidth; | 7363 int clipped_out_y = a3; |
7371 int clipped_out_x = a2; | 7364 if ( this->bClip ) |
7372 int clipped_out_y = a3; | 7365 { |
7373 if ( this->bClip ) | 7366 if ( a2 < this->uClipX ) |
7374 { | 7367 { |
7375 v7 = this->uClipX; | 7368 v19 += this->uClipX - a2; |
7376 if ( a2 < v7 ) | 7369 v20 += a2 - this->uClipX; |
7377 { | 7370 clipped_out_x = uClipX; |
7378 v8 = v7 - a2; | 7371 } |
7379 v19 += v8; | 7372 v5 = pTexture->uTextureHeight; |
7380 v20 += a2 - this->uClipX; | 7373 if ( a3 < this->uClipY ) |
7381 //v6 += v8; | 7374 { |
7382 clipped_out_x = uClipX; | 7375 v10 = this->uClipY - a3; |
7383 } | 7376 v19 += v18 * v10; |
7384 v9 = this->uClipY; | 7377 v5 = a3 - this->uClipY + pTexture->uTextureHeight; |
7385 v5 = pTexture->uTextureHeight; | 7378 clipped_out_y = uClipY; |
7386 if ( a3 < v9 ) | 7379 } |
7387 { | 7380 v11 = this->uClipX; |
7388 v10 = v9 - a3; | 7381 if ( this->uClipX < a2 ) |
7389 v19 += v18 * v10; | 7382 v11 = a2; |
7390 v5 = a3 - this->uClipY + pTexture->uTextureHeight; | 7383 if ( v11 + v20 > (signed int)this->uClipZ ) |
7391 v4 = pTexture; | 7384 { |
7392 //v6 += this->uTargetSurfacePitch * v10; | 7385 v12 = this->uClipX; |
7393 clipped_out_y = uClipY; | 7386 if ( v12 < a2 ) |
7394 } | 7387 v12 = a2; |
7395 v11 = this->uClipX; | 7388 v20 = this->uClipZ - v12; |
7396 if ( v11 < a2 ) | |
7397 v11 = a2; | |
7398 pTexturea = this->uClipZ; | |
7399 if ( v11 + v20 > (signed int)pTexturea ) | |
7400 { | |
7401 v12 = this->uClipX; | |
7402 if ( v12 < a2 ) | |
7403 v12 = a2; | |
7404 v20 = pTexturea - v12; | |
7405 } | 7389 } |
7406 v13 = this->uClipY; | 7390 v13 = this->uClipY; |
7407 if ( v13 < a3 ) | 7391 if ( this->uClipY < a3 ) |
7408 v13 = a3; | 7392 v13 = a3; |
7409 v14 = this->uClipW; | 7393 if ( (signed int)(v5 + v13) > (signed int)this->uClipW ) |
7410 if ( (signed int)(v5 + v13) > (signed int)v14 ) | |
7411 { | 7394 { |
7412 v15 = this->uClipY; | 7395 v15 = this->uClipY; |
7413 if ( v15 < a3 ) | 7396 if ( this->uClipY < a3 ) |
7414 v15 = a3; | 7397 v15 = a3; |
7415 v5 = v14 - v15; | 7398 v5 = this->uClipW - v15; |
7416 } | 7399 } |
7417 } | 7400 } |
7418 | 7401 |
7419 v16 = v19; | 7402 v16 = v19; |
7420 for (int y = 0; y < v5; ++y) | 7403 for (int y = 0; y < v5; ++y) |
7421 { | 7404 { |
7422 for (int x = 0; x < v20; ++x) | 7405 for (int x = 0; x < v20; ++x) |
7423 { | 7406 { |
7424 if ( *v16 ) | 7407 if ( *v16 ) |
7425 WritePixel16(clipped_out_x + x, clipped_out_y + y, v4->pPalette16[*v16] & mask); | 7408 WritePixel16(clipped_out_x + x, clipped_out_y + y, pTexture->pPalette16[*v16] & mask); |
7426 ++v16; | 7409 ++v16; |
7427 } | 7410 } |
7428 v16 += v18 - v20; | 7411 v16 += v18 - v20; |
7429 } | 7412 } |
7430 | 7413 |