mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
add prints
This commit is contained in:
parent
393479d2ba
commit
76dc6a55ec
1 changed files with 5 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include "../meta/meta.hpp"
|
||||
|
||||
namespace geode::core {
|
||||
|
@ -9,11 +10,15 @@ namespace geode::core {
|
|||
template <auto& Det, class Ret, class ...Args>
|
||||
Ret handler(Args... args) {
|
||||
static thread_local int counter = 0;
|
||||
std::cout << "detour size: " << Det->size() << std::endl;
|
||||
|
||||
if constexpr (std::is_same_v<Ret, void>) {
|
||||
if (counter == Det->size()) counter = 0;
|
||||
|
||||
std::cout << "detour index: " << counter << std::endl;
|
||||
|
||||
if (counter < Det->size()) {
|
||||
std::cout << "calling " << (void*)Det->at(counter++) << std::endl;
|
||||
Det->at(counter++)(args...);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue