rngine 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (585) hide show
  1. package/README.md +50 -25
  2. package/android/CMakeLists.txt +45 -2
  3. package/android/build.gradle +1 -3
  4. package/android/kls_database.db +0 -0
  5. package/android/src/main/cpp/game-view.cpp +29 -0
  6. package/android/src/main/java/com/margelo/nitro/rngine/GameEngine.kt +1 -28
  7. package/android/src/main/java/com/margelo/nitro/rngine/GameView.kt +22 -166
  8. package/android/src/main/java/com/margelo/nitro/rngine/SvgLoaderHelper.kt +24 -0
  9. package/lib/module/GameMethods.js +44 -0
  10. package/lib/module/GameMethods.js.map +1 -1
  11. package/lib/module/GameMethods.nitro.js.map +1 -1
  12. package/lib/module/index.js +0 -1
  13. package/lib/module/index.js.map +1 -1
  14. package/lib/typescript/src/GameMethods.d.ts +1 -0
  15. package/lib/typescript/src/GameMethods.d.ts.map +1 -1
  16. package/lib/typescript/src/GameMethods.nitro.d.ts +3 -0
  17. package/lib/typescript/src/GameMethods.nitro.d.ts.map +1 -1
  18. package/lib/typescript/src/index.d.ts +0 -1
  19. package/lib/typescript/src/index.d.ts.map +1 -1
  20. package/lib/typescript/src/nativeTypes.d.ts +6 -0
  21. package/lib/typescript/src/nativeTypes.d.ts.map +1 -1
  22. package/nitro.json +0 -10
  23. package/nitrogen/generated/android/rngine+autolinking.cmake +0 -2
  24. package/nitrogen/generated/android/rngineOnLoad.cpp +0 -16
  25. package/nitrogen/generated/ios/Rngine-Swift-Cxx-Bridge.cpp +0 -33
  26. package/nitrogen/generated/ios/Rngine-Swift-Cxx-Bridge.hpp +0 -96
  27. package/nitrogen/generated/ios/Rngine-Swift-Cxx-Umbrella.hpp +0 -9
  28. package/nitrogen/generated/ios/RngineAutolinking.mm +0 -8
  29. package/nitrogen/generated/ios/RngineAutolinking.swift +0 -12
  30. package/nitrogen/generated/shared/c++/Entity.hpp +13 -1
  31. package/nitrogen/generated/shared/c++/EntityUpdate.hpp +13 -1
  32. package/nitrogen/generated/shared/c++/HybridGameMethodsSpec.cpp +3 -0
  33. package/nitrogen/generated/shared/c++/HybridGameMethodsSpec.hpp +4 -0
  34. package/nitrogen/generated/shared/c++/Screen.hpp +14 -2
  35. package/package.json +4 -1
  36. package/shared/CollisionUtils.hpp +1 -6
  37. package/{android/src/main/cpp/ColorUtils.hpp → shared/ColorUtils.cpp} +8 -12
  38. package/shared/ColorUtils.hpp +7 -0
  39. package/shared/GameLoop.cpp +45 -27
  40. package/shared/GameLoop.hpp +1 -11
  41. package/shared/GameMethods.cpp +103 -6
  42. package/shared/GameMethods.hpp +17 -0
  43. package/shared/GameRenderer.cpp +431 -0
  44. package/shared/GameRenderer.hpp +65 -0
  45. package/shared/GameStats.hpp +3 -3
  46. package/shared/Overlap.hpp +9 -0
  47. package/shared/skia/include/android/AHardwareBufferUtils.h +26 -0
  48. package/shared/skia/include/android/GrAHardwareBufferUtils.h +97 -0
  49. package/shared/skia/include/android/SkAndroidFrameworkUtils.h +83 -0
  50. package/shared/skia/include/android/SkAnimatedImage.h +193 -0
  51. package/shared/skia/include/android/SkCanvasAndroid.h +20 -0
  52. package/shared/skia/include/android/SkImageAndroid.h +100 -0
  53. package/shared/skia/include/android/SkSurfaceAndroid.h +50 -0
  54. package/shared/skia/include/android/graphite/SurfaceAndroid.h +59 -0
  55. package/shared/skia/include/android/vk/AndroidVulkanMemoryAllocator.h +31 -0
  56. package/shared/skia/include/codec/SkAndroidCodec.h +302 -0
  57. package/shared/skia/include/codec/SkAvifDecoder.h +80 -0
  58. package/shared/skia/include/codec/SkBmpDecoder.h +44 -0
  59. package/shared/skia/include/codec/SkBmpRustDecoder.h +42 -0
  60. package/shared/skia/include/codec/SkCodec.h +1178 -0
  61. package/shared/skia/include/codec/SkCodecAnimation.h +61 -0
  62. package/shared/skia/include/codec/SkEncodedImageFormat.h +33 -0
  63. package/shared/skia/include/codec/SkEncodedOrigin.h +71 -0
  64. package/shared/skia/include/codec/SkGifDecoder.h +44 -0
  65. package/shared/skia/include/codec/SkIcoDecoder.h +44 -0
  66. package/shared/skia/include/codec/SkJpegDecoder.h +51 -0
  67. package/shared/skia/include/codec/SkJpegxlDecoder.h +44 -0
  68. package/shared/skia/include/codec/SkPixmapUtils.h +31 -0
  69. package/shared/skia/include/codec/SkPngChunkReader.h +45 -0
  70. package/shared/skia/include/codec/SkPngDecoder.h +51 -0
  71. package/shared/skia/include/codec/SkPngRustDecoder.h +30 -0
  72. package/shared/skia/include/codec/SkRawDecoder.h +50 -0
  73. package/shared/skia/include/codec/SkWbmpDecoder.h +44 -0
  74. package/shared/skia/include/codec/SkWebpDecoder.h +51 -0
  75. package/shared/skia/include/config/SkUserConfig.h +141 -0
  76. package/shared/skia/include/core/SkAlphaType.h +45 -0
  77. package/shared/skia/include/core/SkAnnotation.h +52 -0
  78. package/shared/skia/include/core/SkArc.h +69 -0
  79. package/shared/skia/include/core/SkBBHFactory.h +67 -0
  80. package/shared/skia/include/core/SkBitmap.h +1264 -0
  81. package/shared/skia/include/core/SkBlendMode.h +112 -0
  82. package/shared/skia/include/core/SkBlender.h +30 -0
  83. package/shared/skia/include/core/SkBlurTypes.h +20 -0
  84. package/shared/skia/include/core/SkCPUContext.h +31 -0
  85. package/shared/skia/include/core/SkCPURecorder.h +76 -0
  86. package/shared/skia/include/core/SkCanvas.h +2770 -0
  87. package/shared/skia/include/core/SkCanvasVirtualEnforcer.h +61 -0
  88. package/shared/skia/include/core/SkCapabilities.h +35 -0
  89. package/shared/skia/include/core/SkClipOp.h +19 -0
  90. package/shared/skia/include/core/SkColor.h +469 -0
  91. package/shared/skia/include/core/SkColorFilter.h +150 -0
  92. package/shared/skia/include/core/SkColorSpace.h +432 -0
  93. package/shared/skia/include/core/SkColorTable.h +62 -0
  94. package/shared/skia/include/core/SkColorType.h +159 -0
  95. package/shared/skia/include/core/SkContourMeasure.h +215 -0
  96. package/shared/skia/include/core/SkCoverageMode.h +28 -0
  97. package/shared/skia/include/core/SkCubicMap.h +47 -0
  98. package/shared/skia/include/core/SkData.h +225 -0
  99. package/shared/skia/include/core/SkDataTable.h +122 -0
  100. package/shared/skia/include/core/SkDocument.h +93 -0
  101. package/shared/skia/include/core/SkDrawable.h +178 -0
  102. package/shared/skia/include/core/SkExecutor.h +59 -0
  103. package/shared/skia/include/core/SkFlattenable.h +115 -0
  104. package/shared/skia/include/core/SkFont.h +536 -0
  105. package/shared/skia/include/core/SkFontArguments.h +116 -0
  106. package/shared/skia/include/core/SkFontMetrics.h +139 -0
  107. package/shared/skia/include/core/SkFontMgr.h +178 -0
  108. package/shared/skia/include/core/SkFontParameters.h +43 -0
  109. package/shared/skia/include/core/SkFontScanner.h +45 -0
  110. package/shared/skia/include/core/SkFontStyle.h +84 -0
  111. package/shared/skia/include/core/SkFontTypes.h +25 -0
  112. package/shared/skia/include/core/SkFourByteTag.h +19 -0
  113. package/shared/skia/include/core/SkGraphics.h +169 -0
  114. package/shared/skia/include/core/SkImage.h +918 -0
  115. package/shared/skia/include/core/SkImageFilter.h +119 -0
  116. package/shared/skia/include/core/SkImageGenerator.h +140 -0
  117. package/shared/skia/include/core/SkImageInfo.h +634 -0
  118. package/shared/skia/include/core/SkM44.h +442 -0
  119. package/shared/skia/include/core/SkMallocPixelRef.h +45 -0
  120. package/shared/skia/include/core/SkMaskFilter.h +45 -0
  121. package/shared/skia/include/core/SkMatrix.h +1887 -0
  122. package/shared/skia/include/core/SkMesh.h +429 -0
  123. package/shared/skia/include/core/SkMilestone.h +9 -0
  124. package/shared/skia/include/core/SkOpenTypeSVGDecoder.h +30 -0
  125. package/shared/skia/include/core/SkOverdrawCanvas.h +94 -0
  126. package/shared/skia/include/core/SkPaint.h +698 -0
  127. package/shared/skia/include/core/SkPath.h +1145 -0
  128. package/shared/skia/include/core/SkPathBuilder.h +1052 -0
  129. package/shared/skia/include/core/SkPathEffect.h +88 -0
  130. package/shared/skia/include/core/SkPathIter.h +90 -0
  131. package/shared/skia/include/core/SkPathMeasure.h +96 -0
  132. package/shared/skia/include/core/SkPathTypes.h +71 -0
  133. package/shared/skia/include/core/SkPathUtils.h +39 -0
  134. package/shared/skia/include/core/SkPicture.h +291 -0
  135. package/shared/skia/include/core/SkPictureRecorder.h +115 -0
  136. package/shared/skia/include/core/SkPixelRef.h +120 -0
  137. package/shared/skia/include/core/SkPixmap.h +736 -0
  138. package/shared/skia/include/core/SkPoint.h +560 -0
  139. package/shared/skia/include/core/SkPoint3.h +149 -0
  140. package/shared/skia/include/core/SkRRect.h +548 -0
  141. package/shared/skia/include/core/SkRSXform.h +71 -0
  142. package/shared/skia/include/core/SkRasterHandleAllocator.h +94 -0
  143. package/shared/skia/include/core/SkRecorder.h +49 -0
  144. package/shared/skia/include/core/SkRect.h +1419 -0
  145. package/shared/skia/include/core/SkRefCnt.h +391 -0
  146. package/shared/skia/include/core/SkRegion.h +701 -0
  147. package/shared/skia/include/core/SkSamplingOptions.h +107 -0
  148. package/shared/skia/include/core/SkScalar.h +148 -0
  149. package/shared/skia/include/core/SkSerialProcs.h +127 -0
  150. package/shared/skia/include/core/SkShader.h +123 -0
  151. package/shared/skia/include/core/SkSize.h +93 -0
  152. package/shared/skia/include/core/SkSpan.h +174 -0
  153. package/shared/skia/include/core/SkStream.h +524 -0
  154. package/shared/skia/include/core/SkStrikeRef.h +96 -0
  155. package/shared/skia/include/core/SkString.h +297 -0
  156. package/shared/skia/include/core/SkStrokeRec.h +160 -0
  157. package/shared/skia/include/core/SkSurface.h +689 -0
  158. package/shared/skia/include/core/SkSurfaceProps.h +122 -0
  159. package/shared/skia/include/core/SkSwizzle.h +21 -0
  160. package/shared/skia/include/core/SkTextBlob.h +541 -0
  161. package/shared/skia/include/core/SkTextureCompressionType.h +30 -0
  162. package/shared/skia/include/core/SkTileMode.h +41 -0
  163. package/shared/skia/include/core/SkTiledImageUtils.h +125 -0
  164. package/shared/skia/include/core/SkTraceMemoryDump.h +121 -0
  165. package/shared/skia/include/core/SkTypeface.h +468 -0
  166. package/shared/skia/include/core/SkTypes.h +193 -0
  167. package/shared/skia/include/core/SkUnPreMultiply.h +55 -0
  168. package/shared/skia/include/core/SkVertices.h +136 -0
  169. package/shared/skia/include/core/SkYUVAInfo.h +311 -0
  170. package/shared/skia/include/core/SkYUVAPixmaps.h +335 -0
  171. package/shared/skia/include/docs/SkMultiPictureDocument.h +53 -0
  172. package/shared/skia/include/docs/SkPDFDocument.h +277 -0
  173. package/shared/skia/include/docs/SkPDFJpegHelpers.h +41 -0
  174. package/shared/skia/include/docs/SkXPSDocument.h +43 -0
  175. package/shared/skia/include/effects/Sk1DPathEffect.h +40 -0
  176. package/shared/skia/include/effects/Sk2DPathEffect.h +33 -0
  177. package/shared/skia/include/effects/SkBlenders.h +27 -0
  178. package/shared/skia/include/effects/SkBlurMaskFilter.h +35 -0
  179. package/shared/skia/include/effects/SkColorMatrix.h +57 -0
  180. package/shared/skia/include/effects/SkColorMatrixFilter.h +22 -0
  181. package/shared/skia/include/effects/SkCornerPathEffect.h +32 -0
  182. package/shared/skia/include/effects/SkDashPathEffect.h +43 -0
  183. package/shared/skia/include/effects/SkDiscretePathEffect.h +37 -0
  184. package/shared/skia/include/effects/SkGradient.h +206 -0
  185. package/shared/skia/include/effects/SkHighContrastFilter.h +84 -0
  186. package/shared/skia/include/effects/SkImageFilters.h +641 -0
  187. package/shared/skia/include/effects/SkLumaColorFilter.h +37 -0
  188. package/shared/skia/include/effects/SkOverdrawColorFilter.h +33 -0
  189. package/shared/skia/include/effects/SkPerlinNoiseShader.h +53 -0
  190. package/shared/skia/include/effects/SkRuntimeEffect.h +503 -0
  191. package/shared/skia/include/effects/SkShaderMaskFilter.h +28 -0
  192. package/shared/skia/include/effects/SkTableMaskFilter.h +47 -0
  193. package/shared/skia/include/effects/SkTrimPathEffect.h +45 -0
  194. package/shared/skia/include/encode/SkEncoder.h +63 -0
  195. package/shared/skia/include/encode/SkICC.h +36 -0
  196. package/shared/skia/include/encode/SkJpegEncoder.h +127 -0
  197. package/shared/skia/include/encode/SkPngEncoder.h +132 -0
  198. package/shared/skia/include/encode/SkPngRustEncoder.h +121 -0
  199. package/shared/skia/include/encode/SkWebpEncoder.h +87 -0
  200. package/shared/skia/include/gpu/GpuTypes.h +98 -0
  201. package/shared/skia/include/gpu/MutableTextureState.h +68 -0
  202. package/shared/skia/include/gpu/ShaderErrorHandler.h +46 -0
  203. package/shared/skia/include/gpu/ganesh/GrBackendSemaphore.h +50 -0
  204. package/shared/skia/include/gpu/ganesh/GrBackendSurface.h +257 -0
  205. package/shared/skia/include/gpu/ganesh/GrContextOptions.h +384 -0
  206. package/shared/skia/include/gpu/ganesh/GrContextThreadSafeProxy.h +175 -0
  207. package/shared/skia/include/gpu/ganesh/GrDirectContext.h +1027 -0
  208. package/shared/skia/include/gpu/ganesh/GrDriverBugWorkarounds.h +53 -0
  209. package/shared/skia/include/gpu/ganesh/GrDriverBugWorkaroundsAutogen.h +49 -0
  210. package/shared/skia/include/gpu/ganesh/GrExternalTextureGenerator.h +54 -0
  211. package/shared/skia/include/gpu/ganesh/GrRecordingContext.h +300 -0
  212. package/shared/skia/include/gpu/ganesh/GrTypes.h +193 -0
  213. package/shared/skia/include/gpu/ganesh/GrYUVABackendTextures.h +130 -0
  214. package/shared/skia/include/gpu/ganesh/SkImageGanesh.h +361 -0
  215. package/shared/skia/include/gpu/ganesh/SkMeshGanesh.h +57 -0
  216. package/shared/skia/include/gpu/ganesh/SkSurfaceGanesh.h +218 -0
  217. package/shared/skia/include/gpu/ganesh/d3d/GrD3DBackendContext.h +35 -0
  218. package/shared/skia/include/gpu/ganesh/d3d/GrD3DBackendSemaphore.h +20 -0
  219. package/shared/skia/include/gpu/ganesh/d3d/GrD3DBackendSurface.h +59 -0
  220. package/shared/skia/include/gpu/ganesh/d3d/GrD3DDirectContext.h +28 -0
  221. package/shared/skia/include/gpu/ganesh/d3d/GrD3DTypes.h +248 -0
  222. package/shared/skia/include/gpu/ganesh/gl/GrGLAssembleHelpers.h +17 -0
  223. package/shared/skia/include/gpu/ganesh/gl/GrGLAssembleInterface.h +45 -0
  224. package/shared/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h +64 -0
  225. package/shared/skia/include/gpu/ganesh/gl/GrGLConfig.h +69 -0
  226. package/shared/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +30 -0
  227. package/shared/skia/include/gpu/ganesh/gl/GrGLExtensions.h +79 -0
  228. package/shared/skia/include/gpu/ganesh/gl/GrGLFunctions.h +313 -0
  229. package/shared/skia/include/gpu/ganesh/gl/GrGLInterface.h +337 -0
  230. package/shared/skia/include/gpu/ganesh/gl/GrGLMakeWebGLInterface.h +19 -0
  231. package/shared/skia/include/gpu/ganesh/gl/GrGLTypes.h +219 -0
  232. package/shared/skia/include/gpu/ganesh/gl/egl/GrGLMakeEGLInterface.h +23 -0
  233. package/shared/skia/include/gpu/ganesh/gl/epoxy/GrGLMakeEpoxyEGLInterface.h +20 -0
  234. package/shared/skia/include/gpu/ganesh/gl/glx/GrGLMakeGLXInterface.h +23 -0
  235. package/shared/skia/include/gpu/ganesh/gl/ios/GrGLMakeIOSInterface.h +20 -0
  236. package/shared/skia/include/gpu/ganesh/gl/mac/GrGLMakeMacInterface.h +20 -0
  237. package/shared/skia/include/gpu/ganesh/gl/win/GrGLMakeWinInterface.h +20 -0
  238. package/shared/skia/include/gpu/ganesh/mock/GrMockBackendSurface.h +59 -0
  239. package/shared/skia/include/gpu/ganesh/mock/GrMockTypes.h +166 -0
  240. package/shared/skia/include/gpu/ganesh/mtl/GrMtlBackendContext.h +21 -0
  241. package/shared/skia/include/gpu/ganesh/mtl/GrMtlBackendSemaphore.h +23 -0
  242. package/shared/skia/include/gpu/ganesh/mtl/GrMtlBackendSurface.h +44 -0
  243. package/shared/skia/include/gpu/ganesh/mtl/GrMtlDirectContext.h +30 -0
  244. package/shared/skia/include/gpu/ganesh/mtl/GrMtlTypes.h +61 -0
  245. package/shared/skia/include/gpu/ganesh/mtl/SkSurfaceMetal.h +73 -0
  246. package/shared/skia/include/gpu/ganesh/vk/GrBackendDrawableInfo.h +44 -0
  247. package/shared/skia/include/gpu/ganesh/vk/GrVkBackendSemaphore.h +20 -0
  248. package/shared/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h +71 -0
  249. package/shared/skia/include/gpu/ganesh/vk/GrVkDirectContext.h +33 -0
  250. package/shared/skia/include/gpu/ganesh/vk/GrVkTypes.h +101 -0
  251. package/shared/skia/include/gpu/graphite/BackendSemaphore.h +60 -0
  252. package/shared/skia/include/gpu/graphite/BackendTexture.h +65 -0
  253. package/shared/skia/include/gpu/graphite/Context.h +440 -0
  254. package/shared/skia/include/gpu/graphite/ContextOptions.h +239 -0
  255. package/shared/skia/include/gpu/graphite/GraphiteTypes.h +315 -0
  256. package/shared/skia/include/gpu/graphite/Image.h +428 -0
  257. package/shared/skia/include/gpu/graphite/ImageProvider.h +68 -0
  258. package/shared/skia/include/gpu/graphite/PersistentPipelineStorage.h +45 -0
  259. package/shared/skia/include/gpu/graphite/PrecompileContext.h +109 -0
  260. package/shared/skia/include/gpu/graphite/Recorder.h +355 -0
  261. package/shared/skia/include/gpu/graphite/Recording.h +100 -0
  262. package/shared/skia/include/gpu/graphite/Surface.h +121 -0
  263. package/shared/skia/include/gpu/graphite/TextureInfo.h +133 -0
  264. package/shared/skia/include/gpu/graphite/YUVABackendTextures.h +148 -0
  265. package/shared/skia/include/gpu/graphite/dawn/DawnBackendContext.h +77 -0
  266. package/shared/skia/include/gpu/graphite/dawn/DawnGraphiteTypes.h +163 -0
  267. package/shared/skia/include/gpu/graphite/dawn/DawnTypes.h +9 -0
  268. package/shared/skia/include/gpu/graphite/dawn/DawnUtils.h +9 -0
  269. package/shared/skia/include/gpu/graphite/mtl/MtlBackendContext.h +34 -0
  270. package/shared/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +73 -0
  271. package/shared/skia/include/gpu/graphite/mtl/MtlGraphiteTypesUtils.h +10 -0
  272. package/shared/skia/include/gpu/graphite/mtl/MtlGraphiteTypes_cpp.h +50 -0
  273. package/shared/skia/include/gpu/graphite/mtl/MtlGraphiteUtils.h +9 -0
  274. package/shared/skia/include/gpu/graphite/precompile/PaintOptions.h +211 -0
  275. package/shared/skia/include/gpu/graphite/precompile/Precompile.h +59 -0
  276. package/shared/skia/include/gpu/graphite/precompile/PrecompileBase.h +76 -0
  277. package/shared/skia/include/gpu/graphite/precompile/PrecompileBlender.h +56 -0
  278. package/shared/skia/include/gpu/graphite/precompile/PrecompileColorFilter.h +95 -0
  279. package/shared/skia/include/gpu/graphite/precompile/PrecompileImageFilter.h +116 -0
  280. package/shared/skia/include/gpu/graphite/precompile/PrecompileMaskFilter.h +49 -0
  281. package/shared/skia/include/gpu/graphite/precompile/PrecompileRuntimeEffect.h +47 -0
  282. package/shared/skia/include/gpu/graphite/precompile/PrecompileShader.h +268 -0
  283. package/shared/skia/include/gpu/graphite/vk/VulkanGraphiteContext.h +31 -0
  284. package/shared/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +104 -0
  285. package/shared/skia/include/gpu/graphite/vk/precompile/VulkanPrecompileShader.h +39 -0
  286. package/shared/skia/include/gpu/mtl/MtlMemoryAllocator.h +41 -0
  287. package/shared/skia/include/gpu/vk/VulkanBackendContext.h +57 -0
  288. package/shared/skia/include/gpu/vk/VulkanExtensions.h +73 -0
  289. package/shared/skia/include/gpu/vk/VulkanMemoryAllocator.h +117 -0
  290. package/shared/skia/include/gpu/vk/VulkanMutableTextureState.h +26 -0
  291. package/shared/skia/include/gpu/vk/VulkanPreferredFeatures.h +225 -0
  292. package/shared/skia/include/gpu/vk/VulkanTypes.h +245 -0
  293. package/shared/skia/include/pathops/SkPathOps.h +150 -0
  294. package/shared/skia/include/ports/SkCFObject.h +180 -0
  295. package/shared/skia/include/ports/SkFontConfigInterface.h +112 -0
  296. package/shared/skia/include/ports/SkFontMgr_FontConfigInterface.h +24 -0
  297. package/shared/skia/include/ports/SkFontMgr_Fontations.h +20 -0
  298. package/shared/skia/include/ports/SkFontMgr_android.h +48 -0
  299. package/shared/skia/include/ports/SkFontMgr_android_ndk.h +27 -0
  300. package/shared/skia/include/ports/SkFontMgr_data.h +22 -0
  301. package/shared/skia/include/ports/SkFontMgr_directory.h +21 -0
  302. package/shared/skia/include/ports/SkFontMgr_empty.h +21 -0
  303. package/shared/skia/include/ports/SkFontMgr_fontconfig.h +24 -0
  304. package/shared/skia/include/ports/SkFontMgr_fuchsia.h +21 -0
  305. package/shared/skia/include/ports/SkFontMgr_mac_ct.h +27 -0
  306. package/shared/skia/include/ports/SkFontScanner_Fontations.h +15 -0
  307. package/shared/skia/include/ports/SkFontScanner_FreeType.h +15 -0
  308. package/shared/skia/include/ports/SkImageGeneratorCG.h +28 -0
  309. package/shared/skia/include/ports/SkImageGeneratorNDK.h +40 -0
  310. package/shared/skia/include/ports/SkImageGeneratorWIC.h +41 -0
  311. package/shared/skia/include/ports/SkTypeface_fontations.h +24 -0
  312. package/shared/skia/include/ports/SkTypeface_mac.h +44 -0
  313. package/shared/skia/include/ports/SkTypeface_win.h +63 -0
  314. package/shared/skia/include/private/SingleOwner.h +75 -0
  315. package/shared/skia/include/private/SkAPI.h +52 -0
  316. package/shared/skia/include/private/SkASAN.h +56 -0
  317. package/shared/skia/include/private/SkAlign.h +51 -0
  318. package/shared/skia/include/private/SkAlignedStorage.h +32 -0
  319. package/shared/skia/include/private/SkAnySubclass.h +79 -0
  320. package/shared/skia/include/private/SkAssert.h +203 -0
  321. package/shared/skia/include/private/SkAttributes.h +96 -0
  322. package/shared/skia/include/private/SkCPUTypes.h +25 -0
  323. package/shared/skia/include/private/SkContainers.h +54 -0
  324. package/shared/skia/include/private/SkDebug.h +27 -0
  325. package/shared/skia/include/private/SkDeque.h +138 -0
  326. package/shared/skia/include/private/SkEncodedInfo.h +249 -0
  327. package/shared/skia/include/private/SkEnumBitMask.h +92 -0
  328. package/shared/skia/include/private/SkExif.h +69 -0
  329. package/shared/skia/include/private/SkFeatures.h +173 -0
  330. package/shared/skia/include/private/SkFixed.h +143 -0
  331. package/shared/skia/include/private/SkFloatingPoint.h +183 -0
  332. package/shared/skia/include/private/SkGainmapInfo.h +140 -0
  333. package/shared/skia/include/private/SkGainmapShader.h +60 -0
  334. package/shared/skia/include/private/SkHdrMetadata.h +357 -0
  335. package/shared/skia/include/private/SkIDChangeListener.h +76 -0
  336. package/shared/skia/include/private/SkJpegGainmapEncoder.h +48 -0
  337. package/shared/skia/include/private/SkJpegMetadataDecoder.h +103 -0
  338. package/shared/skia/include/private/SkLoadUserConfig.h +64 -0
  339. package/shared/skia/include/private/SkLog.h +62 -0
  340. package/shared/skia/include/private/SkLogPriority.h +34 -0
  341. package/shared/skia/include/private/SkMacros.h +170 -0
  342. package/shared/skia/include/private/SkMalloc.h +152 -0
  343. package/shared/skia/include/private/SkMath.h +77 -0
  344. package/shared/skia/include/private/SkMutex.h +72 -0
  345. package/shared/skia/include/private/SkNoncopyable.h +30 -0
  346. package/shared/skia/include/private/SkOnce.h +55 -0
  347. package/shared/skia/include/private/SkPathRef.h +90 -0
  348. package/shared/skia/include/private/SkPixelStorage.h +52 -0
  349. package/shared/skia/include/private/SkSLSampleUsage.h +85 -0
  350. package/shared/skia/include/private/SkSafe32.h +49 -0
  351. package/shared/skia/include/private/SkSemaphore.h +84 -0
  352. package/shared/skia/include/private/SkTArray.h +823 -0
  353. package/shared/skia/include/private/SkTDArray.h +247 -0
  354. package/shared/skia/include/private/SkTFitsIn.h +92 -0
  355. package/shared/skia/include/private/SkTLogic.h +56 -0
  356. package/shared/skia/include/private/SkTPin.h +23 -0
  357. package/shared/skia/include/private/SkTemplates.h +500 -0
  358. package/shared/skia/include/private/SkThreadAnnotations.h +104 -0
  359. package/shared/skia/include/private/SkThreadID.h +23 -0
  360. package/shared/skia/include/private/SkTo.h +39 -0
  361. package/shared/skia/include/private/SkTypeTraits.h +53 -0
  362. package/shared/skia/include/private/SkWeakRefCnt.h +173 -0
  363. package/shared/skia/include/private/SkXmp.h +62 -0
  364. package/shared/skia/include/private/chromium/GrDeferredDisplayList.h +120 -0
  365. package/shared/skia/include/private/chromium/GrDeferredDisplayListRecorder.h +62 -0
  366. package/shared/skia/include/private/chromium/GrPromiseImageTexture.h +43 -0
  367. package/shared/skia/include/private/chromium/GrSurfaceCharacterization.h +211 -0
  368. package/shared/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +131 -0
  369. package/shared/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +150 -0
  370. package/shared/skia/include/private/chromium/SkCodecsICCProfileChromium.h +52 -0
  371. package/shared/skia/include/private/chromium/SkDiscardableMemory.h +70 -0
  372. package/shared/skia/include/private/chromium/SkExifChromium.h +26 -0
  373. package/shared/skia/include/private/chromium/SkImageChromium.h +117 -0
  374. package/shared/skia/include/private/chromium/SkPMColor.h +38 -0
  375. package/shared/skia/include/private/chromium/Slug.h +72 -0
  376. package/shared/skia/include/private/gpu/ganesh/GrContext_Base.h +104 -0
  377. package/shared/skia/include/private/gpu/ganesh/GrD3DTypesMinimal.h +60 -0
  378. package/shared/skia/include/private/gpu/ganesh/GrImageContext.h +56 -0
  379. package/shared/skia/include/private/gpu/ganesh/GrTextureGenerator.h +66 -0
  380. package/shared/skia/include/private/gpu/ganesh/GrTypesPriv.h +959 -0
  381. package/shared/skia/include/private/gpu/vk/SkiaVulkan.h +36 -0
  382. package/shared/skia/include/sksl/SkSLDebugTrace.h +25 -0
  383. package/shared/skia/include/sksl/SkSLVersion.h +27 -0
  384. package/shared/skia/include/svg/SkSVGCanvas.h +62 -0
  385. package/shared/skia/include/third_party/vulkan/vulkan/vk_icd.h +245 -0
  386. package/shared/skia/include/third_party/vulkan/vulkan/vk_layer.h +192 -0
  387. package/shared/skia/include/third_party/vulkan/vulkan/vk_platform.h +84 -0
  388. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_av1std.h +394 -0
  389. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_av1std_decode.h +109 -0
  390. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_av1std_encode.h +143 -0
  391. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std.h +312 -0
  392. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_decode.h +77 -0
  393. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_encode.h +147 -0
  394. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std.h +446 -0
  395. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_decode.h +67 -0
  396. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_encode.h +157 -0
  397. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_vp9std.h +151 -0
  398. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_vp9std_decode.h +68 -0
  399. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codecs_common.h +36 -0
  400. package/shared/skia/include/third_party/vulkan/vulkan/vulkan.h +103 -0
  401. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_android.h +159 -0
  402. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_beta.h +375 -0
  403. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_core.h +25896 -0
  404. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_directfb.h +59 -0
  405. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_fuchsia.h +282 -0
  406. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_ggp.h +62 -0
  407. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_ios.h +50 -0
  408. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_macos.h +50 -0
  409. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_metal.h +244 -0
  410. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_ohos.h +120 -0
  411. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_screen.h +114 -0
  412. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_vi.h +50 -0
  413. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_wayland.h +59 -0
  414. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_win32.h +372 -0
  415. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_xcb.h +60 -0
  416. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_xlib.h +60 -0
  417. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_xlib_xrandr.h +50 -0
  418. package/shared/skia/include/utils/SkCamera.h +109 -0
  419. package/shared/skia/include/utils/SkCanvasStateUtils.h +81 -0
  420. package/shared/skia/include/utils/SkCustomTypeface.h +70 -0
  421. package/shared/skia/include/utils/SkEventTracer.h +93 -0
  422. package/shared/skia/include/utils/SkNWayCanvas.h +123 -0
  423. package/shared/skia/include/utils/SkNoDrawCanvas.h +78 -0
  424. package/shared/skia/include/utils/SkNullCanvas.h +22 -0
  425. package/shared/skia/include/utils/SkOrderedFontMgr.h +66 -0
  426. package/shared/skia/include/utils/SkPaintFilterCanvas.h +140 -0
  427. package/shared/skia/include/utils/SkParse.h +36 -0
  428. package/shared/skia/include/utils/SkParsePath.h +33 -0
  429. package/shared/skia/include/utils/SkShadowUtils.h +102 -0
  430. package/shared/skia/include/utils/SkTextUtils.h +43 -0
  431. package/shared/skia/include/utils/SkTraceEventPhase.h +19 -0
  432. package/shared/skia/include/utils/mac/SkCGUtils.h +90 -0
  433. package/shared/skia/modules/jsonreader/SkJSONReader.cpp +996 -0
  434. package/shared/skia/modules/jsonreader/SkJSONReader.h +389 -0
  435. package/shared/skia/modules/skcms/skcms.h +10 -0
  436. package/shared/skia/modules/skcms/src/Transform_inl.h +1600 -0
  437. package/shared/skia/modules/skcms/src/skcms_Transform.h +167 -0
  438. package/shared/skia/modules/skcms/src/skcms_internals.h +157 -0
  439. package/shared/skia/modules/skcms/src/skcms_public.h +496 -0
  440. package/shared/skia/modules/skottie/include/ExternalLayer.h +56 -0
  441. package/shared/skia/modules/skottie/include/Skottie.h +324 -0
  442. package/shared/skia/modules/skottie/include/SkottieProperty.h +190 -0
  443. package/shared/skia/modules/skottie/include/SlotManager.h +113 -0
  444. package/shared/skia/modules/skottie/include/TextShaper.h +197 -0
  445. package/shared/skia/modules/skottie/src/SkottieValue.h +56 -0
  446. package/shared/skia/modules/skottie/src/animator/Animator.h +89 -0
  447. package/shared/skia/modules/skottie/src/text/Font.h +82 -0
  448. package/shared/skia/modules/skottie/src/text/TextAdapter.h +155 -0
  449. package/shared/skia/modules/skottie/src/text/TextAnimator.h +122 -0
  450. package/shared/skia/modules/skottie/src/text/TextValue.h +28 -0
  451. package/shared/skia/modules/skparagraph/include/DartTypes.h +153 -0
  452. package/shared/skia/modules/skparagraph/include/FontArguments.h +46 -0
  453. package/shared/skia/modules/skparagraph/include/FontCollection.h +76 -0
  454. package/shared/skia/modules/skparagraph/include/Metrics.h +98 -0
  455. package/shared/skia/modules/skparagraph/include/Paragraph.h +289 -0
  456. package/shared/skia/modules/skparagraph/include/ParagraphBuilder.h +94 -0
  457. package/shared/skia/modules/skparagraph/include/ParagraphCache.h +52 -0
  458. package/shared/skia/modules/skparagraph/include/ParagraphPainter.h +63 -0
  459. package/shared/skia/modules/skparagraph/include/ParagraphStyle.h +160 -0
  460. package/shared/skia/modules/skparagraph/include/TextShadow.h +30 -0
  461. package/shared/skia/modules/skparagraph/include/TextStyle.h +392 -0
  462. package/shared/skia/modules/skparagraph/include/TypefaceFontProvider.h +78 -0
  463. package/shared/skia/modules/skresources/include/SkResources.h +291 -0
  464. package/shared/skia/modules/sksg/include/SkSGClipEffect.h +61 -0
  465. package/shared/skia/modules/sksg/include/SkSGColorFilter.h +135 -0
  466. package/shared/skia/modules/sksg/include/SkSGDraw.h +57 -0
  467. package/shared/skia/modules/sksg/include/SkSGEffectNode.h +50 -0
  468. package/shared/skia/modules/sksg/include/SkSGGeometryEffect.h +207 -0
  469. package/shared/skia/modules/sksg/include/SkSGGeometryNode.h +54 -0
  470. package/shared/skia/modules/sksg/include/SkSGGradient.h +108 -0
  471. package/shared/skia/modules/sksg/include/SkSGGroup.h +65 -0
  472. package/shared/skia/modules/sksg/include/SkSGImage.h +59 -0
  473. package/shared/skia/modules/sksg/include/SkSGInvalidationController.h +46 -0
  474. package/shared/skia/modules/sksg/include/SkSGMaskEffect.h +65 -0
  475. package/shared/skia/modules/sksg/include/SkSGMerge.h +74 -0
  476. package/shared/skia/modules/sksg/include/SkSGNode.h +128 -0
  477. package/shared/skia/modules/sksg/include/SkSGOpacityEffect.h +54 -0
  478. package/shared/skia/modules/sksg/include/SkSGPaint.h +112 -0
  479. package/shared/skia/modules/sksg/include/SkSGPath.h +68 -0
  480. package/shared/skia/modules/sksg/include/SkSGPlane.h +47 -0
  481. package/shared/skia/modules/sksg/include/SkSGRect.h +122 -0
  482. package/shared/skia/modules/sksg/include/SkSGRenderEffect.h +283 -0
  483. package/shared/skia/modules/sksg/include/SkSGRenderNode.h +157 -0
  484. package/shared/skia/modules/sksg/include/SkSGScene.h +47 -0
  485. package/shared/skia/modules/sksg/include/SkSGText.h +82 -0
  486. package/shared/skia/modules/sksg/include/SkSGTransform.h +127 -0
  487. package/shared/skia/modules/skshaper/include/SkShaper.h +318 -0
  488. package/shared/skia/modules/skshaper/include/SkShaper_coretext.h +26 -0
  489. package/shared/skia/modules/skshaper/include/SkShaper_factory.h +41 -0
  490. package/shared/skia/modules/skshaper/include/SkShaper_harfbuzz.h +39 -0
  491. package/shared/skia/modules/skshaper/include/SkShaper_skunicode.h +28 -0
  492. package/shared/skia/modules/skunicode/include/SkUnicode.h +321 -0
  493. package/shared/skia/modules/skunicode/include/SkUnicode_icu.h +18 -0
  494. package/shared/skia/modules/skunicode/include/SkUnicode_libgrapheme.h +19 -0
  495. package/shared/skia/modules/svg/include/SkSVGAttribute.h +110 -0
  496. package/shared/skia/modules/svg/include/SkSVGAttributeParser.h +170 -0
  497. package/shared/skia/modules/svg/include/SkSVGCircle.h +56 -0
  498. package/shared/skia/modules/svg/include/SkSVGClipPath.h +41 -0
  499. package/shared/skia/modules/svg/include/SkSVGContainer.h +52 -0
  500. package/shared/skia/modules/svg/include/SkSVGDOM.h +111 -0
  501. package/shared/skia/modules/svg/include/SkSVGDefs.h +23 -0
  502. package/shared/skia/modules/svg/include/SkSVGEllipse.h +51 -0
  503. package/shared/skia/modules/svg/include/SkSVGFe.h +93 -0
  504. package/shared/skia/modules/svg/include/SkSVGFeBlend.h +54 -0
  505. package/shared/skia/modules/svg/include/SkSVGFeColorMatrix.h +55 -0
  506. package/shared/skia/modules/svg/include/SkSVGFeComponentTransfer.h +82 -0
  507. package/shared/skia/modules/svg/include/SkSVGFeComposite.h +55 -0
  508. package/shared/skia/modules/svg/include/SkSVGFeDisplacementMap.h +56 -0
  509. package/shared/skia/modules/svg/include/SkSVGFeFlood.h +42 -0
  510. package/shared/skia/modules/svg/include/SkSVGFeGaussianBlur.h +50 -0
  511. package/shared/skia/modules/svg/include/SkSVGFeImage.h +44 -0
  512. package/shared/skia/modules/svg/include/SkSVGFeLightSource.h +93 -0
  513. package/shared/skia/modules/svg/include/SkSVGFeLighting.h +131 -0
  514. package/shared/skia/modules/svg/include/SkSVGFeMerge.h +63 -0
  515. package/shared/skia/modules/svg/include/SkSVGFeMorphology.h +55 -0
  516. package/shared/skia/modules/svg/include/SkSVGFeOffset.h +44 -0
  517. package/shared/skia/modules/svg/include/SkSVGFeTurbulence.h +49 -0
  518. package/shared/skia/modules/svg/include/SkSVGFilter.h +48 -0
  519. package/shared/skia/modules/svg/include/SkSVGFilterContext.h +69 -0
  520. package/shared/skia/modules/svg/include/SkSVGG.h +23 -0
  521. package/shared/skia/modules/svg/include/SkSVGGradient.h +56 -0
  522. package/shared/skia/modules/svg/include/SkSVGHiddenContainer.h +23 -0
  523. package/shared/skia/modules/svg/include/SkSVGIDMapper.h +19 -0
  524. package/shared/skia/modules/svg/include/SkSVGImage.h +67 -0
  525. package/shared/skia/modules/svg/include/SkSVGLine.h +53 -0
  526. package/shared/skia/modules/svg/include/SkSVGLinearGradient.h +47 -0
  527. package/shared/skia/modules/svg/include/SkSVGMask.h +49 -0
  528. package/shared/skia/modules/svg/include/SkSVGNode.h +235 -0
  529. package/shared/skia/modules/svg/include/SkSVGOpenTypeSVGDecoder.h +37 -0
  530. package/shared/skia/modules/svg/include/SkSVGPath.h +46 -0
  531. package/shared/skia/modules/svg/include/SkSVGPattern.h +61 -0
  532. package/shared/skia/modules/svg/include/SkSVGPoly.h +56 -0
  533. package/shared/skia/modules/svg/include/SkSVGRadialGradient.h +48 -0
  534. package/shared/skia/modules/svg/include/SkSVGRect.h +56 -0
  535. package/shared/skia/modules/svg/include/SkSVGRenderContext.h +229 -0
  536. package/shared/skia/modules/svg/include/SkSVGSVG.h +60 -0
  537. package/shared/skia/modules/svg/include/SkSVGShape.h +40 -0
  538. package/shared/skia/modules/svg/include/SkSVGStop.h +36 -0
  539. package/shared/skia/modules/svg/include/SkSVGText.h +128 -0
  540. package/shared/skia/modules/svg/include/SkSVGTransformableNode.h +48 -0
  541. package/shared/skia/modules/svg/include/SkSVGTypes.h +740 -0
  542. package/shared/skia/modules/svg/include/SkSVGUse.h +49 -0
  543. package/shared/skia/modules/svg/include/SkSVGValue.h +85 -0
  544. package/shared/skia/src/core/SkArenaAlloc.h +371 -0
  545. package/shared/skia/src/core/SkAutoLocaleSetter.h +94 -0
  546. package/shared/skia/src/core/SkChecksum.h +118 -0
  547. package/shared/skia/src/core/SkLRUCache.h +143 -0
  548. package/shared/skia/src/core/SkMathPriv.h +225 -0
  549. package/shared/skia/src/core/SkTHash.h +714 -0
  550. package/shared/skia/src/core/SkTInternalLList.h +304 -0
  551. package/shared/skia/src/core/SkTLazy.h +216 -0
  552. package/shared/skia/src/core/SkUTF.h +102 -0
  553. package/shared/skia/src/gpu/ganesh/gl/GrGLDefines.h +1162 -0
  554. package/src/GameMethods.nitro.ts +4 -0
  555. package/src/GameMethods.ts +55 -0
  556. package/src/index.tsx +0 -1
  557. package/src/nativeTypes.ts +6 -0
  558. package/android/src/main/cpp/GameLoopJNI.cpp +0 -132
  559. package/android/src/main/java/com/margelo/nitro/rngine/Asset.kt +0 -9
  560. package/android/src/main/java/com/margelo/nitro/rngine/GameAssets.kt +0 -61
  561. package/android/src/main/java/com/margelo/nitro/rngine/Screen.kt +0 -9
  562. package/android/src/main/java/com/margelo/nitro/rngine/Shape.kt +0 -26
  563. package/android/src/main/java/com/margelo/nitro/rngine/Snapshot.kt +0 -3
  564. package/android/src/main/java/com/margelo/nitro/rngine/SnapshotSerializer.kt +0 -53
  565. package/lib/module/GameAssets.js +0 -41
  566. package/lib/module/GameAssets.js.map +0 -1
  567. package/lib/module/GameAssets.nitro.js +0 -5
  568. package/lib/module/GameAssets.nitro.js.map +0 -1
  569. package/lib/typescript/src/GameAssets.d.ts +0 -2
  570. package/lib/typescript/src/GameAssets.d.ts.map +0 -1
  571. package/lib/typescript/src/GameAssets.nitro.d.ts +0 -12
  572. package/lib/typescript/src/GameAssets.nitro.d.ts.map +0 -1
  573. package/nitrogen/generated/android/c++/JHybridGameAssetsSpec.cpp +0 -86
  574. package/nitrogen/generated/android/c++/JHybridGameAssetsSpec.hpp +0 -65
  575. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngine/HybridGameAssetsSpec.kt +0 -63
  576. package/nitrogen/generated/ios/c++/HybridGameAssetsSpecSwift.cpp +0 -11
  577. package/nitrogen/generated/ios/c++/HybridGameAssetsSpecSwift.hpp +0 -99
  578. package/nitrogen/generated/ios/swift/Func_void.swift +0 -46
  579. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +0 -46
  580. package/nitrogen/generated/ios/swift/HybridGameAssetsSpec.swift +0 -57
  581. package/nitrogen/generated/ios/swift/HybridGameAssetsSpec_cxx.swift +0 -176
  582. package/nitrogen/generated/shared/c++/HybridGameAssetsSpec.cpp +0 -23
  583. package/nitrogen/generated/shared/c++/HybridGameAssetsSpec.hpp +0 -65
  584. package/src/GameAssets.nitro.ts +0 -14
  585. package/src/GameAssets.ts +0 -47
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Rngine
2
2
 
3
- A React Native game engine for building 2D games, powered by [Nitro Modules](https://nitro.margelo.com/) for high-performance C++ game logic.
3
+ A React Native game engine for building 2D games, powered by [Nitro Modules](https://nitro.margelo.com/) for high-performance C++ game logic and rendered natively with [Skia](https://skia.org/).
4
4
 
5
5
  ## Installation
6
6
 
@@ -24,19 +24,14 @@ configure({
24
24
  px: 420,
25
25
  py: 420,
26
26
  color: '#0f0',
27
- shape: {
28
- radius: 20,
29
- },
27
+ shape: { radius: 20 },
30
28
  },
31
29
  {
32
30
  id: 'enemy_1',
33
31
  px: 120,
34
32
  py: 120,
35
33
  color: '#f00',
36
- shape: {
37
- width: 40,
38
- height: 40,
39
- },
34
+ shape: { width: 40, height: 40 },
40
35
  vx: 1000,
41
36
  },
42
37
  {
@@ -44,10 +39,7 @@ configure({
44
39
  px: 220,
45
40
  py: 220,
46
41
  color: '#f00',
47
- shape: {
48
- width: 40,
49
- height: 40,
50
- },
42
+ shape: { width: 40, height: 40 },
51
43
  vx: -1000,
52
44
  },
53
45
  ],
@@ -58,10 +50,8 @@ configure({
58
50
  onTick: (enemies) => {
59
51
  enemies.forEach((enemy) => {
60
52
  // reverse direction when reaching screen edges
61
- if (
62
- enemy.px - enemy.width / 2 <= 0 ||
63
- enemy.px + enemy.width / 2 >= 800
64
- ) {
53
+ const halfWidth = enemy.shape.width / 2;
54
+ if (enemy.px - halfWidth <= 0 || enemy.px + halfWidth >= 800) {
65
55
  update({ id: enemy.id, vx: -enemy.vx });
66
56
  }
67
57
  });
@@ -78,11 +68,25 @@ export default function App() {
78
68
 
79
69
  ## Concepts
80
70
 
81
- **Entities** are the objects in your game world. Each entity has a position, shape, color, and velocity. See [`Entity`](./src/nativeTypes.ts).
71
+ **Entities** are the objects in your game world. Each entity has a position, shape, and optional color/asset/velocity/acceleration/mass. See [`Entity`](./src/nativeTypes.ts).
72
+
73
+ **Shapes** describe an entity's collision and rendering geometry: either a rectangle (`{ width, height }`) or a circle (`{ radius }`).
82
74
 
83
75
  **Systems** define your game logic. Each system optionally declares which entities it cares about via `entities`, which collision pairs to watch via `collisions`, or both. Systems run every tick receiving the resolved entities and any active collisions. See [`System`](./src/types.ts).
84
76
 
85
- **Screen** defines the viewport dimensions and background color. Entities outside the screen bounds are automatically clipped. See [`Screen`](./src/nativeTypes.ts).
77
+ **Screen** defines the viewport dimensions and optional background: color/asset. Entities outside the screen bounds are automatically clipped. See [`Screen`](./src/nativeTypes.ts)
78
+
79
+ **World** defines global simulation settings: `tickRate` (game logic updates per second) and optional gravity (`gx`/`gy`, in game units per second²). See [`World`](./src/nativeTypes.ts)
80
+
81
+ ## Rendering
82
+
83
+ Rngine renders natively with [Skia](https://skia.org/) — every frame is drawn directly in C++ on the game loop thread, with no bridge round-trip per frame. SVG and [Lottie](https://airbnb.io/lottie/) animations are both supported as entity/screen assets, decoded and cached natively.
84
+
85
+ ## Physics
86
+
87
+ Entities with a `mass` are affected by the world's gravity (`world.gx`/`gy`) and participate in automatic collision resolution: overlapping entities are pushed apart and have their velocities updated via an impulse response. Entities without a `mass` (or `mass: 0`) are treated as immovable (infinite mass) when involved in a collision — useful for static geometry like a ground or walls.
88
+
89
+ Set `isSensor: true` on an entity to still receive collision events (`Collision.depth`, `Collision.nx`/`ny`) without any physical response — the entity won't be pushed, and other entities won't be pushed by it. This is useful for pickups, triggers, or grid-based games where you want to detect overlap yourself without physics involved.
86
90
 
87
91
  ## Entity Querying
88
92
 
@@ -104,19 +108,40 @@ This makes it easy to build entity groups naturally through naming. No extra con
104
108
  { collisions: [{ a: 'player', b: 'enemy' }], onTick: (_, collisions) => {} }
105
109
  ```
106
110
 
111
+ Collision results include a normalized direction vector (`nx`/`ny`) pointing along the minimum separating axis, alongside the penetration `depth` — useful for resolving collisions manually or reacting to a specific direction of impact.
112
+
113
+ ## Assets
114
+
115
+ Assets (SVGs and Lottie animations) must be preloaded with `loadAssets` before being referenced by `id`, `px`/`py`, or any `configure`/`spawn`/`update` call. Loading happens off the JS thread and is cached — calling `loadAssets` again with the same source is a no-op.
116
+
117
+ ```ts
118
+ import { loadAssets } from 'rngine';
119
+
120
+ const assets = await loadAssets({
121
+ player: require('./assets/player.svg'),
122
+ explosion: require('./assets/explosion.json'), // Lottie
123
+ });
124
+
125
+ // assets.player and assets.explosion are numeric ids, ready to use as `asset` on any entity or the screen
126
+ ```
127
+
107
128
  ## API
108
129
 
109
130
  ### `configure(config)`
110
131
 
111
132
  Sets up the game engine. Call this before anything else.
112
133
 
113
- | param | required | type | default | description |
114
- | ---------- | -------- | ---------- | ------- | -------------------------------------- |
115
- | `tickRate` | ✓ | `number` | - | Game logic updates per second |
116
- | `screen` | ✓ | `Screen` | - | Screen dimensions and background color |
117
- | `entities` | | `Entity[]` | `[]` | Initial entities to spawn |
118
- | `systems` | | `System[]` | `[]` | Systems to run each tick |
119
- | `paused` | | `boolean` | `true` | Whether to start paused |
134
+ | param | required | type | default | description |
135
+ | ---------- | -------- | ---------- | ------- | --------------------------------------------- |
136
+ | `world` | ✓ | `World` | - | Tick rate and optional gravity |
137
+ | `screen` | ✓ | `Screen` | - | Screen dimensions, background color and asset |
138
+ | `entities` | | `Entity[]` | `[]` | Initial entities to spawn |
139
+ | `systems` | | `System[]` | `[]` | Systems to run each tick |
140
+ | `paused` | | `boolean` | `true` | Whether to start paused |
141
+
142
+ ### `loadAssets(assets)`
143
+
144
+ Preloads one or more SVG or Lottie assets ahead of time. Takes an object mapping names to `require(...)` sources (SVG) or imported JSON (Lottie), and resolves to an object of the same shape with numeric asset ids.
120
145
 
121
146
  ### `spawn(entity | entity[])`
122
147
 
@@ -4,15 +4,43 @@ cmake_minimum_required(VERSION 3.9.0)
4
4
  set(PACKAGE_NAME rngine)
5
5
  set(CMAKE_VERBOSE_MAKEFILE ON)
6
6
  set(CMAKE_CXX_STANDARD 20)
7
+ set(SKIA_ROOT ${CMAKE_SOURCE_DIR}/../shared/skia)
8
+ set(SKIA_LIBS_ROOT ${CMAKE_SOURCE_DIR}/../node_modules/react-native-skia-android/libs/${ANDROID_ABI})
9
+
10
+ add_library(skia STATIC IMPORTED)
11
+ set_property(TARGET skia PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_ROOT}/libskia.a")
12
+
13
+ add_library(skia_svg STATIC IMPORTED)
14
+ set_property(TARGET skia_svg PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_ROOT}/libsvg.a")
15
+
16
+ add_library(skia_skottie STATIC IMPORTED)
17
+ set_property(TARGET skia_skottie PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_ROOT}/libskottie.a")
18
+
19
+ add_library(skia_sksg STATIC IMPORTED)
20
+ set_property(TARGET skia_sksg PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_ROOT}/libsksg.a")
21
+
22
+ add_library(skia_skshaper STATIC IMPORTED)
23
+ set_property(TARGET skia_skshaper PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_ROOT}/libskshaper.a")
24
+
25
+ add_library(skia_skunicode_core STATIC IMPORTED)
26
+ set_property(TARGET skia_skunicode_core PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_ROOT}/libskunicode_core.a")
27
+
28
+ add_library(skia_skunicode_icu STATIC IMPORTED)
29
+ set_property(TARGET skia_skunicode_icu PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_ROOT}/libskunicode_icu.a")
30
+
31
+ add_library(skia_jsonreader STATIC IMPORTED)
32
+ set_property(TARGET skia_jsonreader PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_ROOT}/libjsonreader.a")
7
33
 
8
34
  # Define C++ library and add all sources
9
35
  add_library(
10
36
  ${PACKAGE_NAME}
11
37
  SHARED
12
38
  src/main/cpp/cpp-adapter.cpp
13
- src/main/cpp/GameLoopJNI.cpp
39
+ src/main/cpp/game-view.cpp
14
40
  ../shared/GameLoop.cpp
41
+ ../shared/GameRenderer.cpp
15
42
  ../shared/GameMethods.cpp
43
+ ../shared/ColorUtils.cpp
16
44
  ../shared/CollisionUtils.cpp
17
45
  )
18
46
 
@@ -20,7 +48,11 @@ add_library(
20
48
  include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/rngine+autolinking.cmake)
21
49
 
22
50
  # Set up local includes
23
- include_directories("src/main/cpp" "../shared")
51
+ include_directories(
52
+ "src/main/cpp"
53
+ "../shared"
54
+ "${SKIA_ROOT}"
55
+ )
24
56
 
25
57
  find_library(LOG_LIB log)
26
58
 
@@ -29,4 +61,15 @@ target_link_libraries(
29
61
  ${PACKAGE_NAME}
30
62
  ${LOG_LIB}
31
63
  android # <-- Android core
64
+ skia_skottie
65
+ skia_sksg
66
+ skia_svg
67
+ skia_skshaper
68
+ skia_skunicode_core
69
+ skia_skunicode_icu
70
+ skia_jsonreader
71
+ skia
72
+ jnigraphics
73
+ EGL
74
+ GLESv3
32
75
  )
@@ -20,7 +20,7 @@ buildscript {
20
20
  }
21
21
 
22
22
  dependencies {
23
- classpath "com.android.tools.build:gradle:8.7.2"
23
+ classpath "com.android.tools.build:gradle:9.1.1"
24
24
  // noinspection DifferentKotlinGradleVersion
25
25
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
26
26
  }
@@ -119,6 +119,4 @@ android {
119
119
  dependencies {
120
120
  implementation "com.facebook.react:react-android"
121
121
  implementation project(":react-native-nitro-modules")
122
- implementation 'com.caverock:androidsvg-aar:1.4'
123
- implementation 'com.airbnb.android:lottie:6.7.1'
124
122
  }
Binary file
@@ -0,0 +1,29 @@
1
+ #include "GameRenderer.hpp"
2
+ #include <android/native_window_jni.h>
3
+ #include <jni.h>
4
+
5
+ extern "C" JNIEXPORT void JNICALL
6
+ Java_com_margelo_nitro_rngine_GameView_nativeOnSurfaceCreated(JNIEnv *env,
7
+ jobject instance,
8
+ jobject surface) {
9
+
10
+ ANativeWindow *nativeWindow = ANativeWindow_fromSurface(env, surface);
11
+ margelo::nitro::rngine::GameRenderer::getInstance().onSurfaceCreated(
12
+ nativeWindow);
13
+ }
14
+
15
+ extern "C" JNIEXPORT void JNICALL
16
+ Java_com_margelo_nitro_rngine_GameView_nativeOnSurfaceChanged(JNIEnv *env,
17
+ jobject instance,
18
+ jint width,
19
+ jint height) {
20
+
21
+ margelo::nitro::rngine::GameRenderer::getInstance().onSurfaceChanged(width,
22
+ height);
23
+ }
24
+
25
+ extern "C" JNIEXPORT void JNICALL
26
+ Java_com_margelo_nitro_rngine_GameView_nativeOnSurfaceDestroyed(
27
+ JNIEnv *env, jobject instance) {
28
+ margelo::nitro::rngine::GameRenderer::getInstance().onSurfaceDestroyed();
29
+ }
@@ -1,34 +1,7 @@
1
1
  package com.margelo.nitro.rngine
2
2
 
3
- import android.os.Handler
4
- import android.os.HandlerThread
5
- import android.view.Choreographer
6
3
  import com.facebook.react.uimanager.ThemedReactContext
7
4
 
8
5
  class GameEngine(val context: ThemedReactContext) : HybridGameEngineSpec() {
9
- private var renderThread: HandlerThread? = null
10
- private var renderHandler: Handler? = null
11
-
12
- private val frameCallback = object : Choreographer.FrameCallback {
13
- override fun doFrame(frameTimeNanos: Long) {
14
- renderHandler?.post { view.drawFrame() }
15
- Choreographer.getInstance().postFrameCallback(this)
16
- }
17
- }
18
-
19
- override val view: GameView = GameView(
20
- context
21
- ).apply {
22
- onAttached = {
23
- renderThread = HandlerThread("RenderThread").also { it.start() }
24
- renderHandler = Handler(renderThread!!.looper)
25
- Choreographer.getInstance().postFrameCallback(frameCallback)
26
- }
27
- onDetached = {
28
- Choreographer.getInstance().removeFrameCallback(frameCallback)
29
- renderThread?.quitSafely()
30
- renderThread = null
31
- renderHandler = null
32
- }
33
- }
6
+ override val view: GameView = GameView(context)
34
7
  }
@@ -1,187 +1,43 @@
1
1
  package com.margelo.nitro.rngine
2
2
 
3
3
  import android.content.Context
4
- import android.graphics.Canvas
5
- import android.graphics.Paint
6
- import android.util.AttributeSet
4
+ import android.view.Surface
5
+ import android.view.SurfaceHolder
7
6
  import android.view.SurfaceView
8
- import android.view.View
9
- import androidx.core.graphics.withTranslation
10
- import androidx.core.graphics.withClip
11
7
 
12
8
  class GameView(
13
9
  context: Context,
14
- attrs: AttributeSet? = null,
15
- defStyleAttr: Int = 0,
16
10
  ) : SurfaceView(
17
11
  context,
18
- attrs,
19
- defStyleAttr,
20
- ) {
21
- private external fun getSnapshot(): ByteArray
22
- var onAttached: () -> Unit = {}
23
- var onDetached: () -> Unit = {}
12
+ ),
13
+ SurfaceHolder.Callback {
14
+ private external fun nativeOnSurfaceCreated(surface: Surface)
24
15
 
25
- private val paint = Paint().apply {
26
- style = Paint.Style.FILL
27
- }
28
-
29
- private fun drawAsset(
30
- canvas: Canvas,
31
- left: Float,
32
- top: Float,
33
- right: Float,
34
- bottom: Float,
35
- asset: Int,
36
- progress: Float?,
37
- ) {
38
- canvas.withTranslation(left, top) {
39
- when (val resolvedAsset = GameAssets.getAsset(asset)) {
40
- is Asset.Svg -> {
41
- scale(
42
- (right - left) / resolvedAsset.picture.width,
43
- (bottom - top) / resolvedAsset.picture.height
44
- )
45
- drawPicture(resolvedAsset.picture)
46
- }
16
+ private external fun nativeOnSurfaceChanged(
17
+ width: Int,
18
+ height: Int,
19
+ )
47
20
 
48
- is Asset.Lottie -> {
49
- progress?.let {
50
- resolvedAsset.drawable.progress = it
51
- }
52
- resolvedAsset.drawable.setBounds(0, 0, (right - left).toInt(), (bottom - top).toInt())
53
- resolvedAsset.drawable.draw(canvas)
54
- }
21
+ private external fun nativeOnSurfaceDestroyed()
55
22
 
56
- null -> {}
57
- }
58
- }
23
+ init {
24
+ holder.addCallback(this)
59
25
  }
60
26
 
61
- private fun drawRect(
62
- canvas: Canvas,
63
- left: Float,
64
- top: Float,
65
- right: Float,
66
- bottom: Float,
67
- color: Int,
68
- asset: Int,
69
- progress: Float?,
70
- ) {
71
- paint.color = color
72
- canvas.drawRect(left, top, right, bottom, paint)
73
-
74
- drawAsset(
75
- canvas,
76
- left,
77
- top,
78
- right,
79
- bottom,
80
- asset,
81
- progress
82
- )
27
+ override fun surfaceCreated(holder: SurfaceHolder) {
28
+ nativeOnSurfaceCreated(holder.surface)
83
29
  }
84
30
 
85
- private fun drawCircle(
86
- canvas: Canvas,
87
- cx: Float,
88
- cy: Float,
89
- radius: Float,
90
- color: Int,
91
- asset: Int,
92
- progress: Float?,
31
+ override fun surfaceChanged(
32
+ holder: SurfaceHolder,
33
+ format: Int,
34
+ width: Int,
35
+ height: Int,
93
36
  ) {
94
- val left = cx - radius
95
- val top = cy - radius
96
- val right = cx + radius
97
- val bottom = cy + radius
98
-
99
- paint.color = color
100
- canvas.drawCircle(cx, cy, radius, paint)
101
-
102
- drawAsset(
103
- canvas,
104
- left,
105
- top,
106
- right,
107
- bottom,
108
- asset,
109
- progress,
110
- )
111
- }
112
-
113
- init {
114
- addOnAttachStateChangeListener(
115
- object : OnAttachStateChangeListener {
116
- override fun onViewAttachedToWindow(view: View) = onAttached()
117
- override fun onViewDetachedFromWindow(view: View) = onDetached()
118
- })
37
+ nativeOnSurfaceChanged(width, height)
119
38
  }
120
39
 
121
- fun drawFrame() {
122
- if (!holder.surface.isValid) return
123
- val canvas = holder.lockCanvas() ?: return
124
- val snapshot = SnapshotSerializer.decode(getSnapshot())
125
-
126
- val scaleX = canvas.width / snapshot.screen.width
127
- val scaleY = canvas.height / snapshot.screen.height
128
- val scale = minOf(scaleX, scaleY)
129
-
130
- val screenLeft = (canvas.width - snapshot.screen.width * scale) / 2f
131
- val screenTop = (canvas.height - snapshot.screen.height * scale) / 2f
132
- val screenRight = screenLeft + snapshot.screen.width * scale
133
- val screenBottom = screenTop + snapshot.screen.height * scale
134
-
135
- drawRect(
136
- canvas,
137
- screenLeft,
138
- screenTop,
139
- screenRight,
140
- screenBottom,
141
- snapshot.screen.color,
142
- snapshot.screen.asset,
143
- snapshot.screen.progress,
144
- )
145
-
146
- canvas.withClip(screenLeft, screenTop, screenRight, screenBottom) {
147
- snapshot.shapes.forEach { shape ->
148
- when (shape) {
149
- is Shape.Rect -> {
150
- val left = shape.left * scale + screenLeft
151
- val top = shape.top * scale + screenTop
152
- val right = shape.right * scale + screenLeft
153
- val bottom = shape.bottom * scale + screenTop
154
-
155
- drawRect(
156
- canvas,
157
- left,
158
- top,
159
- right,
160
- bottom,
161
- shape.color,
162
- shape.asset,
163
- shape.progress,
164
- )
165
- }
166
-
167
- is Shape.Circle -> {
168
- val cx = shape.px * scale + screenLeft
169
- val cy = shape.py * scale + screenTop
170
- val radius = shape.radius * scale
171
-
172
- drawCircle(
173
- canvas,
174
- cx,
175
- cy,
176
- radius,
177
- shape.color,
178
- shape.asset,
179
- shape.progress,
180
- )
181
- }
182
- }
183
- }
184
- }
185
- holder.unlockCanvasAndPost(canvas)
40
+ override fun surfaceDestroyed(holder: SurfaceHolder) {
41
+ nativeOnSurfaceDestroyed()
186
42
  }
187
43
  }
@@ -0,0 +1,24 @@
1
+ package com.margelo.nitro.rngine
2
+
3
+ import androidx.annotation.Keep
4
+ import com.margelo.nitro.NitroModules
5
+ import java.net.URL
6
+
7
+ @Keep
8
+ object SvgLoaderHelper {
9
+ @JvmStatic
10
+ fun loadFromUrl(uri: String): ByteArray {
11
+ return URL(uri).openStream().use { it.readBytes() }
12
+ }
13
+
14
+ @JvmStatic
15
+ fun loadFromResource(uri: String): ByteArray {
16
+ val context = NitroModules.applicationContext
17
+ ?: throw IllegalStateException("No Context available!")
18
+ val resId = context.resources.getIdentifier(uri, "raw", context.packageName)
19
+ if (resId == 0) {
20
+ throw IllegalStateException("Could not resolve raw resource for asset: $uri")
21
+ }
22
+ return context.resources.openRawResource(resId).use { it.readBytes() }
23
+ }
24
+ }
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  import { gameMethods } from "./GameMethods.nitro.js";
4
+ import { Image } from 'react-native';
5
+
4
6
  /** Sets up the game engine with the given configuration. Call this before anything else. */
5
7
  export const configure = ({
6
8
  world,
@@ -53,4 +55,46 @@ export const update = updates => {
53
55
  const entityUpdateArray = Array.isArray(updates) ? updates : [updates];
54
56
  gameMethods.update(entityUpdateArray);
55
57
  };
58
+ const assetCache = new WeakMap();
59
+ let nextId = -1;
60
+ const loadAsset = async asset => {
61
+ switch (typeof asset) {
62
+ case 'object':
63
+ if (asset === null) {
64
+ throw new Error('loadAssets: asset cannot be null');
65
+ }
66
+ if (assetCache.has(asset)) {
67
+ return assetCache.get(asset);
68
+ }
69
+ const assetId = nextId--;
70
+ assetCache.set(asset, assetId);
71
+ const isLottieLoaded = await gameMethods.loadLottie(assetId, JSON.stringify(asset));
72
+ if (!isLottieLoaded) {
73
+ throw new Error('loadAssets: Failed to load lottie asset');
74
+ }
75
+ return assetId;
76
+ case 'number':
77
+ if (gameMethods.isAssetLoaded(asset)) {
78
+ return asset;
79
+ }
80
+ const assetUri = Image.resolveAssetSource(asset)?.uri;
81
+ if (!assetUri) {
82
+ throw new Error(`loadAssets: could not resolve asset URI for ${asset}`);
83
+ }
84
+ const isSvgLoaded = await gameMethods.loadSvg(asset, assetUri);
85
+ if (!isSvgLoaded) {
86
+ throw new Error('loadAssets: Failed to load svg asset');
87
+ }
88
+ return asset;
89
+ }
90
+ throw new Error(`loadAssets: unsupported asset type "${typeof asset}"`);
91
+ };
92
+ export const loadAssets = async assets => {
93
+ const keys = Object.keys(assets);
94
+ const result = {};
95
+ for (const key of keys) {
96
+ result[key] = await loadAsset(assets[key]);
97
+ }
98
+ return result;
99
+ };
56
100
  //# sourceMappingURL=GameMethods.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["gameMethods","configure","world","screen","entities","systems","paused","nativeSystems","system","push","collisions","onTick","e","c","start","Date","now","finish","setWorld","setScreen","setEntities","setSystems","pause","resume","spawn","entityArray","Array","isArray","despawn","id","update","updates","entityUpdateArray"],"sourceRoot":"../../src","sources":["GameMethods.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,wBAAqB;AAIjD;AACA,OAAO,MAAMC,SAAS,GAAGA,CAAC;EACxBC,K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J,WAAW,CAACwB,KAAK,CAACC,WAAW,CAAC;AAChC,CAAC;;AAED;AACA,OAAO,MAAMG,OAAO,GAAIC,EAAU,IAAK7B,WAAW,CAAC4B,OAAO,CAACC,EAAE,CAAC;;AAE9D;AACA,OAAO,MAAMC,MAAM,GAAIC,OAAsC,IAAK;EAChE,MAAMC,iBAAiB,GAAGN,KAAK,CAACC,OAAO,CAACI,OAAO,CAAC,GAAGA,OAAO,GAAG,CAACA,OAAO,CAAC;EACtE/B,WAAW,CAAC8B,MAAM,CAACE,iBAAiB,CAAC;AACvC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["gameMethods","Image","configure","world","screen","entities","systems","paused","nativeSystems","system","push","collisions","onTick","e","c","start","Date","now","finish","setWorld","setScreen","setEntities","setSystems","pause","resume","spawn","entityArray","Array","isArray","despawn","id","update","updates","entityUpdateArray","assetCache","WeakMap","nextId","loadAsset","asset","Error","has","get","assetId","set","isLottieLoaded","loadLottie","JSON","stringify","isAssetLoaded","assetUri","resolveAssetSource","uri","isSvgLoaded","loadSvg","loadAssets","assets","keys","Object","result","key"],"sourceRoot":"../../src","sources":["GameMethods.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,wBAAqB;AAGjD,SAASC,KAAK,QAAQ,cAAc;;AAEpC;AACA,OAAO,MAAMC,SAAS,GAAGA,CAAC;EACxBC,KAAK;EACLC,MAAM;EACNC,QAAQ,GAAG,EAAE;EACbC,OAAO,GAAG,EAAE;EACZC,MAAM,GAAG;AACH,CAAC,KAAK;EACZ,IAAIC,aAAuB,GAAG,EAAE;EAEhC,KAAK,MAAMC,MAAM,IAAIH,OAAO,EAAE;IAC5BE,aAAa,CAACE,IAAI,CAAC;MACjBL,QAAQ,EAAEI,MAAM,CAACJ,QAAQ;MACzBM,UAAU,EAAEF,MAAM,CAACE,UAAU;MAC7BC,MAAM,EAAEA,CAACC,CAAC,EAAEC,CAAC,KAAK;QAChB,MAAMC,KAAK,GAAGC,IAAI,CAACC,GAAG,C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,MACxBC,MAAS,IAC+B;EACxC,MAAMC,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACD,MAAM,CAAgB;EAC/C,MAAMG,MAAM,GAAG,CAAC,CAA+B;EAE/C,KAAK,MAAMC,GAAG,IAAIH,IAAI,EAAE;IACtBE,MAAM,CAACC,GAAG,CAAC,GAAG,MAAMtB,SAAS,CAACkB,MAAM,CAACI,GAAG,CAAC,CAAC;EAC5C;EAEA,OAAOD,MAAM;AACf,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["NitroModules","gameMethods","createHybridObject"],"sourceRoot":"../../src","sources":["GameMethods.nitro.ts"],"mappings":";;AAQA,SAASA,YAAY,QAAQ,4BAA4B;AAiBzD,OAAO,MAAMC,WAAW,GACtBD,YAAY,CAACE,kBAAkB,CAAc,aAAa,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["NitroModules","gameMethods","createHybridObject"],"sourceRoot":"../../src","sources":["GameMethods.nitro.ts"],"mappings":";;AAQA,SAASA,YAAY,QAAQ,4BAA4B;AAqBzD,OAAO,MAAMC,WAAW,GACtBD,YAAY,CAACE,kBAAkB,CAAc,aAAa,CAAC","ignoreList":[]}
@@ -2,7 +2,6 @@
2
2
 
3
3
  import GameEngine from "./GameEngine.js";
4
4
  export * from "./GameMethods.js";
5
- export * from "./GameAssets.js";
6
5
  export * from "./types.js";
7
6
  export { GameEngine };
8
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["GameEngine"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,UAAU,MAAM,iBAAc;AAErC,cAAc,kBAAe;AAC7B,cAAc,iBAAc;AAC5B,cAAc,YAAS;AASvB,SAASA,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["GameEngine"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,UAAU,MAAM,iBAAc;AAErC,cAAc,kBAAe;AAC7B,cAAc,YAAS;AASvB,SAASA,UAAU","ignoreList":[]}
@@ -12,4 +12,5 @@ export declare const spawn: (entities: Entity | Entity[]) => void;
12
12
  export declare const despawn: (id: string) => void;
13
13
  /** Updates one or more entities. Only the provided fields are changed. */
14
14
  export declare const update: (updates: EntityUpdate | EntityUpdate[]) => void;
15
+ export declare const loadAssets: <T extends Record<string, unknown>>(assets: T) => Promise<{ [K in keyof T]: number; }>;
15
16
  //# sourceMappingURL=GameMethods.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GameMethods.d.ts","sourceRoot":"","sources":["../../../src/GameMethods.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAU,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,4FAA4F;AAC5F,eAAO,MAAM,SAAS,GAAI,+CAMvB,MAAM,SAyBR,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,KAAK,YAA4B,CAAC;AAE/C,6BAA6B;AAC7B,eAAO,MAAM,MAAM,YAA6B,CAAC;AAEjD,0EAA0E;AAC1E,eAAO,MAAM,KAAK,GAAI,UAAU,MAAM,GAAG,MAAM,EAAE,SAGhD,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,OAAO,GAAI,IAAI,MAAM,SAA4B,CAAC;AAE/D,0EAA0E;AAC1E,eAAO,MAAM,MAAM,GAAI,SAAS,YAAY,GAAG,YAAY,EAAE,SAG5D,CAAC"}
1
+ {"version":3,"file":"GameMethods.d.ts","sourceRoot":"","sources":["../../../src/GameMethods.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAU,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,4FAA4F;AAC5F,eAAO,MAAM,SAAS,GAAI,+CAMvB,MAAM,SAyBR,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,KAAK,YAA4B,CAAC;AAE/C,6BAA6B;AAC7B,eAAO,MAAM,MAAM,YAA6B,CAAC;AAEjD,0EAA0E;AAC1E,eAAO,MAAM,KAAK,GAAI,UAAU,MAAM,GAAG,MAAM,EAAE,SAGhD,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,OAAO,GAAI,IAAI,MAAM,SAA4B,CAAC;AAE/D,0EAA0E;AAC1E,eAAO,MAAM,MAAM,GAAI,SAAS,YAAY,GAAG,YAAY,EAAE,SAG5D,CAAC;AA2CF,eAAO,MAAM,UAAU,GAAU,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,QAAQ,CAAC,KACR,OAAO,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,GAAE,CASpC,CAAC"}
@@ -13,6 +13,9 @@ interface GameMethods extends HybridObject<{
13
13
  spawn(entities: Entity[]): void;
14
14
  despawn(id: string): void;
15
15
  update(updates: EntityUpdate[]): void;
16
+ isAssetLoaded(id: number): boolean;
17
+ loadLottie(id: number, jsonStr: string): Promise<boolean>;
18
+ loadSvg(id: number, svgUri: string): Promise<boolean>;
16
19
  }
17
20
  export declare const gameMethods: GameMethods;
18
21
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"GameMethods.nitro.d.ts","sourceRoot":"","sources":["../../../src/GameMethods.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EACV,MAAM,EACN,YAAY,EACZ,MAAM,EACN,MAAM,EACN,KAAK,EACN,MAAM,eAAe,CAAC;AAGvB,UAAU,WAAY,SAAQ,YAAY,CAAC;IACzC,GAAG,EAAE,KAAK,CAAC;IACX,OAAO,EAAE,KAAK,CAAC;CAChB,CAAC;IACA,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACh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AAE,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACvD;AAED,eAAO,MAAM,WAAW,aACqC,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import GameEngine from './GameEngine';
2
2
  export * from './GameMethods';
3
- export * from './GameAssets';
4
3
  export * from './types';
5
4
  export type { World, Screen, Entity, CollisionPair, Collision, EntityUpdate, } from './nativeTypes';
6
5
  export { GameEngine };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,YAAY,EACV,KAAK,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,SAAS,EACT,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,YAAY,EACV,KAAK,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,SAAS,EACT,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,CAAC"}