Skip to content

Commit 8dc958d

Browse files
committed
破壊的変更
1 parent 56454bc commit 8dc958d

24 files changed

+490
-407
lines changed

@Curve Editor.tra

Lines changed: 25 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@�W��
2-
--param:320896157
1+
@�x�W�F�EID
2+
--param:0
33
local modname="curve_editor"
44
if not package.loaded[modname] then
55
package.preload[modname]=package.loadlib(modname .. ".auf","luaopen_" .. modname)
@@ -11,39 +11,18 @@ local idx,ratio=math.modf(gpt"index")
1111
local st=gpt(idx)
1212
local ed=gpt(idx+1)
1313
local par=gpt"param"
14-
return curve_editor.get_result(0,par,ratio,st,ed)
15-
16-
17-
@�W��(���ԓ_����)
18-
--twopoint
19-
--param:320896157
20-
local modname="curve_editor"
21-
if not package.loaded[modname] then
22-
package.preload[modname]=package.loadlib(modname .. ".auf","luaopen_" .. modname)
23-
require(modname)
24-
package.preload[modname]=nil
25-
end
26-
local gpt=obj.getpoint
27-
local par=gpt"param"
28-
return curve_editor.get_result(0,par,gpt"totalindex",gpt(0),gpt(1))
29-
30-
31-
@�����x�W�F
32-
--param:0
33-
local modname="curve_editor"
34-
if not package.loaded[modname] then
35-
package.preload[modname]=package.loadlib(modname .. ".auf","luaopen_" .. modname)
36-
require(modname)
37-
package.preload[modname]=nil
14+
--�x�W�F
15+
if (-2147483647 <= par and par <= -12368443) or (12368443 <= par and par <= 2147483646) then
16+
return curve_editor.getresult(0,par,ratio,st,ed)
17+
--�x�W�F(����)
18+
elseif 1 <= par and par <= 1024 then
19+
return curve_editor.getresult(1,par,ratio,st,ed)
20+
else
21+
return gpt"default"
3822
end
39-
local gpt=obj.getpoint
40-
local idx,ratio=math.modf(gpt"index")
41-
local st=gpt(idx)
42-
local ed=gpt(idx+1)
43-
return curve_editor.get_result(1,gpt"param",ratio,st,ed)
4423

4524

46-
@�����x�W�F(���ԓ_����)
25+
@�x�W�F�EID(���ԓ_����)
4726
--twopoint
4827
--param:0
4928
local modname="curve_editor"
@@ -53,10 +32,19 @@ if not package.loaded[modname] then
5332
package.preload[modname]=nil
5433
end
5534
local gpt=obj.getpoint
56-
return curve_editor.get_result(1,gpt"param",gpt"totalindex",gpt(0),gpt(1))
35+
local par=gpt"param"
36+
--�x�W�F
37+
if (-2147483647 <= par and par <= -12368443) or (12368443 <= par and par <= 2147483646) then
38+
return curve_editor.getresult(0,par,gpt"totalindex",gpt(0),gpt(1))
39+
--�x�W�F(����)
40+
elseif 1 <= par and par <= 1024 then
41+
return curve_editor.getresult(1,par,gpt"totalindex",gpt(0),gpt(1))
42+
else
43+
return gpt"default"
44+
end
5745

5846

59-
@�U�
47+
@���̑
6048
--param:40000000
6149
local modname="curve_editor"
6250
if not package.loaded[modname] then
@@ -69,10 +57,10 @@ local idx,ratio=math.modf(gpt"index")
6957
local st=gpt(idx)
7058
local ed=gpt(idx+1)
7159
local par=gpt"param"
72-
return curve_editor.get_result(2,par,ratio,st,ed)
60+
return curve_editor.getresult(2,par,ratio,st,ed)
7361

7462

75-
@�U��(���ԓ_����)
63+
@���̑�(���ԓ_����)
7664
--twopoint
7765
--param:40000000
7866
local modname="curve_editor"
@@ -83,38 +71,4 @@ if not package.loaded[modname] then
8371
end
8472
local gpt=obj.getpoint
8573
local par=gpt"param"
86-
return curve_editor.get_result(2,par,gpt"totalindex",gpt(0),gpt(1))
87-
88-
89-
@�o�E���X
90-
--param:700
91-
local idx,ratio = math.modf(obj.getpoint("index"))
92-
local S = obj.getpoint(idx)
93-
local E = obj.getpoint(idx+1)
94-
local A = S - E
95-
local e = obj.getpoint("param")/1000
96-
local T = (2-2*e)/(1+e)
97-
local function func1(t)
98-
return math.floor(math.log((e-1)*t+1)/math.log(e))
99-
end
100-
local function func2(t)
101-
return t+0.5+1/(e-1)-(e+1)*e^func1(t+0.5)/(2*e-2)
102-
end
103-
return E-A*(4*(func2(ratio/T))^2-e^(2*func1(ratio/T+0.5)))
104-
105-
106-
@�o�E���X(���ԓ_����)
107-
--twopoint
108-
--param:700
109-
return obj.getpoint"default"
110-
111-
112-
@���l�w��
113-
--param:0
114-
return obj.getpoint"default"
115-
116-
117-
@���l�w��(���ԓ_����)
118-
--twopoint
119-
--param:0
120-
return obj.getpoint"default"
74+
return curve_editor.getresult(2,par,gpt"totalindex",gpt(0),gpt(1))

curve_editor/curve_editor.rc

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ BEGIN
6666
CONTROL "�l�������ŃR�s�[(�W���E�U���E�o�E���X���[�h�ŗL��)",IDC_AUTOCOPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,194,182,10
6767
LTEXT "�J�[�u�̐F",IDC_STATIC,15,41,34,8
6868
CONTROL "�V�����o�[�W������ʒm",IDC_LATEST_VERSION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,86,89,10
69+
PUSHBUTTON "�ύX",IDC_CURVE_COLOR,196,39,50,14
6970
END
7071

7172
IDD_SAVE DIALOGEX 0, 0, 228, 61
@@ -249,11 +250,10 @@ BEGIN
249250
BEGIN
250251
POPUP "�ҏW���[�h"
251252
BEGIN
252-
MENUITEM "�W��", ID_MENU_MODE_NORMAL
253-
MENUITEM "�����x�W�F", ID_MENU_MODE_MULTIBEZIER
253+
MENUITEM "�x�W�F", ID_MENU_MODE_BEZIER
254+
MENUITEM "�x�W�F(����)", ID_MENU_MODE_MULTIBEZIER
254255
MENUITEM "�U��", ID_MENU_MODE_ELASTIC
255256
MENUITEM "�o�E���X", ID_MENU_MODE_BOUNCE
256-
MENUITEM "���l�w��", ID_MENU_MODE_VALUE
257257
END
258258
MENUITEM SEPARATOR
259259
MENUITEM "�J�[�u�̐��l���R�s�[\tCtrl+C", ID_MENU_COPY
@@ -300,11 +300,19 @@ IDR_MENU_MODE MENU
300300
BEGIN
301301
POPUP "MODE"
302302
BEGIN
303-
MENUITEM "�W��", ID_MODE_NORMAL
304-
MENUITEM "�����x�W�F", ID_MODE_MULTIBEZIER
303+
MENUITEM "�x�W�F", ID_MODE_BEZIER
304+
MENUITEM "�x�W�F(����)", ID_MODE_MULTIBEZIER
305305
MENUITEM "�U��", ID_MODE_ELASTIC
306306
MENUITEM "�o�E���X", ID_MODE_BOUNCE
307-
MENUITEM "���l�w��", ID_MODE_VALUE
307+
END
308+
END
309+
310+
IDR_MENU_APPLY MENU
311+
BEGIN
312+
POPUP "APPLY"
313+
BEGIN
314+
MENUITEM "�ʏ�", ID_APPLY_NORMAL
315+
MENUITEM "���ԓ_����", ID_APPLY_IGNOREKEY
308316
END
309317
END
310318

curve_editor/curve_editor.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ copy "$(SolutionDir)@Curve Editor.tra" "C:\Users\njotn\UserDirectory\AviUtl_Plug
210210
<ClCompile Include="cve_curve_bounce.cpp" />
211211
<ClCompile Include="cve_curve_elastic.cpp" />
212212
<ClCompile Include="cve_curve_multibezier.cpp" />
213-
<ClCompile Include="cve_curve_normal.cpp">
213+
<ClCompile Include="cve_curve_bezier.cpp">
214214
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
215215
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
216216
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
@@ -260,7 +260,7 @@ copy "$(SolutionDir)@Curve Editor.tra" "C:\Users\njotn\UserDirectory\AviUtl_Plug
260260
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
261261
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
262262
</ClCompile>
263-
<ClCompile Include="cve_wndproc_header.cpp" />
263+
<ClCompile Include="cve_wndproc_menu.cpp" />
264264
<ClCompile Include="cve_wndproc_main.cpp" />
265265
<ClCompile Include="cve_wndproc_library.cpp" />
266266
</ItemGroup>

curve_editor/curve_editor.vcxproj.filters

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<ClCompile Include="cve_curve.cpp">
5555
<Filter>ソース ファイル</Filter>
5656
</ClCompile>
57-
<ClCompile Include="cve_curve_normal.cpp">
57+
<ClCompile Include="cve_curve_bezier.cpp">
5858
<Filter>ソース ファイル</Filter>
5959
</ClCompile>
6060
<ClCompile Include="cve_curve_multibezier.cpp">
@@ -72,7 +72,7 @@
7272
<ClCompile Include="cve_wndproc_main.cpp">
7373
<Filter>ソース ファイル</Filter>
7474
</ClCompile>
75-
<ClCompile Include="cve_wndproc_header.cpp">
75+
<ClCompile Include="cve_wndproc_menu.cpp">
7676
<Filter>ソース ファイル</Filter>
7777
</ClCompile>
7878
<ClCompile Include="cve_wndproc_library.cpp">

curve_editor/cve_bitmap_buffer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ void cve::Bitmap_Buffer::draw_panel_editor()
335335
// Xが0未満1より大の部分を暗くする
336336
g_render_target->FillRectangle(&rect_left, brush);
337337
g_render_target->FillRectangle(&rect_right, brush);
338-
// 標準モードのとき
339-
if (g_config.edit_mode == cve::Mode_Normal) {
338+
// ベジェモードのとき
339+
if (g_config.edit_mode == cve::Mode_Bezier) {
340340
g_render_target->FillRectangle(&rect_up, brush);
341341
g_render_target->FillRectangle(&rect_down, brush);
342342
}
@@ -345,8 +345,8 @@ void cve::Bitmap_Buffer::draw_panel_editor()
345345

346346
// 編集モード振り分け
347347
switch (g_config.edit_mode) {
348-
// 標準モードのとき
349-
case Mode_Normal:
348+
// ベジェモードのとき
349+
case Mode_Bezier:
350350
if (g_config.trace)
351351
g_curve_normal_previous.draw_curve(this, rect, CVE_DRAW_CURVE_TRACE);
352352

@@ -358,7 +358,7 @@ void cve::Bitmap_Buffer::draw_panel_editor()
358358
if (g_config.trace)
359359
g_curve_mb_previous.draw_curve(this, rect, CVE_DRAW_CURVE_TRACE);
360360

361-
g_curve_mb[g_config.current_id.multibezier].draw_curve(this, rect, CVE_DRAW_CURVE_REGULAR);
361+
g_curve_mb[g_config.current_id.multibezier - 1].draw_curve(this, rect, CVE_DRAW_CURVE_REGULAR);
362362
break;
363363

364364
// 振動モードのとき

curve_editor/cve_class.hpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ namespace cve {
8585
const Float_Point& st,
8686
const Float_Point& ed,
8787
int drawing_mode,
88-
bool draw_point_only
88+
int draw_option
8989
);
9090

9191
public:
@@ -139,9 +139,9 @@ namespace cve {
139139

140140

141141
//---------------------------------------------------------------------
142-
// カーブ(標準)
142+
// カーブ(ベジェ)
143143
//---------------------------------------------------------------------
144-
class Curve_Normal : public Curve_Type_Numeric {
144+
class Curve_Bezier : public Curve_Type_Numeric {
145145
public:
146146
int create_number();
147147
double create_result(int number, double ratio, double st, double ed);
@@ -151,7 +151,7 @@ namespace cve {
151151

152152

153153
//---------------------------------------------------------------------
154-
// カーブ(マルチベジェ)
154+
// カーブ(複数ベジェ)
155155
//---------------------------------------------------------------------
156156
class Curve_Multibezier : public Curve_Type_ID {
157157
public:
@@ -165,20 +165,22 @@ namespace cve {
165165
//---------------------------------------------------------------------
166166
class Curve_Elastic : public Curve_Type_Numeric {
167167
private:
168-
double func_elastic(double st, double ed, double f, double t);
169-
void elastic_maxpoint(double st, double ed, double f, Double_Point* pt);
168+
double func_elastic(double t, double f, double k, double a, double st, double ed);
170169

171170
public:
172171
double freq;
172+
double ampl;
173+
double dec;
174+
bool invert;
173175

174176
Curve_Elastic() { initialize(); }
175177

176178
void initialize();
177179
void pt_in_ctpt(const POINT& pt_client, Point_Address* pt_address);
178-
void move_handle(int pt_graph_y);
180+
void move_handle(const Point_Address pt_address, const POINT& pt_graph);
179181
void draw_curve(Bitmap_Buffer* bitmap_buffer, const RECT& rect_wnd, int drawing_mode);
180182
int create_number();
181-
void read_number(int number);
183+
void read_number(int number, double* f, double* k, double* a);
182184
double create_result(int number, double ratio, double st, double ed);
183185
};
184186

curve_editor/cve_control.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ LRESULT cve::Button_Param::wndproc(HWND hw, UINT msg, WPARAM wparam, LPARAM lpar
394394
::SetTextColor(bitmap_buffer.hdc_memory, g_theme[g_config.theme].bt_tx);
395395

396396
switch (g_config.edit_mode) {
397-
case cve::Mode_Normal:
397+
case cve::Mode_Bezier:
398398
str_param = g_curve_normal.create_parameters();
399399
param = const_cast<LPTSTR>(str_param.c_str());
400400
break;
@@ -482,14 +482,14 @@ LRESULT cve::Button_ID::wndproc(HWND hw, UINT msg, WPARAM wparam, LPARAM lparam)
482482

483483
::SetCursor(LoadCursor(NULL, IDC_SIZEWE));
484484

485-
*current_id = MINMAX_LIMIT(id_buffer + (pt_client.x - pt_lock.x) / coef_move, 0, CVE_CURVE_MAX - 1);
485+
*current_id = MINMAX_LIMIT(id_buffer + (pt_client.x - pt_lock.x) / coef_move, 1, CVE_CURVE_MAX);
486486
switch (g_config.edit_mode) {
487487
case Mode_Multibezier:
488-
g_curve_mb_previous = g_curve_mb[*current_id];
488+
g_curve_mb_previous = g_curve_mb[*current_id - 1];
489489
break;
490490

491491
case Mode_Value:
492-
g_curve_value_previous = g_curve_value[*current_id];
492+
g_curve_value_previous = g_curve_value[*current_id - 1];
493493
break;
494494
}
495495

0 commit comments

Comments
 (0)