Mercurial > might-and-magic-trilogy
comparison PaletteManager.cpp @ 90:8c6308bb19b3
2.11.12
author | Ritor1 |
---|---|
date | Fri, 02 Nov 2012 00:41:52 +0600 |
parents | 8b8875f5b359 |
children | 51a5b0dc3f30 |
comparison
equal
deleted
inserted
replaced
89:ecbd9b6ccf52 | 90:8c6308bb19b3 |
---|---|
327 signed int v80; // [sp+C5Ch] [bp+8h]@43 | 327 signed int v80; // [sp+C5Ch] [bp+8h]@43 |
328 int v81; // [sp+C5Ch] [bp+8h]@57 | 328 int v81; // [sp+C5Ch] [bp+8h]@57 |
329 | 329 |
330 v2 = this; | 330 v2 = this; |
331 v3 = (char *)this + 768 * a2; | 331 v3 = (char *)this + 768 * a2; |
332 if ( this->field_267AD3 || this->field_267AD4 || this->field_267AD5 ) | 332 if ( this->pPalette_tintColor[0] || this->pPalette_tintColor[1] || this->pPalette_tintColor[2] ) |
333 { | 333 { |
334 v8 = 0; | 334 v8 = 0; |
335 i = 0; | 335 i = 0; |
336 do | 336 do |
337 { | 337 { |
338 v9 = (float *)((char *)v63 + v8); | 338 v9 = (float *)((char *)v63 + v8); |
339 v10 = (float *)((char *)a6 + v8); | 339 v10 = (float *)((char *)a6 + v8); |
340 v11 = (float *)((char *)v64 + v8); | 340 v11 = (float *)((char *)v64 + v8); |
341 v12 = v2->field_267AD4; | 341 v12 = v2->pPalette_tintColor[1]; |
342 LODWORD(v75) = v2->field_267AD5 + (unsigned __int8)v3[2]; | 342 LODWORD(v75) = v2->pPalette_tintColor[2] + (unsigned __int8)v3[2]; |
343 v13 = v12 + (unsigned __int8)v3[1]; | 343 v13 = v12 + (unsigned __int8)v3[1]; |
344 LODWORD(v14) = (unsigned __int8)*v3; | 344 LODWORD(v14) = (unsigned __int8)*v3; |
345 v15 = (double)SLODWORD(v75) * 0.00196078431372549; | 345 v15 = (double)SLODWORD(v75) * 0.00196078431372549; |
346 LODWORD(v75) = v13; | 346 LODWORD(v75) = v13; |
347 LODWORD(v75) = LODWORD(v14) + v2->field_267AD3; | 347 LODWORD(v75) = LODWORD(v14) + v2->pPalette_tintColor[0]; |
348 v16 = (double)v13 * 0.00196078431372549; | 348 v16 = (double)v13 * 0.00196078431372549; |
349 v17 = (double)SLODWORD(v75) * 0.00196078431372549; | 349 v17 = (double)SLODWORD(v75) * 0.00196078431372549; |
350 RGB2HSV(v11, v9, v17, v16, v15, v10); | 350 RGB2HSV(v11, v9, v17, v16, v15, v10); |
351 v3 += 3; | 351 v3 += 3; |
352 v8 = i + 4; | 352 v8 = i + 4; |
498 v19 = __OFSUB__(i + 4, 1024); | 498 v19 = __OFSUB__(i + 4, 1024); |
499 v18 = i - 1020 < 0; | 499 v18 = i - 1020 < 0; |
500 i += 4; | 500 i += 4; |
501 } | 501 } |
502 while ( v18 ^ v19 ); | 502 while ( v18 ^ v19 ); |
503 v45 = v2->field_267AD0; | 503 v45 = v2->pPalette_mistColor[0]; |
504 if ( v45 || v2->field_267AD1 || v2->field_267AD2 ) | 504 if ( v45 || v2->pPalette_mistColor[1] || v2->pPalette_mistColor[2] ) |
505 { | 505 { |
506 v46 = (double)v45; | 506 v46 = (double)v45; |
507 v80 = v2->field_267AD1; | 507 v80 = v2->pPalette_mistColor[1]; |
508 v47 = v2->field_267AD2; | 508 v47 = v2->pPalette_mistColor[2]; |
509 v70 = v46 * 0.00392156862745098; | 509 v70 = v46 * 0.00392156862745098; |
510 *((float *)&v71 + 1) = (double)v80 * 0.00392156862745098; | 510 *((float *)&v71 + 1) = (double)v80 * 0.00392156862745098; |
511 v75 = (double)v47 * 0.00392156862745098; | 511 v75 = (double)v47 * 0.00392156862745098; |
512 RGB2HSV(&v68, &v67, v70, *((float *)&v71 + 1), v75, (float *)&v66); | 512 RGB2HSV(&v68, &v67, v70, *((float *)&v71 + 1), v75, (float *)&v66); |
513 } | 513 } |
536 { | 536 { |
537 a1 = a1 * 31.0; | 537 a1 = a1 * 31.0; |
538 a2a = a2a * 31.0; | 538 a2a = a2a * 31.0; |
539 a3 = a3 * 31.0; | 539 a3 = a3 * 31.0; |
540 } | 540 } |
541 if ( v2->field_267AD0 || v2->field_267AD1 || v2->field_267AD2 ) | 541 if ( v2->pPalette_mistColor[0] || v2->pPalette_mistColor[1] || v2->pPalette_mistColor[2] ) |
542 { | 542 { |
543 v55 = (double)v72 * 0.03225806451612903; | 543 v55 = (double)v72 * 0.03225806451612903; |
544 v52 = (signed __int64)((double)(1 << v2->uNumTargetRBits) * v70 * v55 + a1 * (1.0 - v55)); | 544 v52 = (signed __int64)((double)(1 << v2->uNumTargetRBits) * v70 * v55 + a1 * (1.0 - v55)); |
545 v53 = (signed __int64)((double)(1 << v51) * *((float *)&v71 + 1) * v55 + a2a * (1.0 - v55)); | 545 v53 = (signed __int64)((double)(1 << v51) * *((float *)&v71 + 1) * v55 + a2a * (1.0 - v55)); |
546 v54 = (signed __int64)((double)(1 << v2->uNumTargetBBits) * v75 * v55 + a3 * (1.0 - v55)); | 546 v54 = (signed __int64)((double)(1 << v2->uNumTargetBBits) * v75 * v55 + a3 * (1.0 - v55)); |