Fix build

This commit is contained in:
Ted John 2020-03-07 22:40:45 +00:00
parent 119b24a6ff
commit b7b1920a79
7 changed files with 11 additions and 9 deletions

View File

@ -412,8 +412,8 @@ namespace OpenRCT2::Ui::Windows
const auto numItems = std::min<size_t>(items.size(), DROPDOWN_ITEMS_MAX_SIZE);
for (size_t i = 0; i < numItems; i++)
{
gDropdownItemsFormat[i] = selectedIndex == i ? STR_OPTIONS_DROPDOWN_ITEM_SELECTED
: STR_OPTIONS_DROPDOWN_ITEM;
gDropdownItemsFormat[i] = selectedIndex == (int32_t)i ? STR_OPTIONS_DROPDOWN_ITEM_SELECTED
: STR_OPTIONS_DROPDOWN_ITEM;
set_format_arg_on((uint8_t*)&gDropdownItemsArgs[i], 0, const char*, items[i].c_str());
}
window_dropdown_show_text_custom_width(

View File

@ -93,7 +93,8 @@ public:
{ _loc.ToTileStart(), baseHeight, clearanceHeight }, &map_place_non_scenery_clear_func, { 0b1111, 0 },
GetFlags(), &clearCost, CREATE_CROSSING_MODE_NONE))
{
return MakeResult(GA_ERROR::NO_CLEARANCE, std::get<rct_string_id>(res->ErrorTitle), gGameCommandErrorText, gCommonFormatArgs);
return MakeResult(
GA_ERROR::NO_CLEARANCE, std::get<rct_string_id>(res->ErrorTitle), gGameCommandErrorText, gCommonFormatArgs);
}
if (gMapGroundFlags & ELEMENT_IS_UNDERWATER)
@ -162,7 +163,8 @@ public:
{ _loc.ToTileStart(), baseHeight, clearanceHeight }, &map_place_non_scenery_clear_func, { 0b1111, 0 },
GetFlags() | GAME_COMMAND_FLAG_APPLY, &clearCost, CREATE_CROSSING_MODE_NONE))
{
return MakeResult(GA_ERROR::NO_CLEARANCE, std::get<rct_string_id>(res->ErrorTitle), gGameCommandErrorText, gCommonFormatArgs);
return MakeResult(
GA_ERROR::NO_CLEARANCE, std::get<rct_string_id>(res->ErrorTitle), gGameCommandErrorText, gCommonFormatArgs);
}
money32 price = (((RideTrackCosts[ride->type].track_price * TrackPricing[TRACK_ELEM_MAZE]) >> 16));

View File

@ -30,9 +30,8 @@ HOOK_TYPE OpenRCT2::Scripting::GetHookType(const std::string& name)
return (result != LookupTable.end()) ? result->second : HOOK_TYPE::UNDEFINED;
}
HookEngine::HookEngine(ScriptEngine& scriptEngine, ScriptExecutionInfo& execInfo)
HookEngine::HookEngine(ScriptEngine& scriptEngine)
: _scriptEngine(scriptEngine)
, _execInfo(execInfo)
{
_hookMap.resize(NUM_HOOK_TYPES);
for (size_t i = 0; i < NUM_HOOK_TYPES; i++)

View File

@ -72,12 +72,11 @@ namespace OpenRCT2::Scripting
{
private:
ScriptEngine& _scriptEngine;
ScriptExecutionInfo& _execInfo;
std::vector<HookList> _hookMap;
uint32_t _nextCookie = 1;
public:
HookEngine(ScriptEngine& scriptEngine, ScriptExecutionInfo& execInfo);
HookEngine(ScriptEngine& scriptEngine);
HookEngine(const HookEngine&) = delete;
uint32_t Subscribe(HOOK_TYPE type, std::shared_ptr<Plugin> owner, const DukValue& function);
void Unsubscribe(HOOK_TYPE type, uint32_t cookie);

View File

@ -11,6 +11,7 @@
#ifdef __ENABLE_SCRIPTING__
# include "../Context.h"
# include "../common.h"
# include "../object/ObjectManager.h"
# include "../object/RideObject.h"

View File

@ -11,6 +11,7 @@
#ifdef __ENABLE_SCRIPTING__
# include "../Context.h"
# include "../common.h"
# include "../world/Footpath.h"
# include "../world/Scenery.h"

View File

@ -360,7 +360,7 @@ DukContext::~DukContext()
ScriptEngine::ScriptEngine(InteractiveConsole& console, IPlatformEnvironment& env)
: _console(console)
, _env(env)
, _hookEngine(*this, _execInfo)
, _hookEngine(*this)
{
}