forked from Ancurio/mkxp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplane-binding.cpp
78 lines (62 loc) · 2.26 KB
/
plane-binding.cpp
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
/*
** plane-binding.cpp
**
** This file is part of mkxp.
**
** Copyright (C) 2013 - 2021 Amaryllis Kulla <[email protected]>
**
** mkxp is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 2 of the License, or
** (at your option) any later version.
**
** mkxp is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with mkxp. If not, see <http://www.gnu.org/licenses/>.
*/
#include "plane.h"
#include "disposable-binding.h"
#include "viewportelement-binding.h"
#include "binding-util.h"
#include "binding-types.h"
DEF_TYPE(Plane);
MRB_METHOD(planeInitialize)
{
Plane *p = viewportElementInitialize<Plane>(mrb, self);
setPrivateData(self, p, PlaneType);
p->initDynAttribs();
wrapProperty(mrb, self, &p->getColor(), CScolor, ColorType);
wrapProperty(mrb, self, &p->getTone(), CStone, ToneType);
return self;
}
DEF_PROP_OBJ_REF(Plane, Bitmap, Bitmap, CSbitmap)
DEF_PROP_OBJ_VAL(Plane, Color, Color, CScolor)
DEF_PROP_OBJ_VAL(Plane, Tone, Tone, CStone)
DEF_PROP_I(Plane, OX)
DEF_PROP_I(Plane, OY)
DEF_PROP_I(Plane, Opacity)
DEF_PROP_I(Plane, BlendType)
DEF_PROP_F(Plane, ZoomX)
DEF_PROP_F(Plane, ZoomY)
void
planeBindingInit(mrb_state *mrb)
{
RClass *klass = defineClass(mrb, "Plane");
disposableBindingInit<Plane> (mrb, klass);
viewportElementBindingInit<Plane>(mrb, klass);
mrb_define_method(mrb, klass, "initialize", planeInitialize, MRB_ARGS_OPT(1));
INIT_PROP_BIND( Plane, Bitmap, "bitmap" );
INIT_PROP_BIND( Plane, OX, "ox" );
INIT_PROP_BIND( Plane, OY, "oy" );
INIT_PROP_BIND( Plane, ZoomX, "zoom_x" );
INIT_PROP_BIND( Plane, ZoomY, "zoom_y" );
INIT_PROP_BIND( Plane, Opacity, "opacity" );
INIT_PROP_BIND( Plane, BlendType, "blend_type" );
INIT_PROP_BIND( Plane, Color, "color" );
INIT_PROP_BIND( Plane, Tone, "tone" );
mrb_define_method(mrb, klass, "inspect", inspectObject, MRB_ARGS_NONE());
}