RoomsBrowserGFx3.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (c) 2014, Oculus VR, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. *
  9. */
  10. #include "RoomsBrowserGFx3.h"
  11. RoomsBrowserGFx3::RoomsBrowserGFx3()
  12. {
  13. }
  14. RoomsBrowserGFx3::~RoomsBrowserGFx3()
  15. {
  16. }
  17. void RoomsBrowserGFx3::Init(GPtr<FxDelegate> pDelegate, GPtr<GFxMovieView> pMovie)
  18. {
  19. pDelegate->RegisterHandler(this);
  20. delegate=pDelegate;
  21. movie=pMovie;
  22. }
  23. void RoomsBrowserGFx3::Shutdown(void)
  24. {
  25. if (delegate.GetPtr()!=0)
  26. {
  27. delegate->UnregisterHandler(this);
  28. delegate.Clear();
  29. }
  30. movie.Clear();
  31. }
  32. ACTIONSCRIPT_CALLABLE_FUNCTION(RoomsBrowserGFx3, f2c_QueryPlatform)
  33. {
  34. FxResponseArgs<1> rargs;
  35. rargs.Add(QueryPlatform());
  36. // pparams.Respond(rargs);
  37. FxDelegate::Invoke2(movie, pparams[0].GetString(), rargs);
  38. }
  39. ACTIONSCRIPT_CALLABLE_FUNCTION(RoomsBrowserGFx3, f2c_SaveProperty)
  40. {
  41. SaveProperty(pparams[0].GetString(), pparams[1].GetString());
  42. }
  43. ACTIONSCRIPT_CALLABLE_FUNCTION(RoomsBrowserGFx3, f2c_LoadProperty)
  44. {
  45. RakNet::RakString propertyOut;
  46. LoadProperty(pparams[0].GetString(), propertyOut);
  47. FxResponseArgs<1> rargs;
  48. rargs.Add(propertyOut.C_String());
  49. // pparams.Respond(rargs);
  50. FxDelegate::Invoke2(movie, pparams[1].GetString(), rargs);
  51. }
  52. void RoomsBrowserGFx3::Accept(CallbackProcessor* cbreg)
  53. {
  54. cbreg->Process( "f2c_QueryPlatform", &::f2c_QueryPlatform );
  55. cbreg->Process( "f2c_SaveProperty", &::f2c_SaveProperty );
  56. cbreg->Process( "f2c_LoadProperty", &::f2c_LoadProperty );
  57. }
粤ICP备19079148号