@@ -1183,9 +1183,38 @@ an<R> Get(an<T> t) {
1183
1183
}
1184
1184
1185
1185
namespace ProjectionReg {
1186
- using T = Projection;
1187
- an<T> make (){
1188
- return New<T>();
1186
+ typedef Projection T;
1187
+
1188
+ int raw_load (lua_State *L) {
1189
+ C_State C;
1190
+ bool res =false ;
1191
+ an<T> t = LuaType<an<T>>::todata (L,1 );
1192
+ if (lua_isuserdata (L, 2 )) {
1193
+ res = t->Load (LuaType<an<ConfigList>>::todata (L, 2 ));
1194
+ }
1195
+ else if (lua_istable (L, 2 )){
1196
+ auto cl = New<ConfigList>();
1197
+ for ( auto &str : LuaType<vector<string>>::todata (L, 2 , &C)) {
1198
+ cl->Append (New<ConfigValue>(str));
1199
+ }
1200
+ res = t->Load (cl);
1201
+ }
1202
+ else {
1203
+
1204
+ }
1205
+ lua_pushboolean (L, res);
1206
+ return 1 ;
1207
+ }
1208
+
1209
+ int raw_make (lua_State *L) {
1210
+ auto t = New<T>();
1211
+ if ( 1 <= lua_gettop (L)) {
1212
+ LuaType<an<T>>::pushdata (L, t);
1213
+ lua_insert (L, 1 );
1214
+ raw_load (L);
1215
+ }
1216
+ LuaType<an<T>>::pushdata (L, t);
1217
+ return 1 ;
1189
1218
}
1190
1219
1191
1220
int raw_apply (lua_State* L) {
@@ -1200,12 +1229,12 @@ namespace ProjectionReg{
1200
1229
}
1201
1230
1202
1231
static const luaL_Reg funcs[] = {
1203
- {" Projection" ,WRAP (make) },
1232
+ {" Projection" ,raw_make },
1204
1233
{ NULL , NULL },
1205
1234
};
1206
1235
1207
1236
static const luaL_Reg methods[] = {
1208
- {" load" ,WRAPMEM (T::Load) },
1237
+ {" load" , raw_load },
1209
1238
{" apply" , raw_apply},
1210
1239
{ NULL , NULL },
1211
1240
};
0 commit comments