@@ -3434,13 +3434,13 @@ void drawDisplaysMemoryUsageMenu()
3434
3434
3435
3435
// Draw each option for displaying memory usage about each heap
3436
3436
bool *DisplayHeapInfo = HeapInfo.DisplayHeapInfo ;
3437
- int32_t TotalHeaps = getTotalHeaps () - 1 ; // Remove the smart heap from the total
3437
+ int32_t NumHeaps = HeapInfo. ArrayCount - 1 ; // Remove the smart heap from the total
3438
3438
3439
3439
int32_t tempCurrentMenuOption = static_cast <int32_t >(MenuVar.CurrentMenuOption );
3440
3440
char *tempDisplayBuffer = DisplayBuffer;
3441
3441
const char *String;
3442
3442
3443
- for (int32_t i = 0 ; i < TotalHeaps ; i++)
3443
+ for (int32_t i = 0 ; i < NumHeaps ; i++)
3444
3444
{
3445
3445
// Draw each heap number
3446
3446
sprintf (tempDisplayBuffer,
@@ -3458,12 +3458,12 @@ void drawDisplaysMemoryUsageMenu()
3458
3458
}
3459
3459
3460
3460
// Draw the smart heap text
3461
- bool CurrentOptionCheck = tempCurrentMenuOption == TotalHeaps ;
3461
+ bool CurrentOptionCheck = tempCurrentMenuOption == NumHeaps ;
3462
3462
Color = getSelectedTextColor (CurrentOptionCheck);
3463
3463
drawText (" Smart Heap" , PosX, PosY, Alpha, Color, Scale);
3464
3464
3465
3465
// Draw the bool for the smart heap
3466
- getOnOffTextAndColor (DisplayHeapInfo[TotalHeaps ], &String, &Color);
3466
+ getOnOffTextAndColor (DisplayHeapInfo[NumHeaps ], &String, &Color);
3467
3467
drawText (String, PosX + 120 , PosY, Alpha, Color, Scale);
3468
3468
}
3469
3469
@@ -4795,10 +4795,10 @@ void drawMemoryUsage()
4795
4795
PosY -= 20 ;
4796
4796
}
4797
4797
4798
- char ** tempMemoryUsageBuffer = HeapInfo.MemoryUsageBuffer ;
4798
+ char *tempMemoryUsageBuffer = HeapInfo.MemoryUsageBuffer ;
4799
4799
bool *DisplayHeapInfo = HeapInfo.DisplayHeapInfo ;
4800
4800
4801
- int32_t NumHeaps = getTotalHeaps () - 1 ; // Remove the smart heap from the total
4801
+ int32_t NumHeaps = HeapInfo. ArrayCount - 1 ; // Remove the smart heap from the total
4802
4802
uint32_t MemoryUsageCounter = 0 ;
4803
4803
4804
4804
// Draw the text for the main heaps
@@ -4808,15 +4808,17 @@ void drawMemoryUsage()
4808
4808
if (DisplayHeapInfo[i])
4809
4809
{
4810
4810
// Draw the used and free text
4811
- if (tempMemoryUsageBuffer[MemoryUsageCounter][0 ] != ' \0 ' )
4811
+ uint32_t MemoryUsageBufferIndex = MemoryUsageCounter * MEMORY_USAGE_LINE_BUFFER_SIZE;
4812
+ if (tempMemoryUsageBuffer[MemoryUsageBufferIndex] != ' \0 ' )
4812
4813
{
4813
- drawText (tempMemoryUsageBuffer[MemoryUsageCounter ], PosX, PosY, Alpha, Color, Scale);
4814
+ drawText (& tempMemoryUsageBuffer[MemoryUsageBufferIndex ], PosX, PosY, Alpha, Color, Scale);
4814
4815
PosY -= 20 ;
4815
4816
}
4816
4817
4817
- if (tempMemoryUsageBuffer[MemoryUsageCounter + 1 ][0 ] != ' \0 ' )
4818
+ MemoryUsageBufferIndex += MEMORY_USAGE_LINE_BUFFER_SIZE;
4819
+ if (tempMemoryUsageBuffer[MemoryUsageBufferIndex] != ' \0 ' )
4818
4820
{
4819
- drawText (tempMemoryUsageBuffer[MemoryUsageCounter + 1 ], PosX, PosY, Alpha, Color, Scale);
4821
+ drawText (& tempMemoryUsageBuffer[MemoryUsageBufferIndex ], PosX, PosY, Alpha, Color, Scale);
4820
4822
PosY -= 20 ;
4821
4823
}
4822
4824
}
@@ -4827,14 +4829,15 @@ void drawMemoryUsage()
4827
4829
if (DisplayHeapInfo[NumHeaps])
4828
4830
{
4829
4831
// Draw the used text
4830
- if (tempMemoryUsageBuffer[MemoryUsageCounter][ 0 ] != ' \0 ' )
4832
+ if (tempMemoryUsageBuffer[MemoryUsageCounter] != ' \0 ' )
4831
4833
{
4832
- drawText (tempMemoryUsageBuffer[MemoryUsageCounter], PosX, PosY, Alpha, Color, Scale);
4834
+ uint32_t MemoryUsageBufferIndex = MemoryUsageCounter * MEMORY_USAGE_LINE_BUFFER_SIZE;
4835
+ drawText (&tempMemoryUsageBuffer[MemoryUsageBufferIndex], PosX, PosY, Alpha, Color, Scale);
4833
4836
}
4834
4837
}
4835
4838
4836
4839
// Clear each of the memory usage buffers
4837
- clearMemoryUsageBuffers ();
4840
+ clearMemoryUsageBuffer ();
4838
4841
}
4839
4842
4840
4843
void drawNpcNameToPtrError ()
0 commit comments