Mercurial > mm7
changeset 2473:98eda972505f
backing out of previous commit for Indoor.cpp
author | zipi |
---|---|
date | Tue, 19 Aug 2014 22:33:23 +0100 |
parents | e42e01ff1526 |
children | 273279353509 |
files | Indoor.cpp |
diffstat | 1 files changed, 65 insertions(+), 76 deletions(-) [+] |
line wrap: on
line diff
--- a/Indoor.cpp Mon Aug 18 18:17:20 2014 +0100 +++ b/Indoor.cpp Tue Aug 19 22:33:23 2014 +0100 @@ -1898,53 +1898,47 @@ _a = true; //v154 = 875; - if (_v244 || (_a || !dlv.uLastRepawnDay)) + if (_v244) + { + memset(v203, 0, 0x36B); + goto LABEL_132; + } + if (_a || !dlv.uLastRepawnDay ) { - if (_v244) - { - memset(v203, 0, 0x36B); - } - else if (_a || !dlv.uLastRepawnDay) - { - memcpy(v203, pData, 0x36B); - } - - free(pRawDLV); - dlv.uLastRepawnDay = a3; - if (_v244) - ++dlv.uNumRespawns; - //v201 = pFilename; - *(int *)pDest = 1; - File = pGames_LOD->FindContainer(pFilename, 0); - fread(&header, 0x10u, 1, File); - uint v155 = header.uCompressedSize; - uint Count = header.uDecompressedSize; - BLVFace* Src = (BLVFace *)malloc(header.uDecompressedSize); - pRawDLV = Src; - if (v155 <= Count) - { - if (v155 == Count) - fread(Src, 1, Count, File); - else - { - void* _uSourceLen = malloc(v155); - fread(_uSourceLen, v155, 1, File); - zlib::MemUnzip(Src, &Count, _uSourceLen, v155); - free(_uSourceLen); - } - } - else - MessageBoxW(nullptr, L"Can't load file!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Polydata.cpp:1195", 0); - pData = ((char *)Src + 40); - //v154 = 875; + memcpy(v203, pData, 0x36B); +LABEL_132: + free(pRawDLV); + dlv.uLastRepawnDay = a3; + if (_v244) + ++dlv.uNumRespawns; + //v201 = pFilename; + *(int *)pDest = 1; + File = pGames_LOD->FindContainer(pFilename, 0); + fread(&header, 0x10u, 1, File); + uint v155 = header.uCompressedSize; + uint Count = header.uDecompressedSize; + BLVFace* Src = (BLVFace *)malloc(header.uDecompressedSize); + pRawDLV = Src; + if ( v155 <= Count ) + { + if ( v155 == Count ) + fread(Src, 1, Count, File); + else + { + void* _uSourceLen = malloc(v155); + fread(_uSourceLen, v155, 1, File); + zlib::MemUnzip(Src, &Count, _uSourceLen, v155); + free(_uSourceLen); + } + } + else + MessageBoxW(nullptr, L"Can't load file!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Polydata.cpp:1195", 0); + pData = ((char *)Src + 40); + //v154 = 875; + goto LABEL_140; } - else - { - *(int *)pDest = 0; - } - - -//LABEL_140: + *(int *)pDest = 0; +LABEL_140: //v202 = (int)".blv"; //v156 = strlen(pFilename); strcpy(&pFilename[strlen(pFilename) - 4], ".blv"); @@ -2381,8 +2375,9 @@ a3->y = 0; a3->z = 0xFFFF0000u; + goto LABEL_12; } - else if ( this->uPolygonType == POLYGON_Floor || this->uPolygonType == POLYGON_Ceiling ) + if ( this->uPolygonType == POLYGON_Floor || this->uPolygonType == POLYGON_Ceiling ) { a2->x = 0x10000u; a2->y = 0; @@ -2392,8 +2387,9 @@ a3->y = 0xFFFF0000u; a3->z = 0; + goto LABEL_12; } - else if ( this->uPolygonType == POLYGON_InBetweenFloorAndWall || this->uPolygonType == POLYGON_InBetweenCeilingAndWall ) + if ( this->uPolygonType == POLYGON_InBetweenFloorAndWall || this->uPolygonType == POLYGON_InBetweenCeilingAndWall ) { if ( abs(this->pFacePlane_old.vNormal.z) < 46441 ) { @@ -2410,20 +2406,19 @@ a3->z = 0xFFFF0000u; a3->x = 0; + goto LABEL_12; } - else - { - a2->x = 0x10000u; - a2->y = 0; - a2->z = 0; - - a3->x = 0; - a3->y = 0xFFFF0000u; - a3->z = 0; - } - + a2->x = 0x10000u; + a2->y = 0; + a2->z = 0; + + a3->x = 0; + a3->y = 0xFFFF0000u; + a3->z = 0; + + goto LABEL_12; } -//LABEL_12: +LABEL_12: if ( this->uAttributes & 0x800000 ) { a2->x = -a2->x; @@ -2526,10 +2521,8 @@ door->uState = BLVDoor::Open; if ( !(door->uAttributes & 6) && door->uNumVertices != 0) pAudioPlayer->PlaySound((SoundID)((int)eDoorSoundID + 1), PID(OBJECT_BLVDoor,i), 0, -1, 0, 0, 0, 0); - //goto LABEL_18; + goto LABEL_18; } - else if (!(door->uAttributes & 6) && door->uNumVertices) - pAudioPlayer->PlaySound(eDoorSoundID, PID(OBJECT_BLVDoor, i), 1, -1, 0, 0, 0, 0); } else { @@ -2540,17 +2533,13 @@ door->uState = BLVDoor::Closed; if ( !(door->uAttributes & 6) && door->uNumVertices != 0) pAudioPlayer->PlaySound((SoundID)((int)eDoorSoundID + 1), PID(OBJECT_BLVDoor,i), 0, -1, 0, 0, 0, 0); - //goto LABEL_18; + goto LABEL_18; } - else - { - v89 = door->uMoveLength - v5; - if (!(door->uAttributes & 6) && door->uNumVertices) - pAudioPlayer->PlaySound(eDoorSoundID, PID(OBJECT_BLVDoor, i), 1, -1, 0, 0, 0, 0); - } + v89 = door->uMoveLength - v5; } - -//LABEL_18: + if ( !(door->uAttributes & 6) && door->uNumVertices) + pAudioPlayer->PlaySound(eDoorSoundID, PID(OBJECT_BLVDoor,i), 1, -1, 0, 0, 0, 0); +LABEL_18: for (uint j = 0; j < door->uNumVertices; ++j) { pIndoor->pVertices[door->pVertexIDs[j]].x = fixpoint_mul(door->vDirection.x, v89) + door->pXOffsets[j]; @@ -2808,7 +2797,7 @@ + pActors[actor_id].vVelocity.y * pActors[actor_id].vVelocity.y + pActors[actor_id].vVelocity.z * pActors[actor_id].vVelocity.z >= 400 ) { - stru_721530.field_84 = -1; + stru_721530.field_84 = -1; stru_721530.field_70 = 0; stru_721530.field_0 = 1; stru_721530.field_8_radius = pActors[actor_id].uActorRadius; @@ -2886,7 +2875,7 @@ pActors[actor_id].vPosition.y = LOWORD(stru_721530.normal2.y); pActors[actor_id].vPosition.z = LOWORD(stru_721530.normal2.z) - LOWORD(stru_721530.prolly_normal_d) - 1; pActors[actor_id].uSectorID = LOWORD(stru_721530.uSectorID); - continue; + goto LABEL_123; } pActors[actor_id].vPosition.x += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.x); pActors[actor_id].vPosition.y += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.y); @@ -3044,12 +3033,12 @@ } else { - if (pParty->bTurnBasedModeOn == 1 && (pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->turn_stage == TE_MOVEMENT)) - continue; + if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->turn_stage == TE_MOVEMENT) ) + goto LABEL_123; if ( !pActors[actor_id].pMonsterInfo.uHostilityType || v56 != v22 ) { Actor::AI_StandOrBored(actor_id, 4, v22, &v52); - continue; + goto LABEL_123; } } }