mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-14 07:17:44 +00:00
Replace ScriptInterface::Call* with new ScriptFunction functions
Finishes work started in f3aedf88a6.
This removes the boost-CPP function wrappers entirely, in favour of pure
templated code in FunctionWrapper.h
The Call* functions were already heavily templated, so there is nothing
really new here. I just use tag dispatch to reduce the number of
overloads slightly.
The new functions do not need the script interface, only the script
request.
Differential Revision: https://code.wildfiregames.com/D3912
This was SVN commit r25354.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2020 Wildfire Games.
|
||||
/* Copyright (C) 2021 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/Game.h"
|
||||
#include "ps/Profile.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "simulation2/system/TurnManager.h"
|
||||
|
||||
class CCmpCommandQueue : public ICmpCommandQueue
|
||||
@@ -109,14 +110,14 @@ public:
|
||||
|
||||
for (size_t i = 0; i < localCommands.size(); ++i)
|
||||
{
|
||||
bool ok = scriptInterface.CallFunctionVoid(global, "ProcessCommand", localCommands[i].player, localCommands[i].data);
|
||||
bool ok = ScriptFunction::CallVoid(rq, global, "ProcessCommand", localCommands[i].player, localCommands[i].data);
|
||||
if (!ok)
|
||||
LOGERROR("Failed to call ProcessCommand() global script function");
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < commands.size(); ++i)
|
||||
{
|
||||
bool ok = scriptInterface.CallFunctionVoid(global, "ProcessCommand", commands[i].player, commands[i].data);
|
||||
bool ok = ScriptFunction::CallVoid(rq, global, "ProcessCommand", commands[i].player, commands[i].data);
|
||||
if (!ok)
|
||||
LOGERROR("Failed to call ProcessCommand() global script function");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user