# HG changeset patch # User Nomad # Date 1378840620 -7200 # Node ID 8094f1706b1f8b6335e219a3c5d5eec790a65bc5 # Parent e42073046f924557a1843c1e5bd109176ea82a2b operator new() -> malloc diff -r e42073046f92 -r 8094f1706b1f LOD.cpp --- a/LOD.cpp Tue Sep 10 21:08:43 2013 +0200 +++ b/LOD.cpp Tue Sep 10 21:17:00 2013 +0200 @@ -2151,10 +2151,10 @@ v5->pLevelOfDetail0_prolly_alpha_mask = 0; if ( v6 ) { - v7 = operator new(v6); + v7 = malloc(v6); v8 = v5->uTextureSize; v5->pLevelOfDetail0_prolly_alpha_mask = (unsigned __int8 *)v7; - pContainer = (const char *)operator new(v8); + pContainer = (const char *)malloc(v8); fread((void *)pContainer, 1u, (size_t)pDst, File); zlib::MemUnzip(v5->pLevelOfDetail0_prolly_alpha_mask, &v5->uDecompressedSize, pContainer, v5->uTextureSize); v9 = (void *)pContainer; @@ -2163,7 +2163,7 @@ } else { - v10 = (unsigned __int8 *)operator new(0); + v10 = (unsigned __int8 *)malloc(0); v11 = File; v5->pLevelOfDetail0_prolly_alpha_mask = v10; fread(v10, 1u, (size_t)pDst, v11); @@ -2171,7 +2171,7 @@ v5->pPalette24 = 0; if ( uTextureType == 1 ) { - v12 = operator new(0x300u); + v12 = malloc(0x300u); v13 = File; v5->pPalette24 = (unsigned __int8 *)v12; fread(v12, 1u, 0x300u, v13); @@ -2183,7 +2183,7 @@ goto LABEL_10; v18 = 0; v5->pPalette16 = 0; - v5->pPalette16 = (unsigned __int16 *)operator new(0x400u); + v5->pPalette16 = (unsigned __int16 *)malloc(0x400u); do { fread((char *)&pContainer + 3, 1u, 1u, File); @@ -2343,7 +2343,7 @@ else { v4 = strlen(v3 - 2); - v5 = (char *)operator new(v4 + 2); + v5 = (char *)malloc(v4 + 2); *v5 = 'h'; strcpy(v5 + 1, v3 - 2); pRenderer->LoadTexture( @@ -2610,7 +2610,7 @@ else { v11 = strlen(pContainer); - v12 = (enum TEXTURE_TYPE)(int)operator new(v11 + 2); + v12 = (enum TEXTURE_TYPE)(int)malloc(v11 + 2); eTextureType = v12; *(char *)v12 = 104; strcpy((char *)(v12 + 1), pContainer); diff -r e42073046f92 -r 8094f1706b1f Mouse.cpp --- a/Mouse.cpp Tue Sep 10 21:08:43 2013 +0200 +++ b/Mouse.cpp Tue Sep 10 21:17:00 2013 +0200 @@ -414,7 +414,7 @@ { if ( this->pCursorBitmap3_sysmembits_16bit ) free(this->pCursorBitmap3_sysmembits_16bit); - this->pCursorBitmap3_sysmembits_16bit = (unsigned __int16 *)operator new(2 * pTexture->uTextureHeight * pTexture->uTextureWidth); + this->pCursorBitmap3_sysmembits_16bit = (unsigned __int16 *)malloc(2 * pTexture->uTextureHeight * pTexture->uTextureWidth); this->field_40 = a2; this->field_48 = a2 + pTextureWidth; this->field_44 = v6; diff -r e42073046f92 -r 8094f1706b1f Render.cpp --- a/Render.cpp Tue Sep 10 21:08:43 2013 +0200 +++ b/Render.cpp Tue Sep 10 21:17:00 2013 +0200 @@ -811,7 +811,7 @@ v10 = strlen(lpDeviceDesc); a6->pInfo[v8].pDescription = new char[v10 + 1]; strcpy(a6->pInfo[v8].pDescription, lpDeviceDesc); - a6->pInfo[v8].pGUID = (GUID *)operator new(0x10u); + a6->pInfo[v8].pGUID = new GUID; memcpy(a6->pInfo[v8].pGUID, lpGUID, 0x10u); v11 = strlen(a6->ptr_4->pDriverName); a6->pInfo[v8].pDriverName = new char[v11 + 1]; @@ -3310,7 +3310,7 @@ { pTargetSurface = 0; ptr_400E8 = 0; - v20 = (int *)operator new(0x96020u); + v20 = (int *)malloc(0x96020u); ptr_400E8 = v20; if ( !v20 || (memset(&pDesc, 0, 0x7Cu), @@ -3384,7 +3384,7 @@ CreateZBuffer(); if ( bUserDirect3D ) { - /*v3 = operator new(0x148u); + /*v3 = malloc(0x148u); thisa = (RenderD3D *)v3; v29 = 0; if ( v3 ) diff -r e42073046f92 -r 8094f1706b1f UI/UIMainMenu.cpp --- a/UI/UIMainMenu.cpp Tue Sep 10 21:08:43 2013 +0200 +++ b/UI/UIMainMenu.cpp Tue Sep 10 21:17:00 2013 +0200 @@ -297,7 +297,7 @@ pTexture2._allocation_flags = 0; pColor1 = TargetColor(0x70u, 0x8Fu, 0xFEu); pColor2 = TargetColor(0xECu, 0xE6u, 0x9Cu); - pString = (char *)operator new(2 * pSize); + pString = (char *)malloc(2 * pSize); strncpy(pString, ptr, pSize); pString[pSize]=0; pFontQuick->_44D2FD_prolly_draw_credits_entry(pFontCChar, 0, a2.uFrameHeight, (signed __int16)pTexture2.uWidth, (signed __int16)pTexture2.uHeight, pColor1,