mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 09:06:54 +02:00
Further work on support for cheats
Cheats can now be enabled/disabled and games can be launched with cheats
This commit is contained in:
@@ -65,7 +65,7 @@ template <>
|
||||
class Task<void> : public TaskBase
|
||||
{
|
||||
protected:
|
||||
virtual TaskResult<void> ExecuteFunc() const = 0;
|
||||
virtual TaskResult<void> ExecuteFunc() = 0;
|
||||
|
||||
private:
|
||||
TaskState ExecuteDirect() override
|
||||
@@ -79,11 +79,11 @@ template <class T, typename FuncType>
|
||||
class FuncTask : public Task<T>
|
||||
{
|
||||
public:
|
||||
FuncTask(const FuncType& function)
|
||||
: _function(function) { }
|
||||
FuncTask(FuncType&& function)
|
||||
: _function(std::move(function)) { }
|
||||
|
||||
private:
|
||||
const FuncType _function;
|
||||
FuncType _function;
|
||||
|
||||
TaskResult<T> ExecuteFunc() const override { return _function((const volatile u8&)this->_cancelRequested); }
|
||||
TaskResult<T> ExecuteFunc() override { return _function((const volatile u8&)this->_cancelRequested); }
|
||||
};
|
||||
|
||||
@@ -79,12 +79,12 @@ public:
|
||||
|
||||
template <typename FuncType>
|
||||
[[gnu::noinline]]
|
||||
auto Enqueue(const FuncType& function) -> QueueTask<decltype(TaskResultToResultType(function(*new vu8())))>
|
||||
auto Enqueue(FuncType&& function) -> QueueTask<decltype(TaskResultToResultType(function(*new vu8())))>
|
||||
{
|
||||
using TaskType = FuncTask<decltype(TaskResultToResultType(function(*new vu8()))), FuncType>;
|
||||
// static_assert(sizeof(TaskType) <= MaxTaskSize, "Task is too big for this pool");
|
||||
void* slot = GetSlot();
|
||||
auto task = new (slot) TaskType(function);
|
||||
auto task = new (slot) TaskType(std::move(function));
|
||||
Enqueue(task);
|
||||
return QueueTask(task, this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user