mirror of https://github.com/OpenRCT2/OpenRCT2.git
commit
e47035d4e9
|
@ -101,7 +101,11 @@ public:
|
|||
~FileScannerBase() override
|
||||
{
|
||||
Memory::Free(_rootPath);
|
||||
Memory::FreeArray(_patterns, _numPatterns);
|
||||
for (size_t i = 0; i < _numPatterns; i++)
|
||||
{
|
||||
Memory::Free(_patterns[i]);
|
||||
}
|
||||
Memory::Free(_patterns);
|
||||
Memory::Free(_currentPath);
|
||||
Memory::Free(_currentFileInfo);
|
||||
}
|
||||
|
@ -311,7 +315,9 @@ protected:
|
|||
DirectoryChild child = CreateChild(path, node);
|
||||
children.push_back(child);
|
||||
}
|
||||
free(namelist[i]);
|
||||
}
|
||||
free(namelist);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,21 @@ utf8 * IStream::ReadString()
|
|||
return resultString;
|
||||
}
|
||||
|
||||
std::string IStream::ReadStdString()
|
||||
{
|
||||
std::vector<utf8> result;
|
||||
|
||||
uint8 ch;
|
||||
while ((ch = ReadValue<uint8>()) != 0)
|
||||
{
|
||||
result.push_back(ch);
|
||||
}
|
||||
result.push_back(0);
|
||||
|
||||
std::string resultString(result.data(), result.data() + result.size());
|
||||
return resultString;
|
||||
}
|
||||
|
||||
void IStream::WriteString(const utf8 * str)
|
||||
{
|
||||
if (str == nullptr)
|
||||
|
|
|
@ -107,6 +107,7 @@ interface IStream
|
|||
}
|
||||
|
||||
utf8 * ReadString();
|
||||
std::string ReadStdString();
|
||||
void WriteString(const utf8 * str);
|
||||
void WriteString(const std::string &string);
|
||||
};
|
||||
|
|
|
@ -284,10 +284,10 @@ private:
|
|||
for (uint32 i = 0; i < header.NumItems; i++)
|
||||
{
|
||||
TrackRepositoryItem item;
|
||||
item.Name = fs.ReadString();
|
||||
item.Path = fs.ReadString();
|
||||
item.Name = fs.ReadStdString();
|
||||
item.Path = fs.ReadStdString();
|
||||
item.RideType = fs.ReadValue<uint8>();
|
||||
item.ObjectEntry = fs.ReadString();
|
||||
item.ObjectEntry = fs.ReadStdString();
|
||||
item.Flags = fs.ReadValue<uint32>();
|
||||
_items.push_back(item);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ static rct_window_event_list window_tooltip_events = {
|
|||
NULL
|
||||
};
|
||||
|
||||
static utf8 _tooltipText[512];
|
||||
static utf8 _tooltipText[sizeof(gCommonStringFormatBuffer)];
|
||||
static sint16 _tooltipNumLines;
|
||||
|
||||
void window_tooltip_reset(int x, int y)
|
||||
|
|
Loading…
Reference in New Issue