# HG changeset patch # User Ritor1 # Date 1389007937 -21600 # Node ID feeb7bfcb19e61d7b4f1c3fbd278dba230f319b7 # Parent ca548138d6aa13981b5834c6b4eb47fa66339685 face_attrib for VIS diff -r ca548138d6aa -r feeb7bfcb19e Build/Visual Studio 2010/World of Might and Magic.vcxproj --- a/Build/Visual Studio 2010/World of Might and Magic.vcxproj Thu Jan 02 18:25:42 2014 +0000 +++ b/Build/Visual Studio 2010/World of Might and Magic.vcxproj Mon Jan 06 17:32:17 2014 +0600 @@ -286,6 +286,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -311,6 +377,12 @@ + + + + + + @@ -383,6 +455,14 @@ + + + + + + + + Document @@ -392,6 +472,17 @@ + + + + + + + + + + + diff -r ca548138d6aa -r feeb7bfcb19e Build/Visual Studio 2010/World of Might and Magic.vcxproj.filters --- a/Build/Visual Studio 2010/World of Might and Magic.vcxproj.filters Thu Jan 02 18:25:42 2014 +0000 +++ b/Build/Visual Studio 2010/World of Might and Magic.vcxproj.filters Mon Jan 06 17:32:17 2014 +0600 @@ -286,6 +286,222 @@ + + lib\libavcodec + + + lib\libavcodec + + + lib\libavcodec + + + lib\libavcodec + + + lib\libavcodec + + + lib\libavcodec + + + lib\libavcodec + + + lib\libavcodec + + + lib\libavcodec + + + lib\libavformat + + + lib\libavformat + + + lib\libavformat + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libavutil + + + lib\libswresample + + + lib\libswresample + + + lib\libswscale + + + lib\libswscale + + + lib\OpenAL + + + lib\OpenAL + + + lib\OpenAL + + + lib\OpenAL + + + lib\OpenAL + + + lib\OpenAL + @@ -324,6 +540,33 @@ {cb1041ae-addb-49d8-9ec1-ffe52d29ae64} + + {00ba7ef3-081e-46d7-b651-f41dde1d3ff8} + + + {297ce683-6a2f-4d6b-b4ae-10cc59f75ebc} + + + {22b53a53-f99c-40ac-82fd-647f5012b96a} + + + {1d0988f5-957a-4c5b-b76a-d1f57a7ac8d4} + + + {10d851fd-bca4-46a3-9377-0a3ae5f6e9df} + + + {afaf8737-a450-48fc-91ad-a5f55625d40a} + + + {bfeab783-b0c1-4ad6-937d-e0914f011587} + + + {009e95ff-193d-47cc-9e52-e74b803c7aac} + + + {a28acffc-17d1-41fd-a206-c4c035a4e7b3} + @@ -336,6 +579,30 @@ lib\swig\swigwin-2.0.11 + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + @@ -615,4 +882,33 @@ NewUI\Core + + + lib\OpenAL\lib\OpenAL + + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + + + lib\OpenAL\lib\x86 + + \ No newline at end of file diff -r ca548138d6aa -r feeb7bfcb19e Outdoor.cpp --- a/Outdoor.cpp Thu Jan 02 18:25:42 2014 +0000 +++ b/Outdoor.cpp Mon Jan 06 17:32:17 2014 +0600 @@ -1821,12 +1821,12 @@ for (uint i = 0; i < uNumBModels; ++i) { //v48 = 0; - BSPModel* model = &pBModels[i]; - - model->pVertices.pVertices = nullptr; - model->pFaces = nullptr; - model->pFacesOrdering = nullptr; - model->pNodes = nullptr; + //BSPModel* model = &pBModels[i]; + + pBModels[i].pVertices.pVertices = nullptr; + pBModels[i].pFaces = nullptr; + pBModels[i].pFacesOrdering = nullptr; + pBModels[i].pNodes = nullptr; //FileName[0] = 0; //v108 = (int)&pBModels[i]; //sprintf(FileName, "%s", v108); @@ -1837,35 +1837,35 @@ //v107 = 12 * v50->pVertices.uNumVertices; //v106 = (char *)v50->pVertices.pVertices; assert(sizeof(Vec3_int_) == 12); - uint verticesSize = model->pVertices.uNumVertices * sizeof(Vec3_int_); - model->pVertices.pVertices = (Vec3_int_ *)malloc(verticesSize); - memcpy(model->pVertices.pVertices, pSrc, verticesSize); + uint verticesSize = pBModels[i].pVertices.uNumVertices * sizeof(Vec3_int_); + pBModels[i].pVertices.pVertices = (Vec3_int_ *)malloc(verticesSize); + memcpy(pBModels[i].pVertices.pVertices, pSrc, verticesSize); pSrc += verticesSize; //v51 = &pBModels[v48]; //v108 = (int)FileName; //v107 = 308 * v51->uNumFaces; //v106 = (char *)v51->pFaces; assert(sizeof(ODMFace) == 308); - uint facesSize = model->uNumFaces * sizeof(ODMFace); - model->pFaces = (ODMFace *)malloc(facesSize); - memcpy(model->pFaces, pSrc, facesSize); + uint facesSize = pBModels[i].uNumFaces * sizeof(ODMFace); + pBModels[i].pFaces = (ODMFace *)malloc(facesSize); + memcpy(pBModels[i].pFaces, pSrc, facesSize); pSrc += facesSize; //v52 = &pBModels[v48]; //v108 = (int)FileName; //v107 = 2 * v52->uNumFaces; //v106 = (char *)v52->pFacesOrdering; - uint facesOrderingSize = model->uNumFaces * sizeof(short); - model->pFacesOrdering = (unsigned __int16 *)malloc(facesOrderingSize); - memcpy(model->pFacesOrdering, pSrc, facesOrderingSize); + uint facesOrderingSize = pBModels[i].uNumFaces * sizeof(short); + pBModels[i].pFacesOrdering = (unsigned __int16 *)malloc(facesOrderingSize); + memcpy(pBModels[i].pFacesOrdering, pSrc, facesOrderingSize); pSrc += facesOrderingSize; //v53 = &pBModels[v48]; //v108 = (int)FileName; //v107 = 8 * v53->uNumNodes; //v106 = (char *)v53->pNodes; assert(sizeof(BSPNode) == 8); - uint nodesSize = model->uNumNodes * sizeof(BSPNode); - model->pNodes = (BSPNode *)malloc(nodesSize); - memcpy(model->pNodes, pSrc, nodesSize); + uint nodesSize = pBModels[i].uNumNodes * sizeof(BSPNode); + pBModels[i].pNodes = (BSPNode *)malloc(nodesSize); + memcpy(pBModels[i].pNodes, pSrc, nodesSize); pSrc += nodesSize; //v54 = &pBModels[v48]; //v108 = 12 * v54->pVertices.uNumVertices; @@ -1892,50 +1892,50 @@ //memcpy(v59, uSourceLen, (size_t)pFilename); //uSourceLen = (char *)uSourceLen + (int)pFilename; //ptr = (FILE *)malloc(10 * model->uNumFaces); - const char* textureFilenames = (const char *)malloc(10 * model->uNumFaces); + const char* textureFilenames = (const char *)malloc(10 * pBModels[i].uNumFaces); //pFilename = (char *)(10 * pBModels[v48].uNumFaces); - memcpy((char *)textureFilenames, pSrc, 10 * model->uNumFaces); - pSrc += 10 * model->uNumFaces; + memcpy((char *)textureFilenames, pSrc, 10 * pBModels[i].uNumFaces); + pSrc += 10 * pBModels[i].uNumFaces; //v144 = 0; //uSourceLen = (char *)uSourceLen + (int)pFilename; //v60 = pBModels; - for (uint j = 0; j < model->uNumFaces; ++j) + for (uint j = 0; j < pBModels[i].uNumFaces; ++j) { const char* texFilename = &textureFilenames[j * 10]; //v149 = 0; //Str2 = (char *)ptr; - ODMFace* face = &model->pFaces[j]; + //ODMFace* face = &pBModels[i].pFaces[j]; //pFilename = (char *)v149 + (unsigned int)v60[v48].pFaces; - if (~face->uAttributes & FACE_DONT_CACHE_TEXTURE) + if ( !(pBModels[i].pFaces[j].uAttributes & FACE_DONT_CACHE_TEXTURE)) { v62 = pBitmaps_LOD->LoadTexture(texFilename); // v63 = (ODMFace *)pFilename; goto LABEL_68; } //v61 = pTextureFrameTable->FindTextureByName(texFilename); - face->uTextureID = pTextureFrameTable->FindTextureByName(texFilename); - if (!face->uTextureID) + pBModels[i].pFaces[j].uTextureID = pTextureFrameTable->FindTextureByName(texFilename); + if (!pBModels[i].pFaces[j].uTextureID) { v62 = pBitmaps_LOD->LoadTexture(texFilename); //v63 = (ODMFace *)pFilename; - face->uAttributes &= ~FACE_DONT_CACHE_TEXTURE; + pBModels[i].pFaces[j].uAttributes &= ~FACE_DONT_CACHE_TEXTURE; LABEL_68: - face->uTextureID = v62; + pBModels[i].pFaces[j].uTextureID = v62; //v145 = (signed __int16)v62 != -1 ? &pBitmaps_LOD->pTextures[(signed __int16)v62] : 0; //v108 = ((signed __int16)v62 != -1 ? pBitmaps_LOD->pTextures[(signed __int16)v62].palette_id1 : 36); if ((signed __int16)v62 != -1) pBitmaps_LOD->pTextures[v62].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v62].palette_id1); goto LABEL_69; } - pTextureFrameTable->LoadAnimationSequenceAndPalettes(face->uTextureID); + pTextureFrameTable->LoadAnimationSequenceAndPalettes(pBModels[i].pFaces[j].uTextureID); LABEL_69: - if (face->sCogTriggeredID) + if (pBModels[i].pFaces[j].sCogTriggeredID) { - if (face->HasEventHint()) - face->uAttributes |= 0x1000; + if (pBModels[i].pFaces[j].HasEventHint()) + pBModels[i].pFaces[j].uAttributes |= 0x100000; else - face->uAttributes &= ~0x1000; + pBModels[i].pFaces[j].uAttributes &= ~0x100000; } //++v144; //v60 = pBModels; @@ -1955,7 +1955,7 @@ //LABEL_75: pGameLoadingUI_ProgressBar->Progress(); - memcpy(&uNumLevelDecorations, pSrc, 4u); + memcpy(&uNumLevelDecorations, pSrc, 4); //uSourceLen = (char *)uSourceLen + 4; if (uNumLevelDecorations > 3000) MessageBoxW(nullptr, L"Can't load file!", diff -r ca548138d6aa -r feeb7bfcb19e Vis.cpp --- a/Vis.cpp Thu Jan 02 18:25:42 2014 +0000 +++ b/Vis.cpp Mon Jan 06 17:32:17 2014 +0600 @@ -1482,7 +1482,7 @@ if (filter->object_id != OBJECT_BLVDoor) return true; - if (no_event || face_attrib & filter->no_at_ai_state) + if (no_event || face_attrib & filter->no_at_ai_state)//face_attrib = 0x2009408 incorrect return false; return (face_attrib & filter->at_ai_state) != 0; } @@ -1687,12 +1687,12 @@ BSPModel* bmodel = &pOutdoor->pBModels[i]; for (uint j = 0; j < bmodel->uNumFaces; ++j) { - ODMFace* face = &bmodel->pFaces[j]; + //ODMFace* face = &bmodel->pFaces[j]; - if (is_part_of_selection(face, filter) ) + if (is_part_of_selection(&bmodel->pFaces[j], filter) ) { BLVFace blv_face; - blv_face.FromODM(face); + blv_face.FromODM(&bmodel->pFaces[j]); int pid = PID(OBJECT_BModel, j | (i << 6)); if (Vis_ObjectInfo* object_info = DetermineFacetIntersection(&blv_face, pid, pick_depth))