Mercurial > mm7
changeset 2171:41bb73de29fb
Слияние
author | Ritor1 |
---|---|
date | Mon, 20 Jan 2014 09:22:16 +0600 |
parents | 919ca19c5466 (current diff) 5b27c035a241 (diff) |
children | 56aa61b54785 |
files | |
diffstat | 10 files changed, 348 insertions(+), 437 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Mon Jan 20 09:22:09 2014 +0600 +++ b/Actor.cpp Mon Jan 20 09:22:16 2014 +0600 @@ -3919,11 +3919,8 @@ Actor::AddBloodsplatOnDamageOverlay(uActorID_Monster, 1, v61); } //----- (004BBF61) -------------------------------------------------------- -void Actor::_4BBF61_summon_actor( int a1, __int16 x, int y, int z ) +void Actor::Arena_summon_actor( int monster_id, __int16 x, int y, int z ) { - Actor *v7; // esi@5 - //MonsterInfo *v9; // edi@5 - //MonsterDesc *v10; // ebx@5 int v12; // ebx@7 int v13; // eax@8 __int16 v16; // [sp+10h] [bp-4h]@3 @@ -3933,43 +3930,40 @@ v16 = 0; if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) v16 = pIndoor->GetSector(x, y, z); - v7 = &pActors[uNumActors]; - v7->Reset(); - //v9 = &pMonsterStats->pInfos[a1]; - //v10 = &pMonsterList->pMonsters[a1 - 1]; - strcpy(v7->pActorName, pMonsterStats->pInfos[a1].pName); - v7->sCurrentHP = LOWORD(pMonsterStats->pInfos[a1].uHP); - memcpy(&v7->pMonsterInfo, &pMonsterStats->pInfos[a1], 0x58u); - v7->word_000086_some_monster_id = a1; - v7->uActorRadius = pMonsterList->pMonsters[a1 - 1].uMonsterRadius; - v7->uActorHeight = pMonsterList->pMonsters[a1 - 1].uMonsterHeight; - v7->uMovementSpeed = pMonsterList->pMonsters[a1 - 1].uMovementSpeed; - v7->vInitialPosition.x = x; - v7->vPosition.x = x; - v7->uAttributes |= 80000; - v7->pMonsterInfo.uTreasureType = 0; - v7->pMonsterInfo.uTreasureLevel = 0; - v7->pMonsterInfo.uTreasureDiceSides = 0; - v7->pMonsterInfo.uTreasureDiceRolls = 0; - v7->pMonsterInfo.uTreasureDropChance = 0; - v7->vInitialPosition.y = y; - v7->vPosition.y = y; - v7->vInitialPosition.z = z; - v7->vPosition.z = z; - v7->uTetherDistance = 256; - v7->uSectorID = v16; - v7->uGroup = 1; - v7->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; - v7->PrepareSprites(0); - for ( int i = 0; i < 4; i++) - pSoundList->LoadSound(pMonsterList->pMonsters[a1 - 1].pSoundSampleIDs[i], 0); - //v12 = 0; - //do// - //{ - //LOWORD(v13) = pSoundList->LoadSound(v12 + word_4EE088_sound_ids[pMonsterStats->pInfos[a1].uSpell1ID], 1); - //v12++; - //} - //while ( v13 ); + pActors[uNumActors].Reset(); + strcpy(pActors[uNumActors].pActorName, pMonsterStats->pInfos[monster_id].pName); + pActors[uNumActors].sCurrentHP = LOWORD(pMonsterStats->pInfos[monster_id].uHP); + memcpy(&pActors[uNumActors].pMonsterInfo, &pMonsterStats->pInfos[monster_id], 0x58u); + pActors[uNumActors].word_000086_some_monster_id = monster_id; + pActors[uNumActors].uActorRadius = pMonsterList->pMonsters[monster_id - 1].uMonsterRadius; + pActors[uNumActors].uActorHeight = pMonsterList->pMonsters[monster_id - 1].uMonsterHeight; + pActors[uNumActors].uMovementSpeed = pMonsterList->pMonsters[monster_id - 1].uMovementSpeed; + pActors[uNumActors].vInitialPosition.x = x; + pActors[uNumActors].vPosition.x = x; + pActors[uNumActors].uAttributes |= 80000; + pActors[uNumActors].pMonsterInfo.uTreasureType = 0; + pActors[uNumActors].pMonsterInfo.uTreasureLevel = 0; + pActors[uNumActors].pMonsterInfo.uTreasureDiceSides = 0; + pActors[uNumActors].pMonsterInfo.uTreasureDiceRolls = 0; + pActors[uNumActors].pMonsterInfo.uTreasureDropChance = 0; + pActors[uNumActors].vInitialPosition.y = y; + pActors[uNumActors].vPosition.y = y; + pActors[uNumActors].vInitialPosition.z = z; + pActors[uNumActors].vPosition.z = z; + pActors[uNumActors].uTetherDistance = 256; + pActors[uNumActors].uSectorID = v16; + pActors[uNumActors].uGroup = 1; + pActors[uNumActors].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; + pActors[uNumActors].PrepareSprites(0); + for ( int i = 0; i < 4; i++) + pSoundList->LoadSound(pMonsterList->pMonsters[monster_id - 1].pSoundSampleIDs[i], 0); + v12 = 0; + do + { + v13 = pSoundList->LoadSound(v12 + word_4EE088_sound_ids[pMonsterStats->pInfos[monster_id].uSpell1ID], 1); + v12++; + } + while ( v13 ); ++uNumActors; } }
--- a/Actor.h Mon Jan 20 09:22:09 2014 +0600 +++ b/Actor.h Mon Jan 20 09:22:16 2014 +0600 @@ -248,7 +248,7 @@ static void AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3); static bool _46DF1A_collide_against_actor(int a1, int a2); - static void _4BBF61_summon_actor(int a1, __int16 x, int y, int z); // idb + static void Arena_summon_actor(int monster_id, __int16 x, int y, int z); void LootActor();
--- a/Outdoor.cpp Mon Jan 20 09:22:09 2014 +0600 +++ b/Outdoor.cpp Mon Jan 20 09:22:16 2014 +0600 @@ -365,7 +365,6 @@ //----- (0048902E) -------------------------------------------------------- bool OutdoorLocation::GetTravelDestination(signed int sPartyX, signed int sPartyZ, char *pOut, signed int a5) { - OutdoorLocation *v5; // esi@1 char *v6; // eax@3 int v7; // eax@3 //int v8; // edx@3 @@ -373,46 +372,27 @@ //int v10; // esi@23 signed int v11; // eax@23 //int v12; // ST14_4@25 - signed int v14; // [sp-4h] [bp-84h]@6 + //signed int v14; // [sp-4h] [bp-84h]@6 char Str[140]; // [sp+8h] [bp-78h]@3 //int a5a; // [sp+94h] [bp+14h]@3 - OutdoorLocation* Source = this; - - v5 = Source; - if ( a5 < 10 - || strlen(Source->pLevelFilename) != 9 - || (strcpy(Str, v5->pLevelFilename), - _strlwr(Str), - v6 = strtok(Str, "out"), - v6[2] = 0, - v7 = atoi(v6), - //v8 = v7, - //a5a = v7, - v7 < 1) - || v7 > 15 ) - return 0; - if ( sPartyX < -22528 ) - { - v14 = 4; -LABEL_7: - v9 = v14; - goto LABEL_14; - } - if ( sPartyX > 22528 ) - { - v14 = 3; - goto LABEL_7; - } - if ( sPartyZ < -22528 ) - { - v14 = 2; - goto LABEL_7; - } - if ( sPartyZ <= 22528 ) + strcpy(Str, this->pLevelFilename);// + _strlwr(Str); + v6 = strtok(Str, "out"); + v6[2] = 0; + v7 = atoi(v6); + if ( a5 < 10 || strlen(this->pLevelFilename) != 9 || v7 < 1 || v7 > 15 ) // .odm return 0; v9 = 1; -LABEL_14: + if ( sPartyX < -22528 )// + v9 = 4; + else if ( sPartyX > 22528 ) + v9 = 3; + else if ( sPartyZ < -22528 ) + v9 = 2; + else if ( sPartyZ <= 22528 ) + return 0; + if ( v7 == 14 ) { if ( v9 == 4 ) // to & from Shoals @@ -425,7 +405,6 @@ uDefaultTravelTime_ByFoot = 1; strcpy(pOut, "out15.odm"); uLevel_StartingPointType = MapStartPoint_East; -LABEL_18: LOWORD(pParty->uFlags) &= 0xFD7Bu; return 1; } @@ -437,9 +416,10 @@ if ( v7 == 15 && v9 == 3 ) { uDefaultTravelTime_ByFoot = 1; - strcpy(pOut, "out14.odm"); + strcpy(pOut, "out14.odm");// uLevel_StartingPointType = MapStartPoint_West; - goto LABEL_18; + LOWORD(pParty->uFlags) &= 0xFD7Bu; + return 1; } } //v10 = v9 + 4 * v7; @@ -452,7 +432,7 @@ uDefaultTravelTime_ByFoot = foot_travel_times[v7 - 1][v9 - 1]; uLevel_StartingPointType = foot_travel_arrival_points[v7 - 1][v9 - 1]; - sprintf(pOut, "out%02d.odm", v11); + sprintf(pOut, "out%02d.odm", v11); // return 1; //} //return 0; @@ -463,92 +443,64 @@ //----- (0048917E) -------------------------------------------------------- void OutdoorLocation::MessWithLUN() { - OutdoorLocation *v1; // esi@1 - unsigned int *v2; // ebp@1 - unsigned int v3; // eax@1 - unsigned __int16 v4; // ax@1 - signed int v5; // ebx@1 - - v1 = this; - v2 = this->pSpriteIDs_LUN; this->pSpriteIDs_LUN[0] = -1; + this->pSpriteIDs_LUN[1] = 0; this->pSpriteIDs_LUN[2] = pSpriteFrameTable->FastFindSprite("LUN1-4"); - v1->pSpriteIDs_LUN[4] = pSpriteFrameTable->FastFindSprite("LUN1-2"); - v1->pSpriteIDs_LUN[6] = pSpriteFrameTable->FastFindSprite("LUN3-4"); - v1->uSpriteID_LUNFULL = pSpriteFrameTable->FastFindSprite("LUNFULL"); - v1->uSpriteID_LUN3_4_cp = pSpriteFrameTable->FastFindSprite("LUN3-4"); - v1->uSpriteID_LUN1_2_cp = pSpriteFrameTable->FastFindSprite("LUN1-2"); - v3 = pSpriteFrameTable->FastFindSprite("LUN1-4"); - v1->field_D60 = -1; - v1->uSpriteID_LUN1_4_cp = v3; - v1->field_CF0 = 4; - v1->field_CF8 = 4; - v1->field_D00 = 4; - LOWORD(v3) = *(short *)v2; - v1->pSpriteIDs_LUN[1] = 0; - v1->pSpriteIDs_LUN[3] = 0; - v1->pSpriteIDs_LUN[5] = 0; - v1->pSpriteIDs_LUN[7] = 0; - v1->field_CE8 = 0; - LOWORD(v1->field_D3C) = v3; - v1->field_D40 = 0; - v1->field_D44 = 0; - v1->field_D48 = 0; - v1->field_D4C = 131072; - v1->field_D5C = 0; - v1->field_D64 = 0; - v4 = pSpriteFrameTable->FastFindSprite("LUN-SUN"); - v1->field_D28 = -1; - v1->field_D08 = 0; - v1->field_D0C = 0; - v1->field_D10 = 0; - v1->field_D24 = 0; - v1->field_D2C = 0; - v1->uSpriteID_LUN_SUN = v4; - v1->field_D14 = -131072; - v5 = 8; - do - { - pSpriteFrameTable->InitializeSprite(*v2); - v2 += 2; - --v5; - } - while ( v5 ); - pSpriteFrameTable->InitializeSprite(v1->uSpriteID_LUN_SUN); + this->pSpriteIDs_LUN[3] = 0; + this->pSpriteIDs_LUN[4] = pSpriteFrameTable->FastFindSprite("LUN1-2"); + this->pSpriteIDs_LUN[5] = 0; + this->pSpriteIDs_LUN[6] = pSpriteFrameTable->FastFindSprite("LUN3-4"); + this->pSpriteIDs_LUN[7] = 0; + this->uSpriteID_LUNFULL = pSpriteFrameTable->FastFindSprite("LUNFULL"); + this->uSpriteID_LUN1_2_cp = pSpriteFrameTable->FastFindSprite("LUN1-2"); + this->uSpriteID_LUN1_4_cp = pSpriteFrameTable->FastFindSprite("LUN1-4"); + this->uSpriteID_LUN3_4_cp = pSpriteFrameTable->FastFindSprite("LUN3-4"); + this->field_D60 = -1; + this->field_CF0 = 4; + this->field_CF8 = 4; + this->field_D00 = 4; + this->field_CE8 = 0; + this->field_D3C = (int)this->pSpriteIDs_LUN; + this->field_D40 = 0; + this->field_D44 = 0; + this->field_D48 = 0; + this->field_D4C = 131072; + this->field_D5C = 0; + this->field_D64 = 0; + this->field_D28 = -1; + this->field_D08 = 0; + this->field_D0C = 0; + this->field_D10 = 0; + this->field_D24 = 0; + this->field_D2C = 0; + this->uSpriteID_LUN_SUN = pSpriteFrameTable->FastFindSprite("LUN-SUN"); + this->field_D14 = -131072; + for ( uint i = 0; i < 8; i++ ) + pSpriteFrameTable->InitializeSprite(this->pSpriteIDs_LUN[i]);//v2 += 2; + pSpriteFrameTable->InitializeSprite(this->uSpriteID_LUN_SUN); } //----- (004892E6) -------------------------------------------------------- void OutdoorLocation::UpdateSunlightVectors() { - //unsigned int result; // eax@1 - OutdoorLocation *v2; // esi@1 unsigned int v3; // edi@3 - //int v4; // ebx@3 - int v5; // eax@3 - //int v6; // eax@3 - //int v7; // ecx@3 double v8; // st7@4 - v2 = this; if ( pParty->uCurrentHour >= 5 && pParty->uCurrentHour < 21 ) { v3 = pParty->uCurrentMinute + 60 * (pParty->uCurrentHour - 5); - //v4 = (signed int)(v3 * stru_5C6E00->uIntegerPi) / 960; - v5 = stru_5C6E00->Cos((signed int)(v3 * stru_5C6E00->uIntegerPi) / 960); - v2->inv_sunlight_y = 0; - v2->inv_sunlight_x = v5; - //v6 = stru_5C6E00->Sin(v4); - //v7 = v2->field_D18; - v2->inv_sunlight_z = stru_5C6E00->Sin((signed int)(v3 * stru_5C6E00->uIntegerPi) / 960); - v2->vSunlight.x = -v2->inv_sunlight_x; - v2->vSunlight.y = -v2->inv_sunlight_y; - v2->vSunlight.z = -v2->inv_sunlight_z; + this->inv_sunlight_y = 0; + this->inv_sunlight_x = stru_5C6E00->Cos((signed int)(v3 * stru_5C6E00->uIntegerPi) / 960); + this->inv_sunlight_z = stru_5C6E00->Sin((signed int)(v3 * stru_5C6E00->uIntegerPi) / 960); + this->vSunlight.x = -this->inv_sunlight_x; + this->vSunlight.y = -this->inv_sunlight_y; + this->vSunlight.z = -this->inv_sunlight_z; if ( (signed int)v3 >= 480 ) v8 = (double)(signed int)(960 - v3); else v8 = (double)(signed int)v3; - v2->max_terrain_dimming_level = (signed __int64)(20.0 - v8 / 480.0 * 20.0); - v2->uLastSunlightUpdateMinute = pParty->uCurrentMinute; + this->max_terrain_dimming_level = (signed __int64)(20.0 - v8 / 480.0 * 20.0); + this->uLastSunlightUpdateMinute = pParty->uCurrentMinute; } } @@ -633,10 +585,8 @@ } //----- (00482170) -------------------------------------------------------- -bool ODMFace::IsBackfaceCulled(ODMFace *a1, RenderVertexSoft *a2, struct Polygon *a3) +bool ODMFace::IsBackfaceCulled(RenderVertexSoft *a2, struct Polygon *polygon) { - struct Polygon *v3; // edi@1 - RenderVertexSoft *v4; // esi@1 unsigned int v5; // edx@1 RenderVertexSoft *v6; // ecx@2 double v7; // st7@5 @@ -645,7 +595,6 @@ double v10; // st6@9 double v11; // st5@9 double v12; // st4@9 - bool result; // eax@16 double v14; // ST2C_8@17 double v15; // ST20_8@17 double v16; // ST0C_8@17 @@ -667,26 +616,24 @@ float a3d; // [sp+48h] [bp+8h]@17 float a3e; // [sp+48h] [bp+8h]@17 - v3 = a3; - v4 = a2; - v5 = a3->uNumVertices; + v5 = polygon->uNumVertices; if ( (signed int)v5 < 3 ) - goto LABEL_20; - v6 = &v4[v5 - 1]; - if ( v4->vWorldPosition.z == v4[1].vWorldPosition.z && v4[1].vWorldPosition.z == v6->vWorldPosition.z ) - *(int *)&a3->flags |= 0x10u; - v19 = v4[1].vWorldViewPosition.x - v4->vWorldViewPosition.x; - v18 = v4[1].vWorldViewPosition.y - v4->vWorldViewPosition.y; - v20 = v4[1].vWorldViewPosition.z - v4->vWorldViewPosition.z; - v21 = v6->vWorldViewPosition.x - v4->vWorldViewPosition.x; - v22 = v6->vWorldViewPosition.y - v4->vWorldViewPosition.y; - v23 = v6->vWorldViewPosition.z - v4->vWorldViewPosition.z; - v28 = v4[1].vWorldPosition.x - v4->vWorldPosition.x; - v27 = v4[1].vWorldPosition.y - v4->vWorldPosition.y; - a3a = v4[1].vWorldPosition.z - v4->vWorldPosition.z; - v7 = v6->vWorldPosition.x - v4->vWorldPosition.x; - v8 = v6->vWorldPosition.y - v4->vWorldPosition.y; - v9 = v6->vWorldPosition.z - v4->vWorldPosition.z; + return false; + v6 = &a2[v5 - 1]; + if ( a2->vWorldPosition.z == a2[1].vWorldPosition.z && a2[1].vWorldPosition.z == v6->vWorldPosition.z ) + *(int *)&polygon->flags |= 0x10u; + v19 = a2[1].vWorldViewPosition.x - a2->vWorldViewPosition.x; + v18 = a2[1].vWorldViewPosition.y - a2->vWorldViewPosition.y; + v20 = a2[1].vWorldViewPosition.z - a2->vWorldViewPosition.z; + v21 = v6->vWorldViewPosition.x - a2->vWorldViewPosition.x; + v22 = v6->vWorldViewPosition.y - a2->vWorldViewPosition.y; + v23 = v6->vWorldViewPosition.z - a2->vWorldViewPosition.z; + v28 = a2[1].vWorldPosition.x - a2->vWorldPosition.x; + v27 = a2[1].vWorldPosition.y - a2->vWorldPosition.y; + a3a = a2[1].vWorldPosition.z - a2->vWorldPosition.z; + v7 = v6->vWorldPosition.x - a2->vWorldPosition.x; + v8 = v6->vWorldPosition.y - a2->vWorldPosition.y; + v9 = v6->vWorldPosition.z - a2->vWorldPosition.z; v26 = v27 * v9 - v8 * a3a; v24 = v7 * a3a - v9 * v28; v25 = v8 * v28 - v7 * v27; @@ -697,9 +644,9 @@ --v5; if ( (signed int)v5 < 2 ) break; - v10 = v6->vWorldPosition.x - v4->vWorldPosition.x; - v11 = v6->vWorldPosition.y - v4->vWorldPosition.y; - v12 = v6->vWorldPosition.z - v4->vWorldPosition.z; + v10 = v6->vWorldPosition.x - a2->vWorldPosition.x; + v11 = v6->vWorldPosition.y - a2->vWorldPosition.y; + v12 = v6->vWorldPosition.z - a2->vWorldPosition.z; v26 = v27 * v12 - v11 * a3a; v24 = v10 * a3a - v12 * v28; v25 = v11 * v28 - v10 * v27; @@ -709,37 +656,33 @@ break; --v6; } - v21 = v6->vWorldViewPosition.x - v4->vWorldViewPosition.x; - v22 = v6->vWorldViewPosition.y - v4->vWorldViewPosition.y; - v23 = v6->vWorldViewPosition.z - v4->vWorldViewPosition.z; + v21 = v6->vWorldViewPosition.x - a2->vWorldViewPosition.x; + v22 = v6->vWorldViewPosition.y - a2->vWorldViewPosition.y; + v23 = v6->vWorldViewPosition.z - a2->vWorldViewPosition.z; } - if ( ((double)pGame->pIndoorCameraD3D->vPartyPos.x - v4->vWorldPosition.x) * v26 - + ((double)pGame->pIndoorCameraD3D->vPartyPos.z - v4->vWorldPosition.z) * v25 - + ((double)pGame->pIndoorCameraD3D->vPartyPos.y - v4->vWorldPosition.y) * v24 > 0.0 ) + if ( ((double)pGame->pIndoorCameraD3D->vPartyPos.x - a2->vWorldPosition.x) * v26 + + ((double)pGame->pIndoorCameraD3D->vPartyPos.z - a2->vWorldPosition.z) * v25 + + ((double)pGame->pIndoorCameraD3D->vPartyPos.y - a2->vWorldPosition.y) * v24 > 0.0 ) { a3b = v23 * v18 - v22 * v20; v14 = a3b + 6.7553994e15; - v3->v_18.x = LODWORD(v14); + polygon->v_18.x = LODWORD(v14); a3c = v21 * v20 - v23 * v19; v15 = a3c + 6.7553994e15; - v3->v_18.y = LODWORD(v15); + polygon->v_18.y = LODWORD(v15); a3d = v22 * v19 - v21 * v18; v16 = a3d + 6.7553994e15; - v3->v_18.z = LODWORD(v16); - v3->_normalize_v_18(); - a3e = -((double)v3->v_18.x * v4->vWorldViewPosition.x) - - (double)v3->v_18.y * v4->vWorldViewPosition.y - - (double)v3->v_18.z * v4->vWorldViewPosition.z; + polygon->v_18.z = LODWORD(v16); + polygon->_normalize_v_18(); + a3e = -((double)polygon->v_18.x * a2->vWorldViewPosition.x) + - (double)polygon->v_18.y * a2->vWorldViewPosition.y + - (double)polygon->v_18.z * a2->vWorldViewPosition.z; v17 = a3e + 6.7553994e15; - v3->field_24 = LODWORD(v17); - result = 1; + polygon->field_24 = LODWORD(v17); + return true; } else - { -LABEL_20: - result = 0; - } - return result; + return false; } //----- (0047C7A9) -------------------------------------------------------- @@ -782,8 +725,7 @@ //----- (0047C80A) -------------------------------------------------------- void OutdoorLocationTerrain::FillDMap( int X, int Y, int W, int Z ) - { - OutdoorLocationTerrain *pOutLocTerrain; // ebx@1 +{ double v6; // st7@1 double v7; // st7@2 double v8; // st7@2 @@ -821,12 +763,11 @@ int v40; // [sp+18h] [bp-30h]@15 int v41; // [sp+1Ch] [bp-2Ch]@15 int v42; // [sp+20h] [bp-28h]@15 - OutdoorLocationTerrain *pOutLocTerrain2; // [sp+24h] [bp-24h]@1 int v44; // [sp+28h] [bp-20h]@21 float v45; // [sp+2Ch] [bp-1Ch]@1 float v46; // [sp+30h] [bp-18h]@1 float v47; // [sp+34h] [bp-14h]@1 - int v48; // [sp+38h] [bp-10h]@7 + //int v48; // [sp+38h] [bp-10h]@7 int v49; // [sp+3Ch] [bp-Ch]@10 int v50; // [sp+40h] [bp-8h]@9 float v51; // [sp+44h] [bp-4h]@15 @@ -839,9 +780,7 @@ v46 = -64.0; v47 = -64.0; - pOutLocTerrain = this; v45 = 64.0; - pOutLocTerrain2 = this; v6 = sqrt(12288.0); if ( v6 != 0.0 ) { @@ -865,39 +804,37 @@ W ^= X ^ W; v11 = W ^ v12; } - v13 = result - 1; - v48 = result - 1; + //v48 = result - 1; if ( result - 1 <= Z ) { v39 = v11 - 1; - do + for ( v13 = result - 1; v13 <= Z; v13++ ) { - v14 = v39; v50 = v39; if ( v39 <= W ) { result = (v39 - 63) << 9; v49 = (v39 - 63) << 9; - do + for ( v14 = v39; v14 <= W; v14++ ) { if ( v13 >= 0 && result >= -32256 && v13 <= 127 && result <= 32768 ) { - v15 = pOutLocTerrain->field_10; - v55 = v15; - pMapHeight = pOutLocTerrain->pHeightmap; - v17 = (int)(&pMapHeight[v13 * v15] + v14); + //v15 = pOutLocTerrain->field_10; + //v55 = pOutLocTerrain->field_10; + pMapHeight = this->pHeightmap; + v17 = (int)(&pMapHeight[v13 * this->field_10] + v14); v18 = -v13; v19 = (64 - v13) << 9; v20 = 32 * *(char *)v17; v21 = 32 * *(char *)(v17 + 1); + v22 = (v18 + 63) << 9; v41 = v22; - v23 = (int)(&pMapHeight[v55 * (v48 + 1)] + v50); + v23 = (int)(&pMapHeight[this->field_10 * (v13 + 1)] + v14); v24 = v22 - v19; v40 = 32 * *(char *)v23; v42 = 32 * *(char *)(v23 + 1); - v25 = v49 - 512 - v49; v26 = (double)-((v20 - v21) * v24); v51 = v26; @@ -918,9 +855,9 @@ v31 = 0.0; if ( v31 > 31.0 ) v31 = 31.0; - v44 = 2 * (v50 + v48 * pOutLocTerrain2->field_10); - pOutLocTerrain = pOutLocTerrain2; - *((char *)pOutLocTerrain2->pDmap + v44 + 1) = (signed __int64)v31; + v44 = 2 * (v14 + v13 * this->field_10); + //pOutLocTerrain = pOutLocTerrain2; + *((char *)this->pDmap + v44 + 1) = (signed __int64)v31; v32 = v49 - (v49 - 512); v33 = (double)-((v42 - v40) * (v19 - v41)); @@ -942,22 +879,21 @@ v38 = 0.0; if ( v38 > 31.0 ) v38 = 31.0; - v13 = v48; - *((char *)pOutLocTerrain2->pDmap + v44) = (signed __int64)v38; - v14 = v50; + //v13 = v48; + *((char *)this->pDmap + v44) = (signed __int64)v38; + //v14 = v50; result = v49; } - ++v14; + //++v14; result += 512; - v50 = v14; + //v50 = v14; v49 = result; } - while ( v14 <= W ); } - ++v13; - v48 = v13; + //++v13; + //v48 = v13; } - while ( v13 <= Z ); + //while ( v13 <= Z ); } } @@ -3440,40 +3376,18 @@ pOMAP = 0; } - - - //----- (00481E55) -------------------------------------------------------- void ODM_Project(unsigned int uNumVertices) { - double v1; // st7@2 - double v2; // st6@2 - double v3; // st5@2 - int v4; // eax@2 - unsigned int v5; // edx@2 - double v6; // st4@3 - double v7; // st3@3 - - if ( (signed int)uNumVertices > 0 ) - { - v1 = (double)pODMRenderParams->int_fov_rad; - v2 = (double)pViewport->uScreenCenterX; - v3 = (double)pViewport->uScreenCenterY; - v4 = 0; - v5 = uNumVertices; - do - { - v6 = v1 * array_507D30[v4]._rhw; - v7 = v6 * array_507D30[v4].vWorldViewPosition.y; - memcpy(&array_50AC10[v4], &array_507D30[v4], sizeof(array_50AC10[v4])); - array_50AC10[v4].vWorldViewProjX = v2 - v7; - array_50AC10[v4].vWorldViewProjY = v3 - v6 * array_507D30[v4].vWorldViewPosition.z; - ++v4; - --v5; - } - while ( v5 ); - } -} + for ( uint i = 0; i < uNumVertices; i++ ) + { + memcpy(&array_50AC10[i], &array_507D30[i], sizeof(array_50AC10[i])); + array_50AC10[i].vWorldViewProjX = (double)pViewport->uScreenCenterX + - ((double)pODMRenderParams->int_fov_rad * array_507D30[i]._rhw) * array_507D30[i].vWorldViewPosition.y; + array_50AC10[i].vWorldViewProjY = (double)pViewport->uScreenCenterY + - ((double)pODMRenderParams->int_fov_rad * array_507D30[i]._rhw) * array_507D30[i].vWorldViewPosition.z; + } + } //----- (00485F64) -------------------------------------------------------- void ODMRenderParams::Initialize() { @@ -3506,7 +3420,7 @@ int floor_level; // eax@14 int v6; // esi@45 ODMFace *face; // ecx@45 - signed int v33; // eax@143 + //signed int v33; // eax@143 int v34; // esi@143 int v35; // esi@147 int v36; // eax@155 @@ -3519,6 +3433,7 @@ signed int v44; // edx@184 int v45; // ecx@200 BSPModel *pModel; // eax@203 + bool pModel_; ODMFace *pODMFace; // esi@203 int v48; // eax@203 int v54; // eax@215 @@ -3591,7 +3506,7 @@ party_running_flag = false; party_walking_flag = false; v102 = 0; - pModel = 0; + pModel_ = false; bWaterWalk = false; if (!pParty->FeatherFallActive())// @@ -3720,38 +3635,38 @@ if (bUnderwater || pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1 || pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].sMana > 0 ) + { + extern int max_flight_height; + if ( pParty->vPosition.z < max_flight_height || hovering ) { - extern int max_flight_height; - if ( pParty->vPosition.z < max_flight_height || hovering ) + pZ += 30; + v113 += 30; + pParty->bFlying = true; + if ( pZ > max_flight_height ) { - pZ += 30; - v113 += 30; - pParty->bFlying = true; - if ( pZ > max_flight_height ) - { - pZ = max_flight_height; - v113 = max_flight_height; - } - v1 = 0; - v2 = 0; - fall_speed = 0; - *(float *)&v128 = 0.0; - if ( v102 && pZ < ceiling_height && (signed int)(pParty->uPartyHeight + pZ) >= ceiling_height )// - { - pParty->field_6E0 = 0; - pParty->field_6E4 = 0; - pPartyActionQueue->uNumActions = 0; - pParty->uFlags |= PARTY_FLAGS_1_LANDING; - pParty->vPosition.z = ceiling_height - pParty->uPartyHeight - 31; - pParty->field_6F0 = pZ; - pParty->bFlying = false; - pZ = ceiling_height - pParty->uPartyHeight - 31; - v113 = pParty->field_6F0; - } - pParty->uFallSpeed = 0; - pModel = (BSPModel *)1; + pZ = max_flight_height; + v113 = max_flight_height; } + v1 = 0; + v2 = 0; + fall_speed = 0; + *(float *)&v128 = 0.0; + if ( v102 && pZ < ceiling_height && (signed int)(pParty->uPartyHeight + pZ) >= ceiling_height )// + { + pParty->field_6E0 = 0; + pParty->field_6E4 = 0; + pPartyActionQueue->uNumActions = 0; + pParty->uFlags |= PARTY_FLAGS_1_LANDING; + pParty->vPosition.z = ceiling_height - pParty->uPartyHeight - 31; + pParty->field_6F0 = pZ; + pParty->bFlying = false; + pZ = ceiling_height - pParty->uPartyHeight - 31; + v113 = pParty->field_6F0; + } + pParty->uFallSpeed = 0; + pModel_ = true; } + } } break; @@ -3768,7 +3683,7 @@ pParty->uFallSpeed = 0; fall_speed = 0; pParty->bFlying = true; - pModel = (BSPModel *)1; + pModel_ = true; if ( pZ <= v111 ) { pParty->bFlying = false; @@ -4009,31 +3924,27 @@ pParty->sRotationY = _angle_y; pParty->sRotationX = _angle_x; - if ( pZ < v111 || pParty->bFlying) + //------------------------------------------- + if ( pParty->bFlying ) { - if ( pParty->bFlying ) - { - //v126 = stru_5C6E00->Cos(GetTickCount()); - v129 = fixpoint_mul(4, cosf(GetTickCount())); - v129 = (unsigned __int64)(4i64 * stru_5C6E00->Cos(GetTickCount())) >> 16; - pZ = v113 + v129; - if ( pModel ) - pZ = v113; - if (pParty->FlyActive()) - stru_5E4C90_MapPersistVars._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] &= 0xFE; - pParty->uFallStartY = pZ; - } - else - { - if ( is_on_water && fall_speed ) - sub_42F960_create_object(pX, pY, v111); - fall_speed = 0; - pZ = v111; - pParty->uFallStartY = v111; - v113 = pZ; - if (pParty->FlyActive()) - stru_5E4C90_MapPersistVars._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] |= 1; - } + v129 = fixpoint_mul(4, stru_5C6E00->Cos(GetTickCount())); + pZ = v113 + v129; + if ( pModel_ ) + pZ = v113; // + if (pParty->FlyActive()) + stru_5E4C90_MapPersistVars._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] &= 0xFE; + pParty->uFallStartY = pZ; + } + else if ( pZ < v111 )// + { + if ( is_on_water && fall_speed ) + sub_42F960_create_object(pX, pY, v111); + fall_speed = 0; + pZ = v111; + pParty->uFallStartY = v111; + v113 = pZ; + if (pParty->FlyActive()) + stru_5E4C90_MapPersistVars._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] |= 1; } else { @@ -4041,12 +3952,12 @@ if (pParty->FlyActive()) stru_5E4C90_MapPersistVars._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] |= 1; } - + //------------------------------------------ if (hovering && !pParty->bFlying)// { - v33 = -(pEventTimer->uTimeElapsed * GetGravityStrength()); - v34 = fall_speed + 2 * v33; - fall_speed += 2 * v33; + //v33 = -(pEventTimer->uTimeElapsed * GetGravityStrength()); + v34 = fall_speed + 2 * -(pEventTimer->uTimeElapsed * GetGravityStrength()); + fall_speed += 2 * -(pEventTimer->uTimeElapsed * GetGravityStrength()); } else if (!partyAtHighSlope) v34 = fall_speed; @@ -4054,36 +3965,38 @@ { if ( !bmodel_standing_on_pid ) { - // rolling down the hill - // how it's done: you get a little bit pushed in the air along terrain normal, getting in the air - // and falling to the gravity, gradually sliding downwards. nice trick - pZ = v111; - ODM_GetTerrainNormalAt(pX, pY, &v98); - v35 = fall_speed + (8 * -(pEventTimer->uTimeElapsed * GetGravityStrength())); - v129 = abs(v2 * v98.x + v1 * v98.y + v35 * v98.z) >> 16; - v2 += fixpoint_mul(v129, (int)v98.x); - v1 += fixpoint_mul(v129, (int)v98.y); - v34 = v35 + fixpoint_mul(v129, (int)v98.z); - v128 = v1; - fall_speed = v34; + // rolling down the hill + // how it's done: you get a little bit pushed in the air along terrain normal, getting in the air + // and falling to the gravity, gradually sliding downwards. nice trick + pZ = v111; + ODM_GetTerrainNormalAt(pX, pY, &v98); + v35 = fall_speed + (8 * -(pEventTimer->uTimeElapsed * GetGravityStrength())); + v129 = abs(v2 * v98.x + v1 * v98.y + v35 * v98.z) >> 16; + v2 += fixpoint_mul(v129, v98.x); + v1 += fixpoint_mul(v129, v98.y); + v34 = v35 + fixpoint_mul(v129, v98.z); + v128 = v1; + fall_speed = v34; } } else v34 = fall_speed; - if ( hovering ) + if ( hovering )// { - if ( !bUnderwater && v34 <= 0) - { - if ( v34 < -500 && !pParty->bFlying && pParty->vPosition.z - v111 > 1000 && !pParty->FeatherFallActive()) - { // falling scream - for (int i = 0; i < 4; ++i) - { - if (!pParty->pPlayers[i].HasEnchantedItemEquipped(72) && !pParty->pPlayers[i].WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, EQUIP_BOOTS) && pParty->pPlayers[i].CanAct()) - pParty->pPlayers[i].PlaySound(SPEECH_Falling_scream, 0);// - } - } - } + if ( !bUnderwater && v34 <= 0) + { + if ( v34 < -500 && !pParty->bFlying && pParty->vPosition.z - v111 > 1000 && !pParty->FeatherFallActive()) + { // falling scream + for (int i = 0; i < 4; ++i) + { + if (!pParty->pPlayers[i].HasEnchantedItemEquipped(72) + && !pParty->pPlayers[i].WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, EQUIP_BOOTS) + && pParty->pPlayers[i].CanAct()) + pParty->pPlayers[i].PlaySound(SPEECH_Falling_scream, 0);// + } + } + } } else pParty->uFallStartY = pZ; @@ -4093,7 +4006,7 @@ *(float *)&v128 = 0.0; v2 = 0; } -//--------------------------------------------------------------------- +//--()------------------------------------------------------------------- stru_721530.field_84 = -1; stru_721530.field_70 = 0; stru_721530.prolly_normal_d = pParty->field_14_radius; @@ -4137,14 +4050,14 @@ { _angle_x = pX + fixpoint_mul(stru_721530.field_7C, stru_721530.direction.x); _angle_y = pY + fixpoint_mul(stru_721530.field_7C, stru_721530.direction.y); - pModel = (BSPModel *)fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z); + //pModel = (BSPModel *)fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z); v40 = fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z) + pZ; } v122 = v40; ODM_GetFloorLevel(_angle_x, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &bmodel_standing_on_pid, 0); v129 = ODM_GetFloorLevel(_angle_x, pY, v40, pParty->uPartyHeight, &is_on_water, &v97, 0); int v119 = ODM_GetFloorLevel(pX, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &v110, 0); - pModel = (BSPModel *)IsTerrainSlopeTooHigh(_angle_x, pY); + bool v42_ = (BSPModel *)IsTerrainSlopeTooHigh(_angle_x, pY); v42 = IsTerrainSlopeTooHigh(pX, _angle_y); is_not_on_bmodel = false; //v118 = v42; @@ -4160,7 +4073,7 @@ } else { - if ( pModel && v129 > pZ ) + if ( v42_ && v129 > pZ ) v44 = 0; if ( v42 && v119 > pZ ) v43 = 0; @@ -4174,8 +4087,8 @@ pY = _angle_y; else { - pModel = (BSPModel *)ODM_GetFloorLevel(_angle_x, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &bmodel_standing_on_pid, 0); - if ( IsTerrainSlopeTooHigh(_angle_x, _angle_y) && (signed int)pModel <= pZ ) + int new_ = ODM_GetFloorLevel(_angle_x, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &bmodel_standing_on_pid, 0); + if ( IsTerrainSlopeTooHigh(_angle_x, _angle_y) && new_ <= pZ ) { v43 = 1; pX = _angle_x; @@ -4294,10 +4207,10 @@ } } } - v2 = fixpoint_mul(58500, (int)v2); - v128 = fixpoint_mul(58500, (int)v128); - v122 = fixpoint_mul(58500, (int)v122); - fall_speed = fixpoint_mul(58500, (int)fall_speed); + v2 = fixpoint_mul(58500, v2); + v128 = fixpoint_mul(58500, v128); + v122 = fixpoint_mul(58500, v122); + fall_speed = fixpoint_mul(58500, fall_speed); } // /------------------------ @@ -4347,13 +4260,15 @@ int pMap_Y = WorldPosToGridCellZ(pParty->vPosition.y) - 1; unsigned int v114_a = WorldPosToGridCellX(pX); v66 = WorldPosToGridCellZ(pY) - 1; - pModel = (BSPModel *)((~(unsigned int)pOutdoor->ActuallyGetSomeOtherTileInfo(pMap_X, pMap_Y) >> 1) & 1); - v122 = (~(unsigned int)pOutdoor->ActuallyGetSomeOtherTileInfo(v114_a, pMap_Y) >> 1) & 1; + unsigned int v122_a = (~(unsigned int)pOutdoor->ActuallyGetSomeOtherTileInfo(pMap_X, pMap_Y) / 2) & 1; + v122 = (~(unsigned int)pOutdoor->ActuallyGetSomeOtherTileInfo(v114_a, pMap_Y) / 2) & 1; + v69 = (~(unsigned int)pOutdoor->ActuallyGetSomeOtherTileInfo(pMap_X, v66) / 2) & 1; + + //-( )--------------------------------------- v68 = 0; - v69 = (~(unsigned int)pOutdoor->ActuallyGetSomeOtherTileInfo(pMap_X, v66) >> 1) & 1; if ( v114_a == pMap_X && v66 == pMap_Y && v122 && v69 ) v68 = 1; - if ( !is_not_on_bmodel ) + if ( !is_not_on_bmodel ) // bmodel, v68 = 1; if ( v68 ) { @@ -4362,12 +4277,13 @@ pParty->vPosition.z = pZ; pParty->field_6F0 = v113; pParty->uFallSpeed = fall_speed; - if ( pZ > 8160 ) + if ( pZ > 8160 ) // { pZ = 8160; pParty->uFallStartY = 8160; pParty->vPosition.z = 8160; } + if ( !trigger_id // || (EventProcessor(trigger_id, 0, 1), pParty->vPosition.x == pX) @@ -4382,14 +4298,11 @@ if ( pParty->uFallStartY - pZ > 512 && !bFeatherFall && pZ <= on_ground && !bUnderwater )//Fall to the ground( ) { if ( pParty->uFlags & PARTY_FLAGS_1_LANDING ) - { pParty->uFlags &= ~PARTY_FLAGS_1_LANDING; - } else { for ( uint i = 1; i <= 4; ++i ) { - //v110 = pPlayers[i]->GetMaxHealth(); pPlayers[i]->ReceiveDamage((signed int)((pParty->uFallStartY - pZ) * (unsigned __int64)(signed __int64)((double)pPlayers[i]->GetMaxHealth() * 0.1)) / 256, DMGT_PHISYCAL); v110 = 20 - pPlayers[i]->GetParameterBonus(pPlayers[i]->GetActualEndurance()); @@ -4412,19 +4325,20 @@ } return; } +//----------------------------------------------------------------- //v76 = pParty->bFlying; - if ( pParty->bFlying || !high_fall_flag || bWaterWalk || !pModel ) + if ( pParty->bFlying || !high_fall_flag || bWaterWalk || !v122_a ) v77 = 1; else v77 = v122 != 0; bool party_drowning_flag = false; - if ( !pParty->bFlying && high_fall_flag && !bWaterWalk ) + if ( !pParty->bFlying && high_fall_flag && !bWaterWalk ) // , , { - if ( pModel ) + if ( v122_a ) v78 = v69 != 0; else { - party_drowning_flag = true; + party_drowning_flag = true;// v78 = true; } } @@ -4444,7 +4358,7 @@ //v79 = 20 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uOverlayID + 6180178; //*(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uOverlayID + 119] |= 1u; v79 = (int)&stru_5E4C90_MapPersistVars._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uOverlayID + 119]; - *(short *)v79 |= 1u; + *(short *)v79 |= 1; if ( !v122 || !v69 ) { if ( !pParty->bFlying ) @@ -4465,7 +4379,7 @@ //v81 = pZ; //v82 = pZ; pParty->vPosition.z = pZ; - if ( pZ > 8160 ) + if ( pZ > 8160 )// { //v82 = 8160; pParty->uFallStartY = 8160; @@ -4474,7 +4388,7 @@ LOWORD(pParty->uFlags) &= 0xFDFBu; pParty->uFallSpeed = fall_speed; pParty->field_6F0 = v113; - if ( party_drowning_flag ) + if ( party_drowning_flag )// { pTerrainHeight = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v110, 1); if ( pParty->vPosition.z <= pTerrainHeight + 1 )// +1 @@ -4495,9 +4409,7 @@ if ( pParty->uFallStartY - pZ > 512 && !bFeatherFall && pZ <= on_ground && !bUnderwater )//Fall to the water( ) { if ( pParty->uFlags & PARTY_FLAGS_1_LANDING ) - { pParty->uFlags &= ~PARTY_FLAGS_1_LANDING; - } else { for ( uint i = 1; i <= 4; ++i )
--- a/Outdoor.h Mon Jan 20 09:22:09 2014 +0600 +++ b/Outdoor.h Mon Jan 20 09:22:16 2014 +0600 @@ -82,7 +82,7 @@ bool HasEventHint(); - static bool IsBackfaceCulled(struct ODMFace *a1, struct RenderVertexSoft *a2, struct Polygon *a3); + static bool IsBackfaceCulled(struct RenderVertexSoft *a2, struct Polygon *polygon); inline bool Invisible() const {return (uAttributes & FACE_INVISIBLE) != 0;} inline bool Visible() const {return !Invisible();}
--- a/Render.cpp Mon Jan 20 09:22:09 2014 +0600 +++ b/Render.cpp Mon Jan 20 09:22:16 2014 +0600 @@ -8874,7 +8874,7 @@ array_77EC08[pODMRenderParams->uNumPolygons].dimming_level = 31; if ( pODMRenderParams->uNumPolygons >= 1999 + 5000) return; - if ( ODMFace::IsBackfaceCulled(&pOutdoor->pBModels[model_id].pFaces[face_id], array_73D150, &array_77EC08[pODMRenderParams->uNumPolygons]) ) + if ( ODMFace::IsBackfaceCulled(array_73D150, &array_77EC08[pODMRenderParams->uNumPolygons]) ) { pOutdoor->pBModels[model_id].pFaces[face_id].bVisible = 1; array_77EC08[pODMRenderParams->uNumPolygons].uBModelFaceID = face_id;
--- a/UI/Books/UIMapBook.cpp Mon Jan 20 09:22:09 2014 +0600 +++ b/UI/Books/UIMapBook.cpp Mon Jan 20 09:22:16 2014 +0600 @@ -433,12 +433,12 @@ v20 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y - pCenterY; v95 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX; - v88 = (unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16; - v87 = (unsigned __int64)((signed int)screenHeight * (signed __int64)viewparams->uMapBookMapZoom) >> 16; - v93 = (unsigned __int16 *)((unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16); - screenHeight = (unsigned __int64)(v20 * (signed __int64)viewparams->uMapBookMapZoom) >> 16; + v88 = fixpoint_mul((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom); + v87 = fixpoint_mul(screenHeight, viewparams->uMapBookMapZoom); + v93 = (unsigned __int16 *)(fixpoint_mul((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom)); + screenHeight = fixpoint_mul(v20, viewparams->uMapBookMapZoom); pRenderer->RasterLine2D(screenCenter_X + v88, screenCenterY - v87, - screenCenter_X + ((unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16), screenCenterY - screenHeight, black); + screenCenter_X + (fixpoint_mul((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom)), screenCenterY - screenHeight, black); } } } @@ -452,32 +452,32 @@ v28 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[j]].uVertex1ID].y - pCenterY; v29 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[j]].uVertex2ID].y - pCenterY; - v87 = (unsigned __int64)((signed int)v27 * (signed __int64)viewparams->uMapBookMapZoom) >> 16; - v88 = (unsigned __int64)(v28 * (signed __int64)viewparams->uMapBookMapZoom) >> 16; - uint i = (unsigned __int64)((v26 - pCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16; - v95 = (unsigned __int64)(v29 * (signed __int64)viewparams->uMapBookMapZoom) >> 16; - pRenderer->RasterLine2D(screenCenter_X + ((unsigned __int64)((signed int)v27 * (signed __int64)viewparams->uMapBookMapZoom) >> 16), - screenCenterY - v88, screenCenter_X + ((unsigned __int64)((v26 - pCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16), screenCenterY - v95, teal); + v87 = fixpoint_mul((signed int)v27, viewparams->uMapBookMapZoom); + v88 = fixpoint_mul(v28, viewparams->uMapBookMapZoom); + uint i = fixpoint_mul((v26 - pCenterX), viewparams->uMapBookMapZoom); + v95 = fixpoint_mul(v29, viewparams->uMapBookMapZoom); + pRenderer->RasterLine2D(screenCenter_X + (fixpoint_mul((signed int)v27, viewparams->uMapBookMapZoom)), + screenCenterY - v88, screenCenter_X + (fixpoint_mul((v26 - pCenterX), viewparams->uMapBookMapZoom)), screenCenterY - v95, teal); } viewparams->sViewCenterX = pCenterX; } } - v47 = ((unsigned __int64)((pParty->vPosition.x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X - 3; - v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - pCenterY) * (signed __int64)viewparams->uMapBookMapZoom) >> 16); + v47 = (fixpoint_mul((pParty->vPosition.x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom)) + screenCenter_X - 3; + v97 = (const void *)(fixpoint_mul((pParty->vPosition.y - pCenterY), viewparams->uMapBookMapZoom)); v48 = 1; v49 = screenCenterY - (int)v97 - 3; if ( v47 >= (signed int)tl_x ) { if ( v47 > (signed int)br_x ) { - if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X - 6) > (signed int)br_x ) + if ( (signed int)((fixpoint_mul((pParty->vPosition.x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom)) + screenCenter_X - 6) > (signed int)br_x ) v48 = 0; v47 = br_x; } } else { - if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X) < (signed int)tl_x ) + if ( (signed int)((fixpoint_mul((pParty->vPosition.x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom)) + screenCenter_X) < (signed int)tl_x ) v48 = 0; v47 = tl_x; } @@ -525,8 +525,8 @@ { screenHeight = pLevelDecorations[i].vPosition.y - pCenterY; v93 = (unsigned __int16 *)(pLevelDecorations[i].vPosition.x - viewparams->sViewCenterX); - v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X; - v97 = (const void *)((unsigned __int64)(screenHeight * (signed __int64)viewparams->uMapBookMapZoom) >> 16); + v54 = (fixpoint_mul((signed int)v93, viewparams->uMapBookMapZoom)) + screenCenter_X; + v97 = (const void *)(fixpoint_mul(screenHeight, viewparams->uMapBookMapZoom)); v55 = screenCenterY - (int)v97; //if ( v54 >= pRenderer->raster_clip_x && v54 <= pRenderer->raster_clip_z // && v55 >= pRenderer->raster_clip_y && v55 <= pRenderer->raster_clip_w ) @@ -539,7 +539,7 @@ } else pRenderer->RasterLine2D(v54, screenCenterY - (int)v97, - ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X, + (fixpoint_mul((signed int)v93, viewparams->uMapBookMapZoom)) + screenCenter_X, screenCenterY - (int)v97, Color16(0xFFu, 0xFFu, 0xFFu)); } }
--- a/UI/UiGame.cpp Mon Jan 20 09:22:09 2014 +0600 +++ b/UI/UiGame.cpp Mon Jan 20 09:22:16 2014 +0600 @@ -1956,55 +1956,64 @@ BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[i]; BLVFace* pFace1 = pIndoor->pFaces + pOutline->uFace1ID; BLVFace* pFace2 = pIndoor->pFaces + pOutline->uFace2ID; - //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes; - //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes; if (pFace1->Visible() && pFace2->Visible()) { if ( pOutline->uFlags & 1 ) - goto LABEL_15; + { + if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && + (pFace1->Clickable() || pFace2->Clickable()) && + (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) + { + if (uNumBlueFacesInBLVMinimap < 49) + pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; + } + else + { + pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); + pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); + pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); + pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); + v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; + if ( v15 > 100 ) + v15 = 100; + pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]); + } + continue; + } if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80) - goto LABEL_ABC; - } - continue; - -LABEL_ABC: - pOutline->uFlags = pOutline->uFlags | 1; - pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); - -LABEL_15: - //v12 = &pIndoor->pFaces[pOutline->uFace1ID]; - if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && - (pFace1->Clickable() || pFace2->Clickable()) && - (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) - { - if (uNumBlueFacesInBLVMinimap < 49) - pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; - } - else - { - long long _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x); - uint _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16); - int _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16); - pX = uCenterX + fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x) << 16) - uZoom, pParty->vPosition.x); - pY = uCenterY - fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y) << 16) - uZoom, pParty->vPosition.y); - pZ = uCenterX + fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x) << 16) - uZoom, pParty->vPosition.x); - pW = uCenterY - fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y) << 16) - uZoom, pParty->vPosition.y); - v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; - if ( v15 > 100 ) - v15 = 100; - //if ( i == 1000 )//pY < 0 && pW > 16 ) - //__debugbreak(); - pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]); + { + pOutline->uFlags = pOutline->uFlags | 1; + pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); + if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && + (pFace1->Clickable() || pFace2->Clickable()) && + (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) + { + if (uNumBlueFacesInBLVMinimap < 49) + pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; + } + else + { + pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); + pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); + pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); + pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); + v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; + if ( v15 > 100 ) + v15 = 100; + pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]); + } + continue; + } } } for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) { BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; - pX = uCenterX + fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].x) << 16) - uZoom, pParty->vPosition.x); - pY = uCenterY - fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].y) << 16) - uZoom, pParty->vPosition.y); - pZ = uCenterX + fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].x) << 16) - uZoom, pParty->vPosition.x); - pW = uCenterY - fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].y) << 16) - uZoom, pParty->vPosition.y); + pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); + pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); + pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); + pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); pRenderer->RasterLine2D(pX, pY, pZ, pW, ui_game_minimap_outline_color); } }
--- a/_deleted.cpp Mon Jan 20 09:22:09 2014 +0600 +++ b/_deleted.cpp Mon Jan 20 09:22:16 2014 +0600 @@ -1489,7 +1489,7 @@ return result; ++pODMRenderParams->uNumPolygons; ++pODMRenderParams->field_44; - if ( !ODMFace::IsBackfaceCulled(v3, array_73D150, v12) ) + if ( !ODMFace::IsBackfaceCulled(array_73D150, v12) ) { LABEL_71: --pODMRenderParams->uNumPolygons;
--- a/mm7_2.cpp Mon Jan 20 09:22:09 2014 +0600 +++ b/mm7_2.cpp Mon Jan 20 09:22:16 2014 +0600 @@ -594,11 +594,7 @@ } gold_transaction_amount = v26 * v13; for ( i = 0; i < v14; ++i ) - { - //monster_y = pMonsterArenaPlacements[i].y; - //v21 = rand(); - Actor::_4BBF61_summon_actor(monster_ids[rand() % num_monsters], pMonsterArenaPlacements[i].x, pMonsterArenaPlacements[i].y, 1); - } + Actor::Arena_summon_actor(monster_ids[rand() % num_monsters], pMonsterArenaPlacements[i].x, pMonsterArenaPlacements[i].y, 1); pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0); }
--- a/mm7_data.cpp Mon Jan 20 09:22:09 2014 +0600 +++ b/mm7_data.cpp Mon Jan 20 09:22:16 2014 +0600 @@ -725,11 +725,11 @@ std::array<Vec2_int_, 20> pMonsterArenaPlacements = {{ - Vec2_int_(0x5F4, 0x208C), - Vec2_int_(0x88A, 0x228C), - Vec2_int_(0xC93, 0x247B), - Vec2_int_(0x1194, 0x247B), - Vec2_int_(0x14CB, 0x232C), + Vec2_int_(1524, 8332), + Vec2_int_(2186, 8844), + Vec2_int_(3219, 9339), + Vec2_int_(4500, 9339), + Vec2_int_(5323, 9004), Vec2_int_(0x177D, 0x2098), Vec2_int_(0x50B, 0x1E15), Vec2_int_(0x18FF, 0x1E15),