From 5c6a48b2ff362a70416a6a00fda7d06e0f276f2d Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Sat, 1 Jul 2023 02:43:29 +0100 Subject: i am in hell --- src/T2DLL/UT2BkgndInfo.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src/T2DLL/UT2BkgndInfo.cpp') diff --git a/src/T2DLL/UT2BkgndInfo.cpp b/src/T2DLL/UT2BkgndInfo.cpp index b62afaf..14e62aa 100644 --- a/src/T2DLL/UT2BkgndInfo.cpp +++ b/src/T2DLL/UT2BkgndInfo.cpp @@ -1,31 +1,32 @@ #include "UT2BkgndInfo.h" /*static*/ BkgndInfo* UT2BkgndInfo::SetupBkgndInfo(const RECT& rect, int z) { - BkgndInfo *bkgndInfo = NULL; + BkgndInfo *bkgndInfoPtr = NULL; + int size; int vRange = (rect.bottom - rect.top) / 2; int hRange = (rect.right - rect.left) / 8; int zRange = z / 2; if (vRange > 0 && hRange > 0) { - int size = sizeof(BkgndInfo) + sizeof(void *) * (vRange - 1); - bkgndInfo = (BkgndInfo *) malloc(size); - memset(bkgndInfo, 0, size); + size = sizeof(BkgndInfo) + sizeof(void *) * (vRange - 1); + bkgndInfoPtr = (BkgndInfo *) malloc(size); + memset(bkgndInfoPtr, 0, size); - bkgndInfo->vRange = vRange; - bkgndInfo->hRange = hRange; - bkgndInfo->zRange = zRange; + bkgndInfoPtr->vRange = vRange; + bkgndInfoPtr->hRange = hRange; + bkgndInfoPtr->zRange = zRange; - for (int i = 0; i < vRange && bkgndInfo; i++) { + for (int i = 0; i < vRange && bkgndInfoPtr; i++) { size = sizeof(unsigned int) * hRange; - bkgndInfo->arrays[i] = (unsigned int *) malloc(size); - memset(bkgndInfo->arrays[i], 0, size); - if (!bkgndInfo->arrays[i]) - DisposeBkgndInfo(bkgndInfo); + bkgndInfoPtr->arrays[i] = (unsigned int *) malloc(size); + memset(bkgndInfoPtr->arrays[i], 0, size); + if (!bkgndInfoPtr->arrays[i]) + DisposeBkgndInfo(bkgndInfoPtr); } } - return bkgndInfo; + return bkgndInfoPtr; } /*static*/ void UT2BkgndInfo::DisposeBkgndInfo(BkgndInfo*& info) { -- cgit v1.2.3