comparison Outdoor.cpp @ 259:92a551e4dbeb

Слияние
author Ritor1
date Mon, 18 Feb 2013 09:44:59 +0600
parents 07eb7d649bd5
children 96bc024a5fed
comparison
equal deleted inserted replaced
258:6764ce3cb9bb 259:92a551e4dbeb
44 44
45 45
46 //----- (0047A59E) -------------------------------------------------------- 46 //----- (0047A59E) --------------------------------------------------------
47 void OutdoorLocation::ExecDraw(unsigned int bRedraw) 47 void OutdoorLocation::ExecDraw(unsigned int bRedraw)
48 { 48 {
49 int v1; // edi@1
50 //unsigned int v2; // ebx@1 49 //unsigned int v2; // ebx@1
51 int v3; // ST18_4@3 50 int v3; // ST18_4@3
52 int v4; // ST04_4@19 51 int v4; // ST04_4@19
53 int v5; // eax@19 52 int v5; // eax@19
54 53
55 v1 = 0; 54 pIndoorCamera->flags = 0;
56 //v2 = bRedraw; 55 if (viewparams->draw_d3d_outlines)
57 if ( viewparams->field_54 ) 56 pIndoorCamera->flags |= INDOOR_CAMERA_DRAW_D3D_OUTLINES;
58 v1 = 2; 57
59 pIndoorCamera->sRotationX = pParty->sRotationX; 58 pIndoorCamera->sRotationX = pParty->sRotationX;
60 pIndoorCamera->sRotationY = pParty->sRotationY; 59 pIndoorCamera->sRotationY = pParty->sRotationY;
61 pIndoorCamera->pos.x = pParty->vPosition.x 60 pIndoorCamera->pos.x = pParty->vPosition.x
62 - ((unsigned __int64)(stru_5C6E00->SinCos(pParty->sRotationY) 61 - ((unsigned __int64)(stru_5C6E00->SinCos(pParty->sRotationY)
63 * (signed __int64)pParty->y_rotation_granularity) >> 16); 62 * (signed __int64)pParty->y_rotation_granularity) >> 16);
64 //v3 = stru_5C6E00->SinCos(pParty->sRotationY - stru_5C6E00->uIntegerHalfPi);
65 pIndoorCamera->field_4C = v1;
66 pIndoorCamera->pos.y = pParty->vPosition.y - pParty->y_rotation_granularity * ((stru_5C6E00->SinCos(pParty->sRotationY)) >> 16); 63 pIndoorCamera->pos.y = pParty->vPosition.y - pParty->y_rotation_granularity * ((stru_5C6E00->SinCos(pParty->sRotationY)) >> 16);
67 pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel; 64 pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel;
68 if (bRedraw || pRenderer->pRenderD3D) 65 if (bRedraw || pRenderer->pRenderD3D)
69 { 66 {
70 ResetStru148s(); 67 ResetStru148s();
2010 header.pMagic[0] != 'm' || 2007 header.pMagic[0] != 'm' ||
2011 header.pMagic[1] != 'v' || 2008 header.pMagic[1] != 'v' ||
2012 header.pMagic[2] != 'i' || 2009 header.pMagic[2] != 'i' ||
2013 header.pMagic[3] != 'i' ) 2010 header.pMagic[3] != 'i' )
2014 { 2011 {
2015 MessageBoxW(nullptr, L"Can't load file!", 2012 MessageBoxW(nullptr, L"Can't load file!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Odmap.cpp:746", 0);
2016 L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Odmap.cpp:746", 0);
2017 Str2 = (char *)1; 2013 Str2 = (char *)1;
2018 } 2014 }
2019 //v74 = 0; 2015 //v74 = 0;
2020 //pFilename = (char *)header.uCompressedSize; 2016 //pFilename = (char *)header.uCompressedSize;
2021 //v149 = 0; 2017 //v149 = 0;
2409 unsigned int OutdoorLocation::DoGetTileTexture(unsigned int uX, unsigned int uY) 2405 unsigned int OutdoorLocation::DoGetTileTexture(unsigned int uX, unsigned int uY)
2410 { 2406 {
2411 int v3; // esi@5 2407 int v3; // esi@5
2412 unsigned int result; // eax@9 2408 unsigned int result; // eax@9
2413 2409
2414 2410 if ( uX < 0 || uX > 127 || uY < 0 || uY > 127)
2415 /* v3 = *(&this->pTerrain.pTilemap[128 * uZ] + uX);
2416 if ( v3 < 198 )
2417 {
2418 if ( v3 >= 90 )
2419 v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * (v3 - 90) / 36 - 90;
2420 }
2421 else
2422 {
2423 v3 = v3 + this->pTileTypes[3].uTileID - 198;
2424 }
2425 result = pTileTable->pTiles[v3].uBitmapID;
2426 }
2427 return result;*/
2428 if (uX > 127 || uY > 127)
2429 return 0; 2411 return 0;
2430 2412
2431 v3 = this->pTerrain.pTilemap[uY * 128 + uX]; 2413 v3 = this->pTerrain.pTilemap[uY * 128 + uX];
2432 if (v3 < 198) 2414 if (v3 < 198)
2433 { 2415 {
2434 if (v3 >= 90) 2416 if (v3 >= 90)
2435 v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * (v3 - 90) / 36 - 90; 2417 v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * ((v3 - 90) / 36) - 90;
2436 } 2418 }
2437 else 2419 else
2438 v3 = v3 + this->pTileTypes[3].uTileID - 198; 2420 v3 = v3 + this->pTileTypes[3].uTileID - 198;
2439 2421
2440 return pTileTable->pTiles[v3].uBitmapID; 2422 return pTileTable->pTiles[v3].uBitmapID;
2454 2436
2455 //----- (0047EDB3) -------------------------------------------------------- 2437 //----- (0047EDB3) --------------------------------------------------------
2456 int OutdoorLocation::ActuallyGetSomeOtherTileInfo(unsigned int uX, unsigned int uY) 2438 int OutdoorLocation::ActuallyGetSomeOtherTileInfo(unsigned int uX, unsigned int uY)
2457 { 2439 {
2458 int v3; // esi@5 2440 int v3; // esi@5
2459 //int result; // eax@7 2441
2460 2442 if (uX < 0 || uX > 127 || uY < 0 || uY > 127)
2461 /* if ( (uX & 0x80000000u) != 0 || (signed int)uX > 127 || (uY & 0x80000000u) != 0 || (signed int)uY > 127 )
2462 {
2463 result = 0;
2464 }
2465 else
2466 {
2467 v3 = *(&this->pTerrain.pTilemap[128 * uY] + uX);
2468 if ( v3 >= 90 )
2469 v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * (v3 - 90) / 36 - 90;
2470 result = pTileTable->pTiles[v3].uAttributes;
2471 }
2472 return result;*/
2473 if (uX > 127 || uY > 127)
2474 return 0; 2443 return 0;
2475 else 2444 else
2476 { 2445 {
2477 v3 = this->pTerrain.pTilemap[uY * 128 + uX]; 2446 v3 = this->pTerrain.pTilemap[uY * 128 + uX];
2478 if ( v3 >= 90 ) 2447 if ( v3 >= 90 )
2479 v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * (v3 - 90) / 36 - 90; 2448 v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * ((v3 - 90) / 36) - 90;
2480 return pTileTable->pTiles[v3].uAttributes; 2449 return pTileTable->pTiles[v3].uAttributes;
2481 } 2450 }
2482 } 2451 }
2483 2452
2484 //----- (0047EE16) -------------------------------------------------------- 2453 //----- (0047EE16) --------------------------------------------------------
2485 int OutdoorLocation::DoGetHeightOnTerrain(unsigned int uX, unsigned int uZ) 2454 int OutdoorLocation::DoGetHeightOnTerrain(unsigned int uX, unsigned int uZ)
2486 { 2455 {