comparison Outdoor.cpp @ 100:67f843a23f8b

Outdoor::Load
author Nomad
date Sun, 04 Nov 2012 13:58:15 +0200
parents 6305c1cd9f6e
children 8be5293b6b33 ccc0cf95706a fe45d65251a5
comparison
equal deleted inserted replaced
99:6305c1cd9f6e 100:67f843a23f8b
2043 2043
2044 if ( BYTE1(dword_6BE364_game_settings_1) & 0x20 ) 2044 if ( BYTE1(dword_6BE364_game_settings_1) & 0x20 )
2045 pNumItems = 29030400; 2045 pNumItems = 29030400;
2046 if ( Str2 ) 2046 if ( Str2 )
2047 { 2047 {
2048 __debugbreak(); 2048 memset(Dst, 0, 0x3C8u);
2049 //memset(Dst, 0, 0x3C8u); 2049 memset(Src, 0, 0x3C8u);
2050 //memset(Src, 0, 0x3C8u); 2050 goto LABEL_112;
2051 //goto LABEL_112;
2052 } 2051 }
2053 //v81 = ddm.uLastRepawnDay; 2052 //v81 = ddm.uLastRepawnDay;
2054 if ( (unsigned int)((char *)File - ddm.uLastRepawnDay) >= pNumItems || !ddm.uLastRepawnDay ) 2053 if ((unsigned int)((char *)File - ddm.uLastRepawnDay) >= pNumItems || !ddm.uLastRepawnDay)
2055 { 2054 {
2056 __debugbreak();
2057 /*
2058 memcpy(Dst, pSrc, 0x3C8u); 2055 memcpy(Dst, pSrc, 0x3C8u);
2059 memcpy(Src, pSrc + 968, 0x3C8u); 2056 memcpy(Src, pSrc + 968, 0x3C8u);
2060 LABEL_112: 2057 LABEL_112:
2061 free(pSrcMem); 2058 free(pSrcMem);
2062 v25 = Str2 == 0; 2059
2063 ddm.uLastRepawnDay = (int)File; 2060 ddm.uLastRepawnDay = (int)File;
2064 if ( v25 ) 2061 if (Str2 == 0)
2065 ++ddm.uNumRespawns; 2062 ++ddm.uNumRespawns;
2066 v108 = 0; 2063 v108 = 0;
2067 *(int *)thisa = 1; 2064 *(int *)thisa = 1;
2068 v151 = (int)pGames_LOD->FindContainer(pContainer, v108); 2065 v39 = pGames_LOD->FindContainer(Str, 0);
2069 fread(&header, 0x10u, 1u, (FILE *)v151); 2066 fread(&header, 0x10, 1u, v39);
2070 pFilename = (char *)header.uCompressedSize; 2067 //pFilename = (char *)header.uCompressedSize;
2071 pDestLen = header.uDecompressedSize; 2068 //pDestLen = header.uDecompressedSize;
2072 v82 = malloc(header.uDecompressedSize); 2069 //v82 = malloc(header.uDecompressedSize);
2073 v149 = v82; 2070 pSrcMem = (unsigned char *)malloc(header.uDecompressedSize);
2074 if ( (unsigned int)pFilename <= pDestLen ) 2071 //v149 = v82;
2075 { 2072 if (header.uCompressedSize == header.uDecompressedSize)
2076 if ( pFilename == (const char *)pDestLen ) 2073 fread(pSrcMem, header.uDecompressedSize, 1, v39);
2077 { 2074 else if (header.uCompressedSize < header.uDecompressedSize)
2078 fread(v82, pDestLen, 1u, (FILE *)v151); 2075 {
2079 } 2076 auto compressedMem = malloc(header.uCompressedSize);
2080 else 2077 fread(compressedMem, header.uCompressedSize, 1u, v39);
2081 { 2078
2082 uSourceLen = malloc((size_t)pFilename); 2079 uint actualDecompressedSize = header.uDecompressedSize;
2083 fread(uSourceLen, (size_t)pFilename, 1u, (FILE *)v151); 2080 zlib::MemUnzip(pSrcMem, &actualDecompressedSize, compressedMem, header.uCompressedSize);
2084 zlib::MemUnzip(v82, &pDestLen, uSourceLen, (unsigned int)pFilename); 2081 free(compressedMem);
2085 free(uSourceLen);
2086 }
2087 } 2082 }
2088 else 2083 else
2089 { 2084 MessageBoxW(nullptr, L"Can't load file!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Odmap.cpp:857", 0);
2090 MessageBoxW(nullptr, L"Can't load file!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Odmap.cpp:857", 0); 2085
2091 } 2086 pSrc = pSrcMem + 40;
2092 v74 = (int)((char *)v82 + 40);
2093 goto LABEL_120; 2087 goto LABEL_120;
2094 */ 2088
2095 } 2089 }
2096 *(int *)thisa = 0; 2090 *(int *)thisa = 0;
2097 LABEL_120: 2091 LABEL_120:
2098 //v108 = (int)".odm"; 2092 //v108 = (int)".odm";
2099 //v83 = strlen(pContainer); 2093 //v83 = strlen(pContainer);
2106 2100
2107 pGameLoadingUI_ProgressBar->Progress(); 2101 pGameLoadingUI_ProgressBar->Progress();
2108 2102
2109 if ( *(int *)thisa ) 2103 if ( *(int *)thisa )
2110 { 2104 {
2111 __debugbreak();
2112 memcpy(array_528, Dst, 0x3C8u); 2105 memcpy(array_528, Dst, 0x3C8u);
2113 memcpy(array_8F0, Src, 0x3C8u); 2106 memcpy(array_8F0, Src, 0x3C8u);
2114 } 2107 }
2115 2108
2116 //v25 = uNumBModels == 0; 2109 //v25 = uNumBModels == 0;