-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmembercallback.h
More file actions
29 lines (24 loc) · 798 Bytes
/
membercallback.h
File metadata and controls
29 lines (24 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// NintyFont - Nintendo binary font editor
// Copyleft TheDzeraora 2021
// This software is provided under
// the GNU General Public License v3
// See license.txt in the root of the
// source tree for full license conditions
// Quick and dirty callback handler
#pragma once
namespace NintyFont
{
typedef void (CallbackFunction)(void *, void *); //Argument one is this pointer, the second is the optional arument( struct)
struct MemberCallback
{
CallbackFunction *method;
void *object;
void *args;
};
inline void doMemberCallback(MemberCallback *callback)
{
if (callback == nullptr) return;
if (callback->method == nullptr || callback->object == nullptr) return;
callback->method(callback->object, callback->args);
}
}