marmalade.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <HTML>
  2. <HEAD>
  3. <TITLE>Marmalade Support</TITLE>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. </HEAD>
  6. <link href="RaknetManual.css" rel="stylesheet" type="text/css">
  7. <meta name="title" content="RakNet - Advanced multiplayer game networking API">
  8. </HEAD>
  9. <BODY BGCOLOR="#ffffff" LINK="#003399" vlink="#003399" alink="#003399" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0"">
  10. <span style="background-color: rgb(255, 255, 255);"><img src="RakNet_Icon_Final-copy.jpg" alt="Oculus VR, Inc." width="150" height="150"></span><BR>
  11. <BR>
  12. <table width="100%" border="0"><tr>
  13. <td bgcolor="#2c5d92">
  14. <img src="spacer.gif" width="8" height="1"><span class="RakNetWhiteHeader">Marmalade support</span></td>
  15. </tr></table>
  16. <TABLE BORDER="0" CELLPADDING="10" CELLSPACING="0" WIDTH="100%"><TR>
  17. <TD>
  18. <span class="RakNetBlueHeader">How to integrate with the Marmalade SDK
  19. </span>
  20. <p><a href="http://www.madewithmarmalade.com/">Marmalade</a> is a SDK that enables you to write games for the IOS and Android using Native C++. It is not a game engine, although it includes graphic libraries and other tools. As Marmalade can compile Native C++, it can compile RakNet and therefore enable you to use RakNet on those platforms in a consistent way.</p>
  21. <p><strong>Step 1 - Download Marmalde:</strong></p>
  22. <p><a href="http://www.madewithmarmalade.com/downloads">Download</a> and install Marmalade Beta 5.1 or later. This requires registration and other steps with Marmalade.</p>
  23. <p><strong>Step 2 - Create RakNet solution:</strong></p>
  24. <p>Assuming you have RakNet downloaded, go to DependentExtensions\Marmalade and double click RakNet.mkb. If Marmalade is installed correctly, this will create a directory build_raknet_vc9 or similar. If necessary to add or remote RakNet source files, edit in a text editor the .mkb and .mkf files where the RakNet source files are listed and double click the .mkb again.</p>
  25. <p><strong>Step 3 - Build RakNet library:</strong></p>
  26. <p>Find the .sln solution file in the directory created in step 2. Open it, and build for all platforms you care about. Build / batch build / select all / build will do this as well. Assuming this worked, you will now have object files created in a directory such as DependentExtensions\Marmalade\build_raknet_vc9\Debug_RakNet_vc9_x86</p>
  27. <p><strong>Step 4 - Link RakNet to your application:</strong></p>
  28. <p>Add these two lines to your application .mkb file</p>
  29. <p>option module_path=&quot;../../DependentExtensions/Marmalade&quot;<br>
  30. subproject RakNet</p>
  31. <p>The path under option module_path should modified to point to wherever you installed RakNet. There is an example of this under Samples\Marmalade . After doing so you will need to double click the .mkb file to regenerate your project solution.</p>
  32. <p>If, upon building RakNet, you get a build error &quot;unresolved external symbol _strtoull ...&quot; then you need to either update Marmalade to a newer version, or comment out the last strtoull in RakNetGUID::FromString in RakNetTypes.h, then build step 3 again.</p>
  33. <p><strong>Step 5 - Fix allocator:</strong></p>
  34. The Marmalade bucket system is not threadsafe. Be sure you have this code in main()
  35. <pre>
  36. #include "RakMemoryOverride.h"
  37. void* MarmaladeMalloc(size_t size)
  38. {
  39. return s3eMallocBase(size);
  40. }
  41. void* MarmaladeRealloc(void *p, size_t size)
  42. {
  43. return s3eReallocBase(p, size);
  44. }
  45. void MarmaladeFree(void *p)
  46. {
  47. s3eFreeBase(p);
  48. }
  49. SetMalloc(MarmaladeMalloc);
  50. SetRealloc(MarmaladeRealloc);
  51. SetFree(MarmaladeFree);
  52. </pre>
  53. </TD>
  54. </TR></TABLE>
  55. <table width="100%" border="0"><tr><td bgcolor="#2c5d92">
  56. <img src="spacer.gif" width="8" height="1"><span class="RakNetWhiteHeader">See Also</span></td>
  57. </tr></table>
  58. <TABLE BORDER="0" CELLPADDING="10" CELLSPACING="0" WIDTH="100%"><TR><TD>
  59. <p><A HREF="index.html">Index</A></p>
  60. </TD>
  61. </TR></TABLE>
  62. </BODY>
  63. </HTML>
粤ICP备19079148号