1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 22:13:07 +01:00

Fix strings in Intent

This commit is contained in:
Christian F. Coors
2017-10-07 13:53:06 +02:00
committed by Michael Steenbeek
parent 31e1ad43a8
commit 72b3896fec
4 changed files with 15 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
#include "Intent.h"
#include <utility>
#include "../core/Guard.hpp"
#include "Intent.h"
Intent::Intent(rct_windowclass windowclass)
{
@@ -39,10 +40,10 @@ Intent * Intent::putExtra(uint32 key, sint32 value)
return this;
}
Intent * Intent::putExtra(uint32 key, utf8string value)
Intent * Intent::putExtra(uint32 key, std::string value)
{
IntentData data = {};
data.stringVal = value;
data.stringVal = std::move(value);
data.type = IntentData::DT_STRING;
_Data.insert(std::make_pair(key, data));
@@ -91,7 +92,7 @@ sint32 Intent::GetSIntExtra(uint32 key)
return data.intVal.signedInt;
}
utf8string Intent::GetStringExtra(uint32 key)
std::string Intent::GetStringExtra(uint32 key)
{
if (_Data.count(key) == 0)
{
@@ -121,7 +122,8 @@ extern "C" {
void intent_set_string(Intent *intent, uint32 key, utf8string value)
{
intent->putExtra(key, value);
std::string str { value };
intent->putExtra(key, str);
}
void intent_set_pointer(Intent *intent, uint32 key, void *value)