HPL1: remove std::string from MemoryManager

This commit is contained in:
grisenti 2022-11-23 21:39:45 +01:00 committed by Eugene Sandulenko
parent 13a7b1379a
commit 125de63a68
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
4 changed files with 11 additions and 7 deletions

View File

@ -25,6 +25,8 @@
* This file is part of HPL1 Engine.
*/
#include <string>
#include "hpl1/engine/game/ScriptFuncs.h"
#include "hpl1/engine/game/Game.h"

View File

@ -43,7 +43,7 @@ int cMemoryManager::mlCreationCount = 0;
//-----------------------------------------------------------------------
cAllocatedPointer::cAllocatedPointer(void *apData, const std::string &asFile, int alLine, size_t alMemory) {
cAllocatedPointer::cAllocatedPointer(void *apData, const Common::String &asFile, int alLine, size_t alMemory) {
mpData = apData;
msFile = asFile;
mlLine = alLine;
@ -113,8 +113,8 @@ void cMemoryManager::LogResults() {
tAllocatedPointerMapIt it = m_mapPointers.begin();
for (; it != m_mapPointers.end(); ++it) {
cAllocatedPointer &ap = it->second;
if ((int)ap.msFile.length() > lMax)
lMax = (int)ap.msFile.length();
if ((int)ap.msFile.size() > lMax)
lMax = (int)ap.msFile.size();
}
lMax += 5;
@ -130,7 +130,7 @@ void cMemoryManager::LogResults() {
for (; it != m_mapPointers.end(); ++it) {
cAllocatedPointer &ap = it->second;
Log("| %d\t %s", ap.mpData, ap.msFile.c_str());
for (int i = 0; i < lMax - (int)ap.msFile.length(); ++i)
for (int i = 0; i < lMax - (int)ap.msFile.size(); ++i)
Log(" ");
Log("%d\t\t %d\t\n", ap.mlLine, ap.mlMemory);
}

View File

@ -28,8 +28,8 @@
#ifndef HPL_MEMORY_MANAGER_H
#define HPL_MEMORY_MANAGER_H
#include <string>
#include "hpl1/std/map.h"
#include "common/str.h"
namespace hpl {
@ -37,9 +37,9 @@ namespace hpl {
class cAllocatedPointer {
public:
cAllocatedPointer(void *apData, const std::string &asFile, int alLine, size_t alMemory);
cAllocatedPointer(void *apData, const Common::String &asFile, int alLine, size_t alMemory);
std::string msFile;
Common::String msFile;
int mlLine;
size_t mlMemory;
void *mpData;

View File

@ -25,6 +25,8 @@
* This file is part of Penumbra Overture.
*/
#include <string>
#include "hpl1/penumbra-overture/GameScripts.h"
#include "hpl1/engine/engine.h"