plugin.cpp 528 B

1234567891011121314151617181920
  1. #include "common/boxed_type.h"
  2. #include <cr.h>
  3. #include <entt/locator/locator.hpp>
  4. #include "userdata.h"
  5. CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
  6. switch(operation) {
  7. case CR_LOAD:
  8. entt::locator<test::boxed_int>::reset(static_cast<userdata *>(ctx->userdata)->handle);
  9. break;
  10. case CR_STEP:
  11. entt::locator<test::boxed_int>::value().value = static_cast<userdata *>(ctx->userdata)->value;
  12. break;
  13. case CR_UNLOAD:
  14. case CR_CLOSE:
  15. break;
  16. }
  17. return 0;
  18. }