-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCircleBorder_S.cpp
More file actions
82 lines (62 loc) · 2.94 KB
/
CircleBorder_S.cpp
File metadata and controls
82 lines (62 loc) · 2.94 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
The MIT License (MIT)
Copyright (c) 2024 sigma-axis
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <cstdint>
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include "multi_thread.hpp"
#include "Border.hpp"
#include "Rounding.hpp"
#include "Outline.hpp"
////////////////////////////////
// 変数アドレス初期化.
////////////////////////////////
void ExEdit092::init_pointers(AviUtl::FilterPlugin* efp)
{
fp = efp;
auto pick_addr = [exedit_base = reinterpret_cast<int32_t>(efp->dll_hinst), this]
<class T>(T& target, ptrdiff_t offset) { target = reinterpret_cast<T>(exedit_base + offset); };
auto pick_val = [exedit_base = reinterpret_cast<int32_t>(efp->dll_hinst), this]
<class T>(T& target, ptrdiff_t offset) { target = *reinterpret_cast<T*>(exedit_base + offset); };
pick_addr(hwnd_setting_dlg, 0x1539c8);
pick_addr(editp, 0x1a532c);
pick_addr(memory_ptr, 0x1a5328);
pick_val (yca_max_w, 0x196748);
pick_val (yca_max_h, 0x1920e0);
pick_addr(update_any_exdata, 0x04a7e0);
pick_addr(nextundo, 0x08d150);
// make ready the multi-thread function feature.
constexpr ptrdiff_t ofs_num_threads_address = 0x086384;
auto aviutl_base = reinterpret_cast<uintptr_t>(fp->hinst_parent);
multi_thread.init(fp->exfunc->exec_multi_thread_func,
reinterpret_cast<int32_t*>(aviutl_base + ofs_num_threads_address));
}
////////////////////////////////
// DLL 初期化.
////////////////////////////////
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID lpvReserved)
{
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
::DisableThreadLibraryCalls(hinst);
break;
}
return TRUE;
}
////////////////////////////////
// エントリポイント.
////////////////////////////////
EXTERN_C __declspec(dllexport) ExEdit::Filter* const* __stdcall GetFilterTableList() {
constexpr static ExEdit::Filter* filter_list[] = {
&Filter::Border::filter,
&Filter::Rounding::filter,
&Filter::Outline::filter,
nullptr,
};
return filter_list;
}