Skip to content

Commit

Permalink
xrGame: Resolve mixed_delegate::bind's ambiguous type for luabind
Browse files Browse the repository at this point in the history
  • Loading branch information
Zegeri authored and eagleivg committed Nov 6, 2018
1 parent 71da06b commit 6efbc51
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 42 deletions.
46 changes: 24 additions & 22 deletions src/xrGame/account_manager_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,40 +30,42 @@ SCRIPT_EXPORT(account_manager, (), {
.def("stop_searching_email", &account_manager::stop_searching_email)];
});

#ifndef LINUX // FIXME!!!
SCRIPT_EXPORT(suggest_nicks_cb, (), {
module(luaState)[class_<gamespy_gp::suggest_nicks_cb>("suggest_nicks_cb")
using namespace gamespy_gp;
module(luaState)[class_<suggest_nicks_cb>("suggest_nicks_cb")
.def(constructor<>())
.def(constructor<gamespy_gp::suggest_nicks_cb::lua_object_type,
gamespy_gp::suggest_nicks_cb::lua_function_type>())
.def("bind", &gamespy_gp::suggest_nicks_cb::bind)
.def("clear", &gamespy_gp::suggest_nicks_cb::clear)];
.def(constructor<suggest_nicks_cb::lua_object_type,
suggest_nicks_cb::lua_function_type>())
.def("bind", (suggest_nicks_cb::lua_bind_type)(&suggest_nicks_cb::bind))
.def("clear", &suggest_nicks_cb::clear)];
});

SCRIPT_EXPORT(account_operation_cb, (), {
module(luaState)[class_<gamespy_gp::account_operation_cb>("account_operation_cb")
using namespace gamespy_gp;
module(luaState)[class_<account_operation_cb>("account_operation_cb")
.def(constructor<>())
.def(constructor<gamespy_gp::account_operation_cb::lua_object_type,
gamespy_gp::account_operation_cb::lua_function_type>())
.def("bind", &gamespy_gp::account_operation_cb::bind)
.def("clear", &gamespy_gp::account_operation_cb::clear)];
.def(constructor<account_operation_cb::lua_object_type,
account_operation_cb::lua_function_type>())
.def("bind", (account_operation_cb::lua_bind_type)(&account_operation_cb::bind))
.def("clear", &account_operation_cb::clear)];
});

SCRIPT_EXPORT(account_profiles_cb, (), {
module(luaState)[class_<gamespy_gp::account_profiles_cb>("account_profiles_cb")
using namespace gamespy_gp;
module(luaState)[class_<account_profiles_cb>("account_profiles_cb")
.def(constructor<>())
.def(constructor<gamespy_gp::account_profiles_cb::lua_object_type,
gamespy_gp::account_profiles_cb::lua_function_type>())
.def("bind", &gamespy_gp::account_profiles_cb::bind)
.def("clear", &gamespy_gp::account_profiles_cb::clear)];
.def(constructor<account_profiles_cb::lua_object_type,
account_profiles_cb::lua_function_type>())
.def("bind", (account_profiles_cb::lua_bind_type)(&account_profiles_cb::bind))
.def("clear", &account_profiles_cb::clear)];
});

SCRIPT_EXPORT(found_email_cb, (), {
module(luaState)[class_<gamespy_gp::found_email_cb>("found_email_cb")
using namespace gamespy_gp;
module(luaState)[class_<found_email_cb>("found_email_cb")
.def(constructor<>())
.def(constructor<gamespy_gp::found_email_cb::lua_object_type,
gamespy_gp::found_email_cb::lua_function_type>())
.def("bind", &gamespy_gp::found_email_cb::bind)
.def("clear", &gamespy_gp::found_email_cb::clear)];
.def(constructor<found_email_cb::lua_object_type,
found_email_cb::lua_function_type>())
.def("bind", (found_email_cb::lua_bind_type)(&found_email_cb::bind))
.def("clear", &found_email_cb::clear)];
});
#endif
13 changes: 6 additions & 7 deletions src/xrGame/login_manager_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ SCRIPT_EXPORT(profile, (), {
luaState)[class_<profile>("profile").def("unique_nick", &profile::unique_nick).def("online", &profile::online)];
});

#ifndef LINUX // FIXME!!!
SCRIPT_EXPORT(login_operation_cb, (), {
module(luaState)[class_<gamespy_gp::login_operation_cb>("login_operation_cb")
using namespace gamespy_gp;
module(luaState)[class_<login_operation_cb>("login_operation_cb")
.def(constructor<>())
.def(constructor<gamespy_gp::login_operation_cb::lua_object_type,
gamespy_gp::login_operation_cb::lua_function_type>())
.def("bind", &gamespy_gp::login_operation_cb::bind)
.def("clear", &gamespy_gp::login_operation_cb::clear)];
.def(constructor<login_operation_cb::lua_object_type,
login_operation_cb::lua_function_type>())
.def("bind", (login_operation_cb::lua_bind_type)(&login_operation_cb::bind))
.def("clear", &login_operation_cb::clear)];
});
#endif
2 changes: 2 additions & 0 deletions src/xrGame/mixed_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ class mixed_delegate<R(Param1, Param2), UniqueTag>
typedef R return_type;
typedef Param1 param1_type;
typedef Param2 param2_type;
typedef mixed_delegate<R(Param1, Param2), UniqueTag> self_type;

typedef fastdelegate::FastDelegate<R(Param1, Param2)> fastdelegate_type;
typedef CScriptCallbackEx<R> lua_delegate_type;
typedef luabind::object lua_object_type;
typedef luabind::functor<R> lua_function_type;
using lua_bind_type = void (self_type::*)(lua_object_type, lua_function_type);

mixed_delegate() {}
~mixed_delegate() {}
Expand Down
13 changes: 6 additions & 7 deletions src/xrGame/profile_data_types_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ SCRIPT_EXPORT(profile_data_script_registrator, (), {
.def_readonly("second", &all_best_scores_t::value_type::second)];
});

#ifndef LINUX // FIXME!!!
SCRIPT_EXPORT(store_operation_cb, (), {
module(luaState)[class_<gamespy_profile::store_operation_cb>("store_operation_cb")
using namespace gamespy_profile;
module(luaState)[class_<store_operation_cb>("store_operation_cb")
.def(constructor<>())
.def(constructor<gamespy_profile::store_operation_cb::lua_object_type,
gamespy_profile::store_operation_cb::lua_function_type>())
.def("bind", &gamespy_profile::store_operation_cb::bind)
.def("clear", &gamespy_profile::store_operation_cb::clear)];
.def(constructor<store_operation_cb::lua_object_type,
store_operation_cb::lua_function_type>())
.def("bind", (store_operation_cb::lua_bind_type)(&store_operation_cb::bind))
.def("clear", &store_operation_cb::clear)];
});
#endif
4 changes: 1 addition & 3 deletions src/xrGame/ui/UIListBox_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,13 @@ SCRIPT_EXPORT(SServerFilters, (), {
.def_readwrite("listen_servers", &SServerFilters::listen_servers)];
});

#ifndef LINUX // FIXME!!!
SCRIPT_EXPORT(connect_error_cb, (), {
module(luaState)[class_<connect_error_cb>("connect_error_cb")
.def(constructor<>())
.def(constructor<connect_error_cb::lua_object_type, connect_error_cb::lua_function_type>())
.def("bind", &connect_error_cb::bind)
.def("bind", (connect_error_cb::lua_bind_type)(&connect_error_cb::bind))
.def("clear", &connect_error_cb::clear)];
});
#endif

SCRIPT_EXPORT(CServerList, (CUIWindow), {
module(luaState)[class_<CServerList, CUIWindow>("CServerList")
Expand Down
4 changes: 1 addition & 3 deletions src/xrGame/ui/UIWindow_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,16 @@ SCRIPT_EXPORT(SServerFilters, (), {
];
});

#ifndef LINUX // FIXME!!!
SCRIPT_EXPORT(connect_error_cb, (), {
module(luaState)
[
class_<connect_error_cb>("connect_error_cb")
.def(constructor<>())
.def(constructor<connect_error_cb::lua_object_type, connect_error_cb::lua_function_type>())
.def("bind", &connect_error_cb::bind)
.def("bind", (connect_error_cb::lua_bind_type)(&connect_error_cb::bind))
.def("clear", &connect_error_cb::clear)
];
});
#endif

SCRIPT_EXPORT(CServerList, (CUIWindow), {
module(luaState)
Expand Down

0 comments on commit 6efbc51

Please sign in to comment.