comparison Outdoor.cpp @ 86:ec84db4c8f9d

4.01.13
author Ritor1
date Mon, 04 Feb 2013 09:17:35 +0600
parents d56c13146285
children 170259c8c71f
comparison
equal deleted inserted replaced
85:3f2d5c80e162 86:ec84db4c8f9d
56 v2 = bRedraw; 56 v2 = bRedraw;
57 if ( viewparams->field_54 ) 57 if ( viewparams->field_54 )
58 v1 = 2; 58 v1 = 2;
59 pIndoorCamera->sRotationX = pParty->sRotationX; 59 pIndoorCamera->sRotationX = pParty->sRotationX;
60 pIndoorCamera->sRotationY = pParty->sRotationY; 60 pIndoorCamera->sRotationY = pParty->sRotationY;
61 pIndoorCamera->pos.x = pParty->vPosition.x 61 pIndoorCamera->pos.x = pParty->vPosition.x - ((unsigned __int64)(stru_5C6E00->SinCos(pParty->sRotationY) * (signed __int64)pParty->field_18) >> 16);
62 - ((unsigned __int64)(stru_5C6E00->SinCos(pParty->sRotationY)
63 * (signed __int64)pParty->field_18) >> 16);
64 v3 = stru_5C6E00->SinCos(pParty->sRotationY - stru_5C6E00->uIntegerHalfPi); 62 v3 = stru_5C6E00->SinCos(pParty->sRotationY - stru_5C6E00->uIntegerHalfPi);
65 pIndoorCamera->field_4C = v1; 63 pIndoorCamera->field_4C = v1;
66 pIndoorCamera->pos.y = pParty->vPosition.y - pParty->field_18 * ((stru_5C6E00->SinCos(pParty->sRotationY)) >> 16); 64 pIndoorCamera->pos.y = pParty->vPosition.y - pParty->field_18 * ((stru_5C6E00->SinCos(pParty->sRotationY)) >> 16);
67 pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel; 65 pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel;
68 if ( v2 || pRenderer->pRenderD3D ) 66 if ( v2 || pRenderer->pRenderD3D )
90 { 88 {
91 pRenderer->OnOutdoorRedrawSW(); 89 pRenderer->OnOutdoorRedrawSW();
92 goto LABEL_16; 90 goto LABEL_16;
93 } 91 }
94 //goto LABEL_14; 92 //goto LABEL_14;
95 pRenderer->DrawSkyD3D(); 93 pRenderer->DrawSkyD3D();
96 pRenderer->DrawBuildingsD3D(); 94 pRenderer->DrawBuildingsD3D();
97 pRenderer->DrawBezierTerrain(); 95 pRenderer->DrawBezierTerrain();
98 goto LABEL_16; 96 goto LABEL_16;
99 } 97 }
100 if ( pRenderer->pRenderD3D ) 98 if ( pRenderer->pRenderD3D )
217 } 215 }
218 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int); 216 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
219 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int); 217 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
220 218
221 //----- (00488EEF) -------------------------------------------------------- 219 //----- (00488EEF) --------------------------------------------------------
222 unsigned int OutdoorLocation::GetTileTexture(int sX, int sY) 220 unsigned int OutdoorLocation::GetTileTexture(int sX, int sZ)
223 { 221 {
224 //OutdoorLocation *v3; // esi@1 222 //OutdoorLocation *v3; // esi@1
225 unsigned int v4; // edi@1 223 unsigned int v4; // edi@1
226 unsigned int v5; // eax@1 224 unsigned int v5; // eax@1
227 // unsigned int result; // eax@5 225 // unsigned int result; // eax@5
232 if ( v5< 0 || (signed int)v5 > 127 || v4 < 0 || (signed int)v4 > 127 )//if ( (v5 & 0x80000000u) != 0 || (signed int)v5 > 127 || (v4 & 0x80000000u) != 0 || (signed int)v4 > 127 ) 230 if ( v5< 0 || (signed int)v5 > 127 || v4 < 0 || (signed int)v4 > 127 )//if ( (v5 & 0x80000000u) != 0 || (signed int)v5 > 127 || (v4 & 0x80000000u) != 0 || (signed int)v4 > 127 )
233 result = -1; 231 result = -1;
234 else 232 else
235 result = DoGetTileTexture(v5, v4); 233 result = DoGetTileTexture(v5, v4);
236 return result;*/ 234 return result;*/
237 v4 = WorldPosToGridCellZ(sY); 235 v4 = WorldPosToGridCellZ(sZ);
238 v5 = WorldPosToGridCellX(sX); 236 v5 = WorldPosToGridCellX(sX);
239 if ( v5 < 0 || v5 > 127 || v4 < 0 || v4 > 127 ) 237 if ( v5 < 0 || v5 > 127 || v4 < 0 || v4 > 127 )
240 return -1; 238 return -1;
241 return DoGetTileTexture(v5, v4); 239 return DoGetTileTexture(v5, v4);
242 } 240 }
2397 } 2395 }
2398 return result; 2396 return result;
2399 } 2397 }
2400 2398
2401 //----- (0047ED08) -------------------------------------------------------- 2399 //----- (0047ED08) --------------------------------------------------------
2402 unsigned int OutdoorLocation::DoGetTileTexture(unsigned int uX, unsigned int uY) 2400 unsigned int OutdoorLocation::DoGetTileTexture(unsigned int uX, unsigned int uZ)
2403 { 2401 {
2404 int v3; // esi@5 2402 int uTileID; // esi@5
2405 unsigned int result; // eax@9 2403 unsigned int result; // eax@9
2406 2404
2407 2405
2408 /* v3 = *(&this->pTerrain.pTilemap[128 * uZ] + uX); 2406 /* v3 = *(&this->pTerrain.pTilemap[128 * uZ] + uX);
2409 if ( v3 < 198 ) 2407 if ( v3 < 198 )
2416 v3 = v3 + this->pTileTypes[3].uTileID - 198; 2414 v3 = v3 + this->pTileTypes[3].uTileID - 198;
2417 } 2415 }
2418 result = pTileTable->pTiles[v3].uBitmapID; 2416 result = pTileTable->pTiles[v3].uBitmapID;
2419 } 2417 }
2420 return result;*/ 2418 return result;*/
2421 if (uX > 127 || uY > 127) 2419 if (uX > 127 || uZ > 127)
2422 return 0; 2420 return 0;
2423 2421
2424 v3 = this->pTerrain.pTilemap[uY * 128 + uX]; 2422 uTileID = this->pTerrain.pTilemap[uZ * 128 + uX];
2425 if (v3 < 198) 2423 if (uTileID < 198)
2426 { 2424 {
2427 if (v3 >= 90) 2425 if (uTileID >= 90)
2428 v3 = v3 + this->pTileTypes[(v3 - 90) / 18].uTileID - 36 * (v3 - 90) / 36 - 90; 2426 uTileID = uTileID + this->pTileTypes[(uTileID - 90) / 18].uTileID - 36 * (uTileID - 90) / 36 - 90;
2429 } 2427 }
2430 else 2428 else
2431 v3 = v3 + this->pTileTypes[3].uTileID - 198; 2429 uTileID = uTileID + this->pTileTypes[3].uTileID - 198;
2432 2430
2433 return pTileTable->pTiles[v3].uBitmapID; 2431 return pTileTable->pTiles[uTileID].uBitmapID;
2434 } 2432 }
2435 2433
2436 //----- (0047ED83) -------------------------------------------------------- 2434 //----- (0047ED83) --------------------------------------------------------
2437 int OutdoorLocation::_47ED83(signed int a2, signed int a3) 2435 int OutdoorLocation::_47ED83(signed int a2, signed int a3)
2438 { 2436 {