Mercurial > mm7
comparison Render.cpp @ 709:af08fc9e29c8
Items (blue dots) on minimap fixed
author | Nomad |
---|---|
date | Thu, 21 Mar 2013 12:37:49 +0200 |
parents | e0a1fccc89b1 |
children | 735dab8d3c9a 737d7fec67f0 |
comparison
equal
deleted
inserted
replaced
708:af5771589d22 | 709:af08fc9e29c8 |
---|---|
4747 v1->field_14 = 480; | 4747 v1->field_14 = 480; |
4748 v1->field_40030 = 0; | 4748 v1->field_40030 = 0; |
4749 v1->field_4002C = 0; | 4749 v1->field_4002C = 0; |
4750 v1->pActiveZBuffer = 0; | 4750 v1->pActiveZBuffer = 0; |
4751 v1->pDefaultZBuffer = 0; | 4751 v1->pDefaultZBuffer = 0; |
4752 v1->field_20_clipy = 0; | 4752 v1->raster_clip_y = 0; |
4753 v1->field_1C_clipx = 0; | 4753 v1->raster_clip_x = 0; |
4754 v1->field_24_width = 639; | 4754 v1->raster_clip_z = 639; |
4755 v1->field_28_height = 479; | 4755 v1->raster_clip_w = 479; |
4756 v1->field_4003C = (int)&unk_4EED80; | 4756 v1->field_4003C = (int)&unk_4EED80; |
4757 v1->field_40040 = dword_4EED78; | 4757 v1->field_40040 = dword_4EED78; |
4758 v1->uClipZ = 640; | 4758 v1->uClipZ = 640; |
4759 v1->field_40044 = 2; | 4759 v1->field_40044 = 2; |
4760 v1->field_40048 = 6; | 4760 v1->field_40048 = 6; |
6292 return 0; | 6292 return 0; |
6293 } | 6293 } |
6294 | 6294 |
6295 | 6295 |
6296 //----- (004A0BEE) -------------------------------------------------------- | 6296 //----- (004A0BEE) -------------------------------------------------------- |
6297 char Render::Line2D(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned __int16 uColor) | 6297 char Render::RasterLine2D(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned __int16 uColor) |
6298 { | 6298 { |
6299 int v6; // edi@1 | 6299 int v6; // edi@1 |
6300 int v7; // edx@5 | 6300 int v7; // edx@5 |
6301 unsigned int v8; // ebx@5 | 6301 unsigned int v8; // ebx@5 |
6302 int v9; // eax@7 | 6302 int v9; // eax@7 |
6331 unsigned int uYa; // [sp+28h] [bp+Ch]@28 | 6331 unsigned int uYa; // [sp+28h] [bp+Ch]@28 |
6332 int uYb; // [sp+28h] [bp+Ch]@47 | 6332 int uYb; // [sp+28h] [bp+Ch]@47 |
6333 int uZa; // [sp+2Ch] [bp+10h]@38 | 6333 int uZa; // [sp+2Ch] [bp+10h]@38 |
6334 | 6334 |
6335 v36 = 0i64; | 6335 v36 = 0i64; |
6336 v6 = this->field_1C_clipx; | 6336 v6 = this->raster_clip_x; |
6337 v35 = this; | 6337 v35 = this; |
6338 if ( (signed int)uX < v6 ) | 6338 if ( (signed int)uX < v6 ) |
6339 HIDWORD(v36) = 8; | 6339 HIDWORD(v36) = 8; |
6340 v34 = this->field_24_width; | 6340 v34 = this->raster_clip_z; |
6341 if ( (signed int)uX > this->field_24_width ) | 6341 if ( (signed int)uX > this->raster_clip_z ) |
6342 HIDWORD(v36) |= 4u; | 6342 HIDWORD(v36) |= 4u; |
6343 v7 = this->field_20_clipy; | 6343 v7 = this->raster_clip_y; |
6344 v8 = uY; | 6344 v8 = uY; |
6345 if ( (signed int)uY < v7 ) | 6345 if ( (signed int)uY < v7 ) |
6346 HIDWORD(v36) |= 2u; | 6346 HIDWORD(v36) |= 2u; |
6347 v9 = this->field_28_height; | 6347 v9 = this->raster_clip_w; |
6348 if ( (signed int)uY > v9 ) | 6348 if ( (signed int)uY > v9 ) |
6349 HIDWORD(v36) |= 1u; | 6349 HIDWORD(v36) |= 1u; |
6350 v10 = uZ; | 6350 v10 = uZ; |
6351 if ( (signed int)uZ < v6 ) | 6351 if ( (signed int)uZ < v6 ) |
6352 LODWORD(v36) = 8; | 6352 LODWORD(v36) = 8; |
6445 if ( BYTE4(v36) & 8 ) | 6445 if ( BYTE4(v36) & 8 ) |
6446 { | 6446 { |
6447 v13 = (signed int)((uW - uY) * (v6 - uX)) / (signed int)(uZ - uX); | 6447 v13 = (signed int)((uW - uY) * (v6 - uX)) / (signed int)(uZ - uX); |
6448 v14 = v35; | 6448 v14 = v35; |
6449 v8 = v13 + uY; | 6449 v8 = v13 + uY; |
6450 uX = v35->field_1C_clipx; | 6450 uX = v35->raster_clip_x; |
6451 goto LABEL_24; | 6451 goto LABEL_24; |
6452 } | 6452 } |
6453 v10 = v6; | 6453 v10 = v6; |
6454 v11 = (signed int)((uY - uW) * (v6 - uZ)) / (signed int)(uX - uZ) + uW; | 6454 v11 = (signed int)((uY - uW) * (v6 - uZ)) / (signed int)(uX - uZ) + uW; |
6455 } | 6455 } |
6456 v14 = v35; | 6456 v14 = v35; |
6457 LABEL_24: | 6457 LABEL_24: |
6458 if ( (BYTE4(v36) ^ (unsigned __int8)v36) & 4 ) | 6458 if ( (BYTE4(v36) ^ (unsigned __int8)v36) & 4 ) |
6459 { | 6459 { |
6460 v15 = v14->field_24_width; | 6460 v15 = v14->raster_clip_z; |
6461 if ( BYTE4(v36) & 4 ) | 6461 if ( BYTE4(v36) & 4 ) |
6462 { | 6462 { |
6463 v14 = v35; | 6463 v14 = v35; |
6464 v8 += (signed int)((v11 - v8) * (v15 - uX)) / (signed int)(v10 - uX); | 6464 v8 += (signed int)((v11 - v8) * (v15 - uX)) / (signed int)(v10 - uX); |
6465 uX = v35->field_24_width; | 6465 uX = v35->raster_clip_z; |
6466 } | 6466 } |
6467 else | 6467 else |
6468 { | 6468 { |
6469 v16 = (signed int)((v8 - v11) * (v15 - v10)) / (signed int)(uX - v10); | 6469 v16 = (signed int)((v8 - v11) * (v15 - v10)) / (signed int)(uX - v10); |
6470 v10 = v14->field_24_width; | 6470 v10 = v14->raster_clip_z; |
6471 v11 += v16; | 6471 v11 += v16; |
6472 } | 6472 } |
6473 } | 6473 } |
6474 v17 = v14->field_20_clipy; | 6474 v17 = v14->raster_clip_y; |
6475 v37 = 0; | 6475 v37 = 0; |
6476 uYa = v14->field_20_clipy; | 6476 uYa = v14->raster_clip_y; |
6477 if ( (signed int)v8 < v17 ) | 6477 if ( (signed int)v8 < v17 ) |
6478 v37 = 2; | 6478 v37 = 2; |
6479 v18 = v14->field_28_height; | 6479 v18 = v14->raster_clip_w; |
6480 if ( (signed int)v8 > v18 ) | 6480 if ( (signed int)v8 > v18 ) |
6481 v37 |= 1u; | 6481 v37 |= 1u; |
6482 if ( (signed int)v11 >= v17 ) | 6482 if ( (signed int)v11 >= v17 ) |
6483 v12 = 0; | 6483 v12 = 0; |
6484 else | 6484 else |
6493 { | 6493 { |
6494 if ( v37 & 2 ) | 6494 if ( v37 & 2 ) |
6495 { | 6495 { |
6496 uX += (signed int)((v10 - uX) * (uYa - v8)) / (signed int)(v11 - v8); | 6496 uX += (signed int)((v10 - uX) * (uYa - v8)) / (signed int)(v11 - v8); |
6497 LOBYTE(v12) = (char)v35; | 6497 LOBYTE(v12) = (char)v35; |
6498 v8 = v35->field_20_clipy; | 6498 v8 = v35->raster_clip_y; |
6499 } | 6499 } |
6500 else | 6500 else |
6501 { | 6501 { |
6502 v19 = (signed int)((uX - v10) * (uYa - v11)); | 6502 v19 = (signed int)((uX - v10) * (uYa - v11)); |
6503 v20 = v8 - v11; | 6503 v20 = v8 - v11; |
6508 } | 6508 } |
6509 if ( uZa & 1 ) | 6509 if ( uZa & 1 ) |
6510 { | 6510 { |
6511 if ( v37 & 1 ) | 6511 if ( v37 & 1 ) |
6512 { | 6512 { |
6513 uX += (signed int)((v10 - uX) * (v35->field_28_height - v8)) / (signed int)(v11 - v8); | 6513 uX += (signed int)((v10 - uX) * (v35->raster_clip_w - v8)) / (signed int)(v11 - v8); |
6514 LOBYTE(v12) = (char)v35; | 6514 LOBYTE(v12) = (char)v35; |
6515 v8 = v35->field_28_height; | 6515 v8 = v35->raster_clip_w; |
6516 } | 6516 } |
6517 else | 6517 else |
6518 { | 6518 { |
6519 v12 = (signed int)((uX - v10) * (v35->field_28_height - v11)) / (signed int)(v8 - v11); | 6519 v12 = (signed int)((uX - v10) * (v35->raster_clip_w - v11)) / (signed int)(v8 - v11); |
6520 v11 = v35->field_28_height; | 6520 v11 = v35->raster_clip_w; |
6521 v10 += v12; | 6521 v10 += v12; |
6522 } | 6522 } |
6523 } | 6523 } |
6524 goto LABEL_46; | 6524 goto LABEL_46; |
6525 } | 6525 } |
6535 } | 6535 } |
6536 | 6536 |
6537 | 6537 |
6538 | 6538 |
6539 //----- (004A0E97) -------------------------------------------------------- | 6539 //----- (004A0E97) -------------------------------------------------------- |
6540 void Render::Clip_v2(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW) | 6540 void Render::SetRasterClipRect(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW) |
6541 { | 6541 { |
6542 this->field_1C_clipx = uX; | 6542 this->raster_clip_x = uX; |
6543 this->field_20_clipy = uY; | 6543 this->raster_clip_y = uY; |
6544 this->field_24_width = uZ; | 6544 this->raster_clip_z = uZ; |
6545 this->field_28_height = uW; | 6545 this->raster_clip_w = uW; |
6546 } | 6546 } |
6547 | 6547 |
6548 | 6548 |
6549 //----- (004A0EB6) -------------------------------------------------------- | 6549 //----- (004A0EB6) -------------------------------------------------------- |
6550 void Render::ParseTargetPixelFormat() | 6550 void Render::ParseTargetPixelFormat() |