Replaced memory with new.

Cleaned up gdrv, zdrv, render.
This commit is contained in:
oz
2021-10-02 17:45:31 +03:00
parent dc5915b4f8
commit 93de90b680
25 changed files with 220 additions and 439 deletions

View File

@@ -1,6 +1,5 @@
#include "pch.h"
#include "TTextBoxMessage.h"
#include "memory.h"
#include "pb.h"
TTextBoxMessage::TTextBoxMessage(char* text, float time)
@@ -11,7 +10,7 @@ TTextBoxMessage::TTextBoxMessage(char* text, float time)
if (text)
{
const auto textLen = strlen(text) + 1;
Text = memory::allocate(textLen);
Text = new char[textLen];
if (Text)
strncpy(Text, text, textLen);
}
@@ -21,8 +20,7 @@ TTextBoxMessage::TTextBoxMessage(char* text, float time)
TTextBoxMessage::~TTextBoxMessage()
{
if (Text)
memory::free(Text);
delete[] Text;
}
float TTextBoxMessage::TimeLeft() const