@lewismoten/gamemaker-sandbox-tools 3.1.0 → 3.4.0

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 (343) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/NOTICE.md +105 -3
  3. package/README.md +301 -15
  4. package/dist/audio-files.js +82 -0
  5. package/dist/audio.js +23 -138
  6. package/dist/block-merge.js +43 -0
  7. package/dist/color-reduce.js +44 -0
  8. package/dist/colors.js +87 -0
  9. package/dist/delta.js +75 -0
  10. package/dist/disk-diff.js +220 -0
  11. package/dist/drawing.js +83 -869
  12. package/dist/embroidery/compile.js +85 -0
  13. package/dist/embroidery/dst.js +79 -0
  14. package/dist/embroidery/exp.js +26 -0
  15. package/dist/embroidery/fill.js +49 -0
  16. package/dist/embroidery/geom.js +82 -0
  17. package/dist/embroidery/pes.js +79 -0
  18. package/dist/embroidery/satin.js +29 -0
  19. package/dist/embroidery/simulate.js +30 -0
  20. package/dist/embroidery/strokeFont.js +253 -0
  21. package/dist/embroidery/svg.js +24 -0
  22. package/dist/embroidery/types.js +13 -0
  23. package/dist/embroidery/units.js +26 -0
  24. package/dist/embroidery/validate.js +15 -0
  25. package/dist/formats/blocks.js +1 -103
  26. package/dist/formats/character.js +1 -83
  27. package/dist/formats/cmf.js +1 -37
  28. package/dist/formats/fli.js +1 -296
  29. package/dist/formats/fliLimits.js +1 -54
  30. package/dist/formats/game.js +1 -193
  31. package/dist/formats/gif.js +1 -125
  32. package/dist/formats/graphicScripts.js +1 -44
  33. package/dist/formats/map.js +1 -38
  34. package/dist/formats/monster.js +1 -69
  35. package/dist/formats/palette.js +1 -58
  36. package/dist/formats/recording.js +1 -17
  37. package/dist/formats/sound.js +1 -44
  38. package/dist/formats/voc.js +1 -303
  39. package/dist/gif-shrink.js +56 -0
  40. package/dist/image/png.js +42 -0
  41. package/dist/images.js +81 -43
  42. package/dist/kit/actors.js +19 -0
  43. package/dist/kit/align.js +204 -0
  44. package/dist/kit/blit.js +45 -0
  45. package/dist/kit/blockRoles.js +97 -0
  46. package/dist/kit/clips.js +40 -0
  47. package/dist/kit/coverPaint.js +18 -0
  48. package/dist/kit/disk.js +76 -0
  49. package/dist/kit/fadeOut.js +13 -0
  50. package/dist/kit/fliClips.js +133 -0
  51. package/dist/kit/fliShrink.js +277 -0
  52. package/dist/kit/gameSim.js +235 -0
  53. package/dist/kit/hopBot.js +142 -0
  54. package/dist/kit/levelGen.js +1423 -0
  55. package/dist/kit/levelGrid.js +33 -0
  56. package/dist/kit/levelPicture.js +27 -0
  57. package/dist/kit/menuVersion.js +19 -0
  58. package/dist/kit/microText.js +35 -0
  59. package/dist/kit/mumble.js +74 -0
  60. package/dist/kit/music.js +8 -0
  61. package/dist/kit/palRamps.js +32 -0
  62. package/dist/kit/palette.js +49 -0
  63. package/dist/kit/pcText.js +72 -0
  64. package/dist/kit/photo.js +150 -0
  65. package/dist/kit/pixels.js +79 -0
  66. package/dist/kit/png.js +40 -0
  67. package/dist/kit/quantize.js +72 -0
  68. package/dist/kit/raytrace.js +379 -0
  69. package/dist/kit/recordedDemo.js +10 -0
  70. package/dist/kit/reel.js +77 -0
  71. package/dist/kit/road3d.js +67 -0
  72. package/dist/kit/routeChecks.js +8 -0
  73. package/dist/kit/saveSlots.js +11 -0
  74. package/dist/kit/sceneInit.js +13 -0
  75. package/dist/kit/sceneSim.js +112 -0
  76. package/dist/kit/screenText.js +15 -0
  77. package/dist/kit/sdftext.js +237 -0
  78. package/dist/kit/shading.js +69 -0
  79. package/dist/kit/song.js +251 -0
  80. package/dist/kit/songFx.js +179 -0
  81. package/dist/kit/sound.js +52 -0
  82. package/dist/kit/synthParts.js +20 -0
  83. package/dist/kit/tar.js +53 -0
  84. package/dist/kit/textBounds.js +84 -0
  85. package/dist/kit/textfit.js +246 -0
  86. package/dist/kit/transforms.js +57 -0
  87. package/dist/kit/tune.js +21 -0
  88. package/dist/look-alike.js +50 -0
  89. package/dist/menu-version.js +4 -0
  90. package/dist/mesh/colorBodies.js +137 -0
  91. package/dist/mesh/decimate.js +207 -0
  92. package/dist/mesh/meshCheck.js +51 -0
  93. package/dist/mesh/overhang.js +41 -0
  94. package/dist/mesh/sampledField.js +12 -0
  95. package/dist/mesh/stl.js +36 -0
  96. package/dist/mesh/surfaceNets.js +79 -0
  97. package/dist/mesh/tetraMesh.js +62 -0
  98. package/dist/mesh/threeMf.js +58 -0
  99. package/dist/mesh/zipFile.js +52 -0
  100. package/dist/microFont.js +101 -0
  101. package/dist/music/compose.js +72 -0
  102. package/dist/pack/meshPack.js +198 -0
  103. package/dist/pack/threeMfPack.js +92 -0
  104. package/dist/palette-reserve.js +116 -0
  105. package/dist/palettes.js +138 -0
  106. package/dist/release-notes.js +40 -0
  107. package/dist/simulation.js +16 -2774
  108. package/dist/text.js +74 -0
  109. package/dist/types/audio.d.ts +4 -0
  110. package/dist/types/audioFiles.d.ts +22 -0
  111. package/dist/types/audioWav.d.ts +4 -0
  112. package/dist/types/blockMerge.d.ts +24 -0
  113. package/dist/types/colorReduce.d.ts +23 -0
  114. package/dist/types/{web/packages/tools/src/colors.d.ts → colors.d.ts} +6 -0
  115. package/dist/types/delta.d.ts +32 -0
  116. package/dist/types/diskDiff.d.ts +47 -0
  117. package/dist/types/drawing.d.ts +15 -0
  118. package/dist/types/embroidery/compile.d.ts +3 -0
  119. package/dist/types/embroidery/dst.d.ts +13 -0
  120. package/dist/types/embroidery/exp.d.ts +8 -0
  121. package/dist/types/embroidery/fill.d.ts +6 -0
  122. package/dist/types/embroidery/geom.d.ts +19 -0
  123. package/dist/types/embroidery/pes.d.ts +10 -0
  124. package/dist/types/embroidery/satin.d.ts +11 -0
  125. package/dist/types/embroidery/simulate.d.ts +19 -0
  126. package/dist/types/embroidery/strokeFont.d.ts +20 -0
  127. package/dist/types/embroidery/svg.d.ts +3 -0
  128. package/dist/types/embroidery/types.d.ts +70 -0
  129. package/dist/types/embroidery/units.d.ts +10 -0
  130. package/dist/types/embroidery/validate.d.ts +22 -0
  131. package/dist/types/formats/blocks.d.ts +1 -0
  132. package/dist/types/formats/character.d.ts +1 -0
  133. package/dist/types/formats/cmf.d.ts +1 -0
  134. package/dist/types/formats/fli.d.ts +1 -0
  135. package/dist/types/formats/fliLimits.d.ts +1 -0
  136. package/dist/types/formats/game.d.ts +1 -0
  137. package/dist/types/formats/gif.d.ts +1 -0
  138. package/dist/types/formats/graphicScripts.d.ts +1 -0
  139. package/dist/types/formats/map.d.ts +1 -0
  140. package/dist/types/formats/monster.d.ts +1 -0
  141. package/dist/types/formats/palette.d.ts +1 -0
  142. package/dist/types/formats/recording.d.ts +1 -0
  143. package/dist/types/formats/sound.d.ts +1 -0
  144. package/dist/types/formats/voc.d.ts +1 -0
  145. package/dist/types/gifShrink.d.ts +8 -0
  146. package/dist/types/image/animatedGif.d.ts +9 -0
  147. package/dist/types/image/surface.d.ts +26 -0
  148. package/dist/types/images.d.ts +13 -0
  149. package/dist/types/kit/actors.d.ts +7 -0
  150. package/dist/types/kit/align.d.ts +93 -0
  151. package/dist/types/kit/audioEvents.d.ts +26 -0
  152. package/dist/types/kit/blit.d.ts +20 -0
  153. package/dist/types/kit/blockRoles.d.ts +243 -0
  154. package/dist/types/{games/kit → kit}/clips.d.ts +1 -1
  155. package/dist/types/kit/coverPaint.d.ts +7 -0
  156. package/dist/types/kit/disk.d.ts +15 -0
  157. package/dist/types/kit/fadeOut.d.ts +12 -0
  158. package/dist/types/kit/fliClips.d.ts +32 -0
  159. package/dist/types/kit/fliShrink.d.ts +149 -0
  160. package/dist/types/{games/kit → kit}/gameSim.d.ts +9 -5
  161. package/dist/types/kit/hopBot.d.ts +72 -0
  162. package/dist/types/kit/laserClearance.d.ts +16 -0
  163. package/dist/types/kit/laserJoints.d.ts +39 -0
  164. package/dist/types/kit/laserLayout.d.ts +54 -0
  165. package/dist/types/kit/laserPixels.d.ts +52 -0
  166. package/dist/types/kit/laserPreview.d.ts +9 -0
  167. package/dist/types/kit/laserSvg.d.ts +35 -0
  168. package/dist/types/kit/levelGen/castle.d.ts +17 -0
  169. package/dist/types/kit/levelGen/dungeon.d.ts +11 -0
  170. package/dist/types/kit/levelGen/forest.d.ts +17 -0
  171. package/dist/types/kit/levelGen/furnish.d.ts +31 -0
  172. package/dist/types/kit/levelGen/grid.d.ts +46 -0
  173. package/dist/types/kit/levelGen/index.d.ts +138 -0
  174. package/dist/types/kit/levelGen/interior.d.ts +18 -0
  175. package/dist/types/kit/levelGen/jumpModel.d.ts +78 -0
  176. package/dist/types/kit/levelGen/needs.d.ts +44 -0
  177. package/dist/types/kit/levelGen/overworld.d.ts +21 -0
  178. package/dist/types/kit/levelGen/platform.d.ts +59 -0
  179. package/dist/types/kit/levelGen/platformCap.d.ts +13 -0
  180. package/dist/types/kit/levelGen/platformReach.d.ts +37 -0
  181. package/dist/types/kit/levelGen/props.d.ts +37 -0
  182. package/dist/types/kit/levelGen/town.d.ts +24 -0
  183. package/dist/types/kit/levelGrid.d.ts +16 -0
  184. package/dist/types/kit/levelPicture.d.ts +9 -0
  185. package/dist/types/kit/menuVersion.d.ts +7 -0
  186. package/dist/types/kit/microText.d.ts +18 -0
  187. package/dist/types/kit/mumble.d.ts +41 -0
  188. package/dist/types/kit/music.d.ts +1 -0
  189. package/dist/types/kit/palMerge.d.ts +10 -0
  190. package/dist/types/kit/palRamps.d.ts +28 -0
  191. package/dist/types/kit/pcText.d.ts +19 -0
  192. package/dist/types/kit/photo.d.ts +69 -0
  193. package/dist/types/kit/png.d.ts +7 -0
  194. package/dist/types/kit/quantize.d.ts +20 -0
  195. package/dist/types/kit/raytrace.d.ts +169 -0
  196. package/dist/types/kit/recordedDemo.d.ts +1 -0
  197. package/dist/types/kit/road3d.d.ts +71 -0
  198. package/dist/types/kit/routeChecks.d.ts +6 -0
  199. package/dist/types/kit/saveSlots.d.ts +17 -0
  200. package/dist/types/kit/sceneInit.d.ts +11 -0
  201. package/dist/types/{games/kit → kit}/sceneSim.d.ts +5 -5
  202. package/dist/types/kit/screenText.d.ts +3 -0
  203. package/dist/types/kit/sdftext.d.ts +34 -0
  204. package/dist/types/kit/shading.d.ts +23 -0
  205. package/dist/types/kit/shareBlocks.d.ts +20 -0
  206. package/dist/types/kit/song.d.ts +89 -0
  207. package/dist/types/kit/songFx.d.ts +99 -0
  208. package/dist/types/kit/synthParts.d.ts +7 -0
  209. package/dist/types/kit/tar.d.ts +13 -0
  210. package/dist/types/kit/textfit.d.ts +74 -0
  211. package/dist/types/kit/transforms.d.ts +8 -0
  212. package/dist/types/lookAlike.d.ts +31 -0
  213. package/dist/types/menuVersionEntry.d.ts +1 -0
  214. package/dist/types/mesh/colorBodies.d.ts +18 -0
  215. package/dist/types/mesh/decimate.d.ts +10 -0
  216. package/dist/types/mesh/fieldTrinket.d.ts +40 -0
  217. package/dist/types/mesh/figureShapes.d.ts +24 -0
  218. package/dist/types/mesh/mesh.d.ts +9 -0
  219. package/dist/types/mesh/meshCheck.d.ts +22 -0
  220. package/dist/types/mesh/overhang.d.ts +24 -0
  221. package/dist/types/mesh/pixelFigure.d.ts +41 -0
  222. package/dist/types/mesh/sampledField.d.ts +3 -0
  223. package/dist/types/mesh/sdfShapes.d.ts +20 -0
  224. package/dist/types/mesh/stl.d.ts +9 -0
  225. package/dist/types/mesh/strokeText.d.ts +8 -0
  226. package/dist/types/mesh/surfaceNets.d.ts +14 -0
  227. package/dist/types/mesh/tetraMesh.d.ts +4 -0
  228. package/dist/types/mesh/threeMf.d.ts +12 -0
  229. package/dist/types/mesh/trinketKinds.d.ts +72 -0
  230. package/dist/types/mesh/trinketTool.d.ts +26 -0
  231. package/dist/types/mesh/voxel.d.ts +10 -0
  232. package/dist/types/mesh/zipFile.d.ts +13 -0
  233. package/dist/types/microFont.d.ts +6 -0
  234. package/dist/types/pack/meshPack.d.ts +26 -0
  235. package/dist/types/pack/threeMfPack.d.ts +11 -0
  236. package/dist/types/palettePresetData.d.ts +4 -0
  237. package/dist/types/palettePresets.d.ts +12 -0
  238. package/dist/types/paletteReserve.d.ts +52 -0
  239. package/dist/types/palettes.d.ts +4 -0
  240. package/dist/types/releaseNotes.d.ts +3 -0
  241. package/dist/types/simulation.d.ts +6 -0
  242. package/dist/types/{web/packages/tools/src/text.d.ts → text.d.ts} +6 -6
  243. package/package.json +145 -15
  244. package/dist/binary-D7wuaC5g.js +0 -120
  245. package/dist/pixels-DzfIIUOl.js +0 -76
  246. package/dist/types/games/kit/blit.d.ts +0 -10
  247. package/dist/types/games/kit/music.d.ts +0 -1
  248. package/dist/types/games/kit/pcText.d.ts +0 -8
  249. package/dist/types/games/kit/shading.d.ts +0 -11
  250. package/dist/types/web/packages/tools/src/audio.d.ts +0 -3
  251. package/dist/types/web/packages/tools/src/drawing.d.ts +0 -10
  252. package/dist/types/web/packages/tools/src/images.d.ts +0 -2
  253. package/dist/types/web/packages/tools/src/microFont.d.ts +0 -1
  254. package/dist/types/web/packages/tools/src/simulation.d.ts +0 -3
  255. package/dist/types/web/scripts/cdGames.d.ts +0 -103
  256. package/dist/types/web/scripts/gameShots.d.ts +0 -12
  257. package/dist/types/web/scripts/ogImage.d.ts +0 -21
  258. package/dist/types/web/src/audio/cmfLoad.d.ts +0 -7
  259. package/dist/types/web/src/audio/cmfPlayer.d.ts +0 -69
  260. package/dist/types/web/src/audio/context.d.ts +0 -12
  261. package/dist/types/web/src/audio/engine.d.ts +0 -39
  262. package/dist/types/web/src/audio/music.worklet.d.ts +0 -14
  263. package/dist/types/web/src/audio/opl.d.ts +0 -37
  264. package/dist/types/web/src/audio/output.d.ts +0 -13
  265. package/dist/types/web/src/desk/boxes/boxFacts.d.ts +0 -85
  266. package/dist/types/web/src/dosPlayer/fileExtensions.d.ts +0 -44
  267. package/dist/types/web/src/dosPlayer/patchRules.d.ts +0 -24
  268. package/dist/types/web/src/dosPlayer/patchTable.d.ts +0 -80
  269. package/dist/types/web/src/edition.d.ts +0 -6
  270. package/dist/types/web/src/eggs/eggState.d.ts +0 -26
  271. package/dist/types/web/src/eggs/eggs.d.ts +0 -31
  272. package/dist/types/web/src/engine/character.d.ts +0 -30
  273. package/dist/types/web/src/engine/funcKeys.d.ts +0 -33
  274. package/dist/types/web/src/engine/game.d.ts +0 -52
  275. package/dist/types/web/src/engine/keys.d.ts +0 -17
  276. package/dist/types/web/src/engine/machine.d.ts +0 -99
  277. package/dist/types/web/src/engine/menus.d.ts +0 -46
  278. package/dist/types/web/src/engine/monsters.d.ts +0 -19
  279. package/dist/types/web/src/engine/playGain.d.ts +0 -11
  280. package/dist/types/web/src/engine/playerLook.d.ts +0 -26
  281. package/dist/types/web/src/engine/recorder.d.ts +0 -60
  282. package/dist/types/web/src/engine/render.d.ts +0 -8
  283. package/dist/types/web/src/engine/scene.d.ts +0 -156
  284. package/dist/types/web/src/engine/scroll.d.ts +0 -16
  285. package/dist/types/web/src/engine/showGraphic.d.ts +0 -39
  286. package/dist/types/web/src/engine/slowPc.d.ts +0 -62
  287. package/dist/types/web/src/engine/touch.d.ts +0 -33
  288. package/dist/types/web/src/engine/world.d.ts +0 -215
  289. package/dist/types/web/src/export/gameAbout.d.ts +0 -15
  290. package/dist/types/web/src/formats/binary.d.ts +0 -44
  291. package/dist/types/web/src/formats/blocks.d.ts +0 -52
  292. package/dist/types/web/src/formats/character.d.ts +0 -65
  293. package/dist/types/web/src/formats/cmf.d.ts +0 -33
  294. package/dist/types/web/src/formats/fli.d.ts +0 -45
  295. package/dist/types/web/src/formats/fliLimits.d.ts +0 -13
  296. package/dist/types/web/src/formats/game.d.ts +0 -72
  297. package/dist/types/web/src/formats/gif.d.ts +0 -15
  298. package/dist/types/web/src/formats/graphicScripts.d.ts +0 -18
  299. package/dist/types/web/src/formats/highscore.d.ts +0 -10
  300. package/dist/types/web/src/formats/map.d.ts +0 -24
  301. package/dist/types/web/src/formats/monster.d.ts +0 -48
  302. package/dist/types/web/src/formats/palette.d.ts +0 -15
  303. package/dist/types/web/src/formats/recording.d.ts +0 -7
  304. package/dist/types/web/src/formats/sound.d.ts +0 -13
  305. package/dist/types/web/src/formats/voc.d.ts +0 -13
  306. package/dist/types/web/src/gfx/cp437Glyphs.d.ts +0 -2
  307. package/dist/types/web/src/gfx/font8x8.d.ts +0 -2
  308. package/dist/types/web/src/gfx/levelPicture.d.ts +0 -81
  309. package/dist/types/web/src/gfx/screen.d.ts +0 -46
  310. package/dist/types/web/src/gfx/titlePicture.d.ts +0 -21
  311. package/dist/types/web/src/input/chords.d.ts +0 -22
  312. package/dist/types/web/src/input/deskMouse.d.ts +0 -14
  313. package/dist/types/web/src/input/keyboard.d.ts +0 -39
  314. package/dist/types/web/src/input/scancodes.d.ts +0 -3
  315. package/dist/types/web/src/manual/printables/types.d.ts +0 -277
  316. package/dist/types/web/src/project/bizarre.d.ts +0 -28
  317. package/dist/types/web/src/project/companion.d.ts +0 -35
  318. package/dist/types/web/src/project/diskFacts.d.ts +0 -30
  319. package/dist/types/web/src/project/files.d.ts +0 -124
  320. package/dist/types/web/src/project/gameFiles.d.ts +0 -49
  321. package/dist/types/web/src/project/gamePack.d.ts +0 -17
  322. package/dist/types/web/src/project/health.d.ts +0 -30
  323. package/dist/types/web/src/project/secretGames.d.ts +0 -19
  324. package/dist/types/web/src/project/storage.d.ts +0 -46
  325. package/dist/types/web/src/project/streamGame.d.ts +0 -38
  326. package/dist/types/web/src/project/zip.d.ts +0 -33
  327. package/dist/types/web/src/retro/dos/disks.d.ts +0 -33
  328. package/dist/types/web/src/retro/text/cp437.d.ts +0 -4
  329. package/dist/types/web/src/seededRandom.d.ts +0 -6
  330. package/dist/types/web/src/tinHearts/deskHearts.d.ts +0 -33
  331. package/dist/types/web/src/tinHearts/manifest.d.ts +0 -30
  332. package/dist/types/web/src/tinHearts/tinHearts.d.ts +0 -84
  333. package/dist/types/web/src/walkthrough/format.d.ts +0 -92
  334. package/dist/types/web/src/walkthrough/madeUpScores.d.ts +0 -6
  335. package/dist/types/web/src/walkthrough/runtime.d.ts +0 -134
  336. /package/dist/types/{web/src/assistant → image}/png.d.ts +0 -0
  337. /package/dist/types/{games/kit → kit}/palette.d.ts +0 -0
  338. /package/dist/types/{games/kit → kit}/pixels.d.ts +0 -0
  339. /package/dist/types/{games/kit → kit}/reel.d.ts +0 -0
  340. /package/dist/types/{games/kit → kit}/sound.d.ts +0 -0
  341. /package/dist/types/{games/kit → kit}/textBounds.d.ts +0 -0
  342. /package/dist/types/{games/kit → kit}/tune.d.ts +0 -0
  343. /package/dist/types/{web/src/audio → music}/compose.d.ts +0 -0
package/dist/drawing.js CHANGED
@@ -1,871 +1,85 @@
1
- import { P as g, d as K, r as V } from "./pixels-DzfIIUOl.js";
2
- import { writeFileSync as q, existsSync as Q, readFileSync as Z } from "node:fs";
3
- import { encodeFli as t0 } from "./formats/fli.js";
4
- import { vga8 as P } from "./formats/palette.js";
5
- class E0 {
6
- constructor() {
7
- this.pal = new Uint8Array(768), this.next = 0, this.ramps = /* @__PURE__ */ new Map();
8
- }
9
- /** One color from 8-bit RGB; returns its index. */
10
- color(f, c, e) {
11
- const n = this.next++;
12
- if (n > 254) throw new Error('Palette full (255 is "clear")');
13
- return this.pal.set([f >> 2, c >> 2, e >> 2], n * 3), n;
14
- }
15
- /** A ramp of n shades from dark to light (8-bit RGB stops); returns the indexes. */
16
- ramp(f, c, e, n, s) {
17
- const r = [];
18
- for (let o = 0; o < c; o++) {
19
- const i = c === 1 ? 0 : o / (c - 1), [a, h, l] = s ? i < 0.5 ? [e, s, i * 2] : [s, n, (i - 0.5) * 2] : [e, n, i];
20
- r.push(this.color(...a.map((u, d) => Math.round(u + (h[d] - u) * l))));
21
- }
22
- return this.ramps.set(f, r), r;
23
- }
24
- get(f) {
25
- const c = this.ramps.get(f);
26
- if (!c) throw new Error(`No ramp ${f}`);
27
- return c;
28
- }
29
- /**
30
- * Game-Maker's designers look for these grays, reds, black and LCD green; keep them. Black
31
- * comes first: PLAYGAME clears the screen to color 0 before the high score prompt.
32
- */
33
- designerColors() {
34
- for (const [f, c, e] of [
35
- [0, 0, 0],
36
- [33, 33, 33],
37
- [43, 0, 0],
38
- [28, 0, 0],
39
- [28, 28, 28],
40
- [23, 23, 23],
41
- [18, 18, 18],
42
- [53, 0, 0],
43
- [8, 48, 24]
44
- ])
45
- this.color(f * 4, c * 4, e * 4);
46
- }
47
- get used() {
48
- return this.next;
49
- }
50
- }
51
- const e0 = (t) => /[\x20-\x7e\u25cf\u2022]/.test(t), O = typeof process < "u" ? process.env.TEXT_BOUNDS : void 0, U = [], A = /* @__PURE__ */ new Map(), _ = (t, f, c, e) => `${t}x${f} ${c} ${e}`, c0 = /\/art\/(font|draw|canvas)\.ts|screens\/(draw|screen)\.ts/;
52
- function f0() {
53
- const t = (new Error().stack ?? "").split(`
54
- `).slice(1).map((e) => /\(?((?:\/|file:)[^():]+):(\d+):\d+\)?\s*$/.exec(e)).filter((e) => !!e).map((e) => ({ path: e[1].replace(/^file:\/\//, "").replace(/^.*\/games\//, ""), line: e[2] })).filter((e) => !/node_modules|kit\/textBounds\.ts/.test(e.path)).map((e) => ({ ...e, helper: c0.test(e.path), name: `${e.path}:${e.line}` })), f = t.findIndex((e) => !e.helper);
55
- return {
56
- at: t.filter((e) => !e.helper).slice(0, 2).map((e) => e.name).join(" < "),
57
- via: t.slice(0, f + 1).map((e) => e.name).join(" > ")
58
- };
59
- }
60
- O && process.on("exit", () => {
61
- const t = {
62
- overflows: U,
63
- shown: Object.fromEntries([...A].map(([f, c]) => [f, [...c].map((e) => e.split(",").map(Number))]))
64
- };
65
- q(O, JSON.stringify(t));
66
- });
67
- class n0 {
68
- constructor(f, c, e, n, s) {
69
- this.w = f, this.h = c, this.s = e, this.area = n, this.has = s, this.x0 = 1 / 0, this.y0 = 1 / 0, this.x1 = -1 / 0, this.y1 = -1 / 0;
70
- }
71
- /** A lit rectangle of the string (a font pixel, scaled). */
72
- add(f, c, e = 1, n = 1) {
73
- f < this.x0 && (this.x0 = f), c < this.y0 && (this.y0 = c), f + e > this.x1 && (this.x1 = f + e), c + n > this.y1 && (this.y1 = c + n);
74
- }
75
- end() {
76
- if (this.x1 < this.x0) return;
77
- const [f, c, e, n] = this.area, s = this.x0 < f - 0.5 || this.y0 < c - 0.5 || this.x1 > e + 0.5 || this.y1 > n + 0.5, { at: r, via: o } = f0(), i = [...new Set(this.s)].filter((a) => !this.has(a)).join("");
78
- if (i)
79
- U.push({
80
- s: this.s,
81
- w: this.w,
82
- h: this.h,
83
- ink: [this.x0, this.y0, this.x1, this.y1].map((a) => Math.round(a)),
84
- area: this.area,
85
- at: r,
86
- via: o,
87
- missing: i
88
- });
89
- else if (s)
90
- U.push({ s: this.s, w: this.w, h: this.h, ink: [this.x0, this.y0, this.x1, this.y1].map((a) => Math.round(a)), area: this.area, at: r, via: o });
91
- else {
92
- const a = _(this.w, this.h, o, this.s);
93
- A.has(a) || A.set(a, /* @__PURE__ */ new Set()), A.get(a).add(`${Math.round(this.x0)},${Math.round(this.y0)}`);
94
- }
95
- }
96
- }
97
- function r0(t, f, c, e = e0) {
98
- if (!(!O || !f.trim()))
99
- return new n0(t.w, t.h, f, c ?? [0, 0, t.w, t.h], e);
100
- }
101
- function s0(t) {
102
- const f = (n) => (t.shown[_(n.w, n.h, n.via, n.s)] ?? []).some(([s, r]) => Math.abs(s - n.ink[0]) > 2 || Math.abs(r - n.ink[1]) > 2), c = /* @__PURE__ */ new Map(), e = [];
103
- for (const n of t.overflows) {
104
- const s = _(n.w, n.h, n.via, n.s);
105
- if (!n.missing && f(n)) {
106
- e.push(n);
107
- continue;
108
- }
109
- const r = c.get(s);
110
- r ? r.ink = [Math.min(r.ink[0], n.ink[0]), Math.min(r.ink[1], n.ink[1]), Math.max(r.ink[2], n.ink[2]), Math.max(r.ink[3], n.ink[3])] : c.set(s, { ...n, ink: [...n.ink] });
111
- }
112
- return { cut: [...c.values()], moving: e };
113
- }
114
- function I0(t) {
115
- return t.missing ? `"${t.s}" has ${[...t.missing].map((f) => `U+${f.charCodeAt(0).toString(16).toUpperCase()}`).join(" ")}, a box in the PC font (${t.w}x${t.h}) at ${t.at}` : `"${t.s}" ink ${t.ink.join(",")} outside ${t.area.join(",")} (${t.w}x${t.h}) at ${t.at}`;
116
- }
117
- function $0(t) {
118
- if (!Q(t)) throw new Error(`${t}: the build wrote no text-bounds report`);
119
- return s0(JSON.parse(Z(t, "utf8")));
120
- }
121
- const o0 = "0000000000000000 183c3c1818001800 3636000000000000 36367f367f363600 0c3e031e301f0c00 006333180c666300 1c361c6e3b336e00 0606030000000000 180c0606060c1800 060c1818180c0600 00663cff3c660000 000c0c3f0c0c0000 00000000000c0c06 0000003f00000000 00000000000c0c00 6030180c06030100 3e63737b6f673e00 0c0e0c0c0c0c3f00 1e33301c06333f00 1e33301c30331e00 383c36337f307800 3f031f3030331e00 1c06031f33331e00 3f3330180c0c0c00 1e33331e33331e00 1e33333e30180e00 000c0c00000c0c00 000c0c00000c0c06 180c0603060c1800 00003f00003f0000 060c1830180c0600 1e3330180c000c00 3e637b7b7b031e00 0c1e33333f333300 3f66663e66663f00 3c66030303663c00 1f36666666361f00 7f46161e16467f00 7f46161e16060f00 3c66030373667c00 3333333f33333300 1e0c0c0c0c0c1e00 7830303033331e00 6766361e36666700 0f06060646667f00 63777f7f6b636300 63676f7b73636300 1c36636363361c00 3f66663e06060f00 1e3333333b1e3800 3f66663e36666700 1e33070e38331e00 3f2d0c0c0c0c1e00 3333333333333f00 33333333331e0c00 6363636b7f776300 6363361c1c366300 3333331e0c0c1e00 7f6331184c667f00 1e06060606061e00 03060c1830604000 1e18181818181e00 081c366300000000 00000000000000ff 0c0c180000000000 00001e303e336e00 0706063e66663b00 00001e3303331e00 3830303e33336e00 00001e333f031e00 1c36060f06060f00 00006e33333e301f 0706366e66666700 0c000e0c0c0c1e00 300030303033331e 070666361e366700 0e0c0c0c0c0c1e00 0000337f7f6b6300 00001f3333333300 00001e3333331e00 00003b66663e060f 00006e33333e3078 00003b6e66060f00 00003e031e301f00 080c3e0c0c2c1800 0000333333336e00 00003333331e0c00 0000636b7f7f3600 000063361c366300 00003333333e301f 00003f190c263f00 380c0c070c0c3800 1818180018181800 070c0c380c0c0700 6e3b000000000000", B = (() => {
122
- const t = new Uint8Array(2048), f = [126, 66, 66, 66, 66, 66, 126, 0];
123
- for (let c = 0; c < 256; c++) (c >= 128 || c > 0 && c < 32 && c !== 10) && t.set(f, c * 8);
124
- return o0.split(" ").forEach((c, e) => {
125
- for (let n = 0; n < 8; n++) t[(32 + e) * 8 + n] = parseInt(c.slice(n * 2, n * 2 + 2), 16);
126
- }), t;
127
- })();
128
- function N(t, f, c, e, n, s = 1) {
129
- const r = r0(t, e), o = (i, a, h, l) => {
130
- t.rect(i, a, h, l, n), r?.add(i, a, h, l);
131
- };
132
- return [...e].forEach((i, a) => {
133
- const h = i.charCodeAt(0) & 255;
134
- for (let l = 0; l < 8; l++) {
135
- const u = B[h * 8 + l];
136
- for (let d = 0; d < 8; d++) u & 1 << d && o(f + (a * 8 + d) * s, c + l * s, s, s);
137
- }
138
- }), r?.end(), e.length * 8 * s;
139
- }
140
- const i0 = (t, f = 1) => t.length * 8 * f;
141
- function a0(t, f, c, e, n, s, r = 1, o) {
142
- if (o !== void 0)
143
- for (const [i, a] of [
144
- [2, 2],
145
- [1, 2],
146
- [2, 1]
147
- ])
148
- N(t, f + i * r, c + a * r, e, o, r);
149
- for (const [i, a] of [
150
- [-1, 0],
151
- [1, 0],
152
- [0, -1],
153
- [0, 1],
154
- [-1, -1],
155
- [1, 1],
156
- [1, -1],
157
- [-1, 1]
158
- ])
159
- N(t, f + i, c + a, e, s, r);
160
- N(t, f, c, e, n, r);
161
- }
162
- function S0(t, f, c, e, n = 1, s, r = t.w / 2, o) {
163
- const i = Math.round(r - i0(c, n) / 2);
164
- s === void 0 ? N(t, i, f, c, e, n) : a0(t, i, f, c, e, s, n, o);
165
- }
166
- const E = 255;
167
- function C0(t, f, c = 0, e = 0) {
168
- return t.blit(f, c, e, E);
169
- }
170
- function v0(t, f) {
171
- const c = new g(t.w, t.h);
172
- return c.px.set(t.px.map(f)), c;
173
- }
174
- function A0(t, f, c, e, n, s = !1) {
175
- for (let r = 0; r < f.h; r++)
176
- for (let o = 0; o < f.w; o++) {
177
- const i = f.get(s ? f.w - 1 - o : o, r);
178
- i !== E && i >= 0 && t.rect(c + o * n, e + r * n, n, n, i);
179
- }
180
- }
181
- function N0(t, f) {
182
- const c = new g(t.w, t.h, E);
183
- c.px.set(t.px);
184
- for (let e = 0; e < t.h; e++)
185
- for (let n = 0; n < t.w; n++) {
186
- if (t.get(n, e) !== E) continue;
187
- [t.get(n - 1, e), t.get(n + 1, e), t.get(n, e - 1), t.get(n, e + 1)].some((r) => r !== E && r !== -1) && c.set(n, e, f);
188
- }
189
- return c;
190
- }
191
- function G(t, f, c, e, n, s) {
192
- const r = f + Math.max(0, Math.min(1, e)) * (c - f), o = Math.floor(r), i = K(n, s, r - o) ? o + 1 : o;
193
- return t[Math.max(0, Math.min(t.length - 1, i))];
194
- }
195
- function R0(t, f, c, e, n, s, r, o) {
196
- for (let i = c; i < c + n; i++) for (let a = f; a < f + e; a++) t.set(a, i, G(s, r, o, (i - c) / Math.max(1, n - 1), a, i));
197
- return t;
198
- }
199
- function P0(t, f, c, e, n, s, r, o, i = 1) {
200
- for (let a = Math.floor(c - n); a <= c + n; a++)
201
- for (let h = Math.floor(f - e); h <= f + e; h++) {
202
- const l = (h + 0.5 - f) / e, u = (a + 0.5 - c) / n, d = l * l + u * u;
203
- if (d > 1) continue;
204
- const m = (0.62 * Math.sqrt(1 - d) - 0.42 * l - 0.52 * u) * i;
205
- t.set(h, a, G(s, r, o, (m + 0.35) / 1.2, h, a));
206
- }
207
- return t;
208
- }
209
- function O0(t, f, c, e, n, s, r, o = 1) {
210
- t.rect(f, c, e, n, s[r]);
211
- const i = s[Math.min(s.length - 1, r + 1)], a = s[Math.max(0, r - 2)];
212
- for (let h = 0; h < o; h++)
213
- t.rect(f + h, c + h, e - 2 * h, 1, i).rect(f + h, c + h, 1, n - 2 * h, i), t.rect(f + h, c + n - 1 - h, e - 2 * h, 1, a).rect(f + e - 1 - h, c + h, 1, n - 2 * h, a);
214
- return t;
215
- }
216
- function U0(t, f, c, e, n, s, r, o, i, a = 0.25) {
217
- const h = V(i);
218
- for (let l = c; l < c + n; l++)
219
- for (let u = f; u < f + e; u++) {
220
- let d = r;
221
- h() < a && (d += h() < 0.5 ? -o : o), t.set(u, l, s[Math.max(0, Math.min(s.length - 1, d))]);
222
- }
223
- return t;
224
- }
225
- function T(t, f) {
226
- return t.map((c) => Math.round(c * Math.max(0, Math.min(1, f))));
227
- }
228
- class _0 {
229
- constructor(f, c = 320, e = 200) {
230
- this.pal = f, this.w = c, this.h = e, this.frames = [], this.palettes = [], this.frames.push(new Uint8Array(c * e)), this.palettes.push(new Uint8Array(768));
231
- }
232
- /** Adds a picture for `hold` frames, its palette faded to `light`. */
233
- add(f, c = 1, e = 1, n = this.pal) {
234
- const s = Uint8Array.from(f.px), r = e >= 1 ? n : T(n, e);
235
- for (let o = 0; o < c; o++)
236
- this.frames.push(s), this.palettes.push(r);
237
- return this.last = { px: s, pal: n }, this;
238
- }
239
- /** A picture drawn over a copy of `bg` (the actors over the scenery), for `hold` frames. */
240
- frame(f, c, e = 1, n = 1, s = this.pal) {
241
- const r = new g(f.w, f.h);
242
- return r.px.set(f.px), c(r), this.add(r, e, n, s);
243
- }
244
- /** The picture fading in from black over `n` frames (the last at full light). */
245
- fadeIn(f, c, e = this.pal) {
246
- for (let n = 1; n <= c; n++) this.add(f, 1, n / c, e);
247
- return this;
248
- }
249
- /** The last picture fading out to black over `n` frames. */
250
- fadeOut(f) {
251
- const c = this.last;
252
- if (!c) return this;
253
- for (let e = f - 1; e >= 0; e--)
254
- this.frames.push(c.px), this.palettes.push(T(c.pal, e / f));
255
- return this;
256
- }
257
- /**
258
- * A cartoon's closing iris: black closes in on (cx, cy) over `n` frames from the last picture
259
- * down to a circle `end` pixels across (round on a 4:3 screen: VGA's pixels are taller than
260
- * wide), and holds there `hold` frames. Follow it with fadeOut. Gives an intro whose pictures
261
- * are the title's art a last view that isn't the title.
262
- */
263
- irisOut(f, c, e, n = 64, s = 6) {
264
- const r = this.last;
265
- if (!r) return this;
266
- let o = 0;
267
- const i = (l) => r.pal[l * 3] + r.pal[l * 3 + 1] + r.pal[l * 3 + 2];
268
- for (let l = 1; l < r.pal.length / 3; l++) i(l) < i(o) && (o = l);
269
- const a = Math.hypot(Math.max(f, this.w - f), Math.max(c, this.h - c) * 1.2), h = new g(this.w, this.h);
270
- for (let l = 1; l <= e; l++) {
271
- const u = l / e, d = a + (n / 2 - a) * (1 - (1 - u) * (1 - u));
272
- for (let p = 0; p < this.h; p++)
273
- for (let m = 0; m < this.w; m++) {
274
- const b = p * this.w + m;
275
- h.px[b] = Math.hypot(m - f, (p - c) * 1.2) <= d ? r.px[b] : o;
276
- }
277
- this.add(h, l === e ? s : 1, 1, r.pal);
278
- }
279
- return this;
280
- }
281
- /** The .FLI: `speed` is the wait after each frame in 1/70 s (5 = 14 frames a second). */
282
- fli(f) {
283
- return t0(this.frames, this.pal, { width: this.w, height: this.h, speed: f, palettes: this.palettes, runs: !0 });
284
- }
285
- /** How long it plays, in seconds. */
286
- seconds(f) {
287
- return this.frames.length * f / 70;
288
- }
289
- }
290
- const h0 = {
291
- 1: "3c42a581a599423c",
292
- // ☺
293
- 2: "3c7edbffdbe77e3c",
294
- // ☻
295
- 3: "6cfefefe7c381000",
296
- // ♥
297
- 4: "10387cfe7c381000",
298
- // ♦
299
- 5: "387c38fefed61038",
300
- // ♣
301
- 6: "10387cfefe543800",
302
- // ♠
303
- 7: "0000183c3c180000",
304
- // •
305
- 8: "ffffe7c3c3e7ffff",
306
- // ◘
307
- 9: "003c424242423c00",
308
- // ○
309
- 10: "ffc3bdbdbdbdc3ff",
310
- // ◙
311
- 11: "0f03057988888870",
312
- // ♂
313
- 12: "3844444438107c10",
314
- // ♀
315
- 13: "181c16121070f060",
316
- // ♪
317
- 14: "3f21212163e7c600",
318
- // ♫
319
- 15: "925438ee38549200",
320
- // ☼
321
- 16: "80e0f8fef8e08000",
322
- // ►
323
- 17: "020e3efe3e0e0200",
324
- // ◄
325
- 18: "183c7e18187e3c18",
326
- // ↕
327
- 19: "6c6c6c6c6c006c00",
328
- // ‼
329
- 20: "7fdbdb7b1b1b1b00",
330
- // ¶ (ext_latin)
331
- 21: "3e63386c6c38cc78",
332
- // § (ext_latin)
333
- 22: "00000000fefefe00",
334
- // ▬
335
- 23: "183c7e187e3c18ff",
336
- // ↨
337
- 24: "183c7e1818181800",
338
- // ↑
339
- 25: "181818187e3c1800",
340
- // ↓
341
- 26: "00180cfe0c180000",
342
- // →
343
- 27: "003060fe60300000",
344
- // ←
345
- 28: "0000c0c0c0fefe00",
346
- // ∟
347
- 29: "002466ff66240000",
348
- // ↔
349
- 30: "0018183c7eff0000",
350
- // ▲
351
- 31: "00ff7e3c18180000",
352
- // ▼
353
- 127: "102844828282fe00",
354
- // ⌂
355
- 128: "78ccc0cc78180c78",
356
- // Ç (ext_latin)
357
- 129: "00cc00cccccc7e00",
358
- // ü (ext_latin)
359
- 130: "1c0078ccfcc07800",
360
- // é (ext_latin)
361
- 131: "7ec33c063e663f00",
362
- // â (ext_latin)
363
- 132: "cc00780c7ccc7e00",
364
- // ä (ext_latin)
365
- 133: "e000780c7ccc7e00",
366
- // à (ext_latin)
367
- 134: "3030780c7ccc7e00",
368
- // å (ext_latin)
369
- 135: "000078c0c0780c38",
370
- // ç (ext_latin)
371
- 136: "7ec33c667e603c00",
372
- // ê (ext_latin)
373
- 137: "cc0078ccfcc07800",
374
- // ë (ext_latin)
375
- 138: "e00078ccfcc07800",
376
- // è (ext_latin)
377
- 139: "cc00703030307800",
378
- // ï (ext_latin)
379
- 140: "7cc6381818183c00",
380
- // î (ext_latin)
381
- 141: "e000703030307800",
382
- // ì (ext_latin)
383
- 142: "c6386cc6fec6c600",
384
- // Ä (ext_latin)
385
- 143: "30300078ccfccc00",
386
- // Å (ext_latin)
387
- 144: "1c00fc607860fc00",
388
- // É (ext_latin)
389
- 145: "00007f0c7fcc7f00",
390
- // æ (ext_latin)
391
- 146: "3e6cccfeccccce00",
392
- // Æ (ext_latin)
393
- 147: "78cc0078cccc7800",
394
- // ô (ext_latin)
395
- 148: "00cc0078cccc7800",
396
- // ö (ext_latin)
397
- 149: "00e00078cccc7800",
398
- // ò (ext_latin)
399
- 150: "78cc00cccccc7e00",
400
- // û (ext_latin)
401
- 151: "00e000cccccc7e00",
402
- // ù (ext_latin)
403
- 152: "00cc00cccc7c0cf8",
404
- // ÿ (ext_latin)
405
- 153: "c3183c66663c1800",
406
- // Ö (ext_latin)
407
- 154: "cc00cccccccc7800",
408
- // Ü (ext_latin)
409
- 155: "18187ec0c07e1818",
410
- // ¢ (ext_latin)
411
- 156: "386c64f060e6fc00",
412
- // £ (ext_latin)
413
- 157: "cccc78fc30fc3030",
414
- // ¥ (ext_latin)
415
- 158: "f8ccccfac6cfc6c7",
416
- // ₧ (misc)
417
- 159: "0e1b183c1818d870",
418
- // ƒ (misc)
419
- 160: "1c00780c7ccc7e00",
420
- // á (ext_latin)
421
- 161: "3800703030307800",
422
- // í (ext_latin)
423
- 162: "001c0078cccc7800",
424
- // ó (ext_latin)
425
- 163: "001c00cccccc7e00",
426
- // ú (ext_latin)
427
- 164: "00f800f8cccccc00",
428
- // ñ (ext_latin)
429
- 165: "fc00ccecfcdccc00",
430
- // Ñ (ext_latin)
431
- 166: "3c6c6c3e007e0000",
432
- // ª (misc)
433
- 167: "386c6c38007c0000",
434
- // º (misc)
435
- 168: "30003060c0cc7800",
436
- // ¿ (ext_latin)
437
- 169: "000000fcc0c00000",
438
- // ⌐ (misc)
439
- 170: "000000fc0c0c0000",
440
- // ¬ (ext_latin)
441
- 171: "c3c6ccde3366cc0f",
442
- // ½ (ext_latin)
443
- 172: "c3c6ccbd376fcfc0",
444
- // ¼ (ext_latin)
445
- 173: "1818001818181800",
446
- // ¡ (ext_latin)
447
- 174: "003366cc66330000",
448
- // « (ext_latin)
449
- 175: "00cc663366cc0000",
450
- // » (ext_latin)
451
- 176: "2288228822882288",
452
- // ░
453
- 177: "55aa55aa55aa55aa",
454
- // ▒
455
- 178: "dd77dd77dd77dd77",
456
- // ▓
457
- 179: "1818181818181818",
458
- // │
459
- 180: "181818f818181818",
460
- // ┤
461
- 181: "1818f818f8181818",
462
- // ╡
463
- 182: "363636f636363636",
464
- // ╢
465
- 183: "000000fe36363636",
466
- // ╖
467
- 184: "0000f818f8181818",
468
- // ╕
469
- 185: "3636f606f6363636",
470
- // ╣
471
- 186: "3636363636363636",
472
- // ║
473
- 187: "0000fe06f6363636",
474
- // ╗
475
- 188: "3636f606fe000000",
476
- // ╝
477
- 189: "363636fe00000000",
478
- // ╜
479
- 190: "1818f818f8000000",
480
- // ╛
481
- 191: "000000f818181818",
482
- // ┐
483
- 192: "1818181f00000000",
484
- // └
485
- 193: "181818ff00000000",
486
- // ┴
487
- 194: "000000ff18181818",
488
- // ┬
489
- 195: "1818181f18181818",
490
- // ├
491
- 196: "000000ff00000000",
492
- // ─
493
- 197: "181818ff18181818",
494
- // ┼
495
- 198: "18181f181f181818",
496
- // ╞
497
- 199: "3636363736363636",
498
- // ╟
499
- 200: "363637303f000000",
500
- // ╚
501
- 201: "00003f3037363636",
502
- // ╔
503
- 202: "3636f700ff000000",
504
- // ╩
505
- 203: "0000ff00f7363636",
506
- // ╦
507
- 204: "3636373037363636",
508
- // ╠
509
- 205: "0000ff00ff000000",
510
- // ═
511
- 206: "3636f700f7363636",
512
- // ╬
513
- 207: "1818ff00ff000000",
514
- // ╧
515
- 208: "363636ff00000000",
516
- // ╨
517
- 209: "0000ff00ff181818",
518
- // ╤
519
- 210: "000000ff36363636",
520
- // ╥
521
- 211: "3636363f00000000",
522
- // ╙
523
- 212: "18181f181f000000",
524
- // ╘
525
- 213: "00001f181f181818",
526
- // ╒
527
- 214: "0000003f36363636",
528
- // ╓
529
- 215: "363636ff36363636",
530
- // ╫
531
- 216: "1818ff18ff181818",
532
- // ╪
533
- 217: "181818f800000000",
534
- // ┘
535
- 218: "0000001f18181818",
536
- // ┌
537
- 219: "ffffffffffffffff",
538
- // █
539
- 220: "00000000ffffffff",
540
- // ▄
541
- 221: "f0f0f0f0f0f0f0f0",
542
- // ▌
543
- 222: "0f0f0f0f0f0f0f0f",
544
- // ▐
545
- 223: "ffffffff00000000",
546
- // ▀
547
- 224: "000076dcc8dc7600",
548
- // α (greek)
549
- 225: "0078ccf8ccf8c0c0",
550
- // ß (ext_latin)
551
- 226: "fcccc0c0c0c0c000",
552
- // Γ (greek)
553
- 227: "0000fe6c6c6c6c00",
554
- // π (greek)
555
- 228: "fec6603060c6fe00",
556
- // Σ (greek)
557
- 229: "00007ed8d8d87000",
558
- // σ (greek)
559
- 230: "00006666667c60c0",
560
- // µ (ext_latin)
561
- 231: "00007e18181a0c00",
562
- // τ (greek)
563
- 232: "187edbdbdb7e1800",
564
- // Φ (greek)
565
- 233: "386cc6fec66c3800",
566
- // Θ (greek)
567
- 234: "7cc6c6c66c6cee00",
568
- // Ω (greek)
569
- 235: "1c30187ccccc7800",
570
- // δ (greek)
571
- 236: "00006c92926c0000",
572
- // ∞
573
- 237: "00006edbdb7e1800",
574
- // φ (greek)
575
- 238: "000078c070c07800",
576
- // ε (greek)
577
- 239: "003c666666666600",
578
- // ∩
579
- 240: "007e007e007e0000",
580
- // ≡
581
- 241: "18187e1818007e00",
582
- // ± (ext_latin)
583
- 242: "30180c1830007e00",
584
- // ≥ (misc)
585
- 243: "0c1830180c007e00",
586
- // ≤ (misc)
587
- 244: "0e1b1b1818181818",
588
- // ⌠
589
- 245: "18181818d8d87000",
590
- // ⌡
591
- 246: "1818007e00181800",
592
- // ÷ (ext_latin)
593
- 247: "0076dc0076dc0000",
594
- // ≈
595
- 248: "386c6c3800000000",
596
- // ° (ext_latin)
597
- 249: "0000001818000000",
598
- // ∙
599
- 250: "0000000018000000",
600
- // ·
601
- 251: "0f08080888482818",
602
- // √
603
- 252: "f8cccccc00000000",
604
- // ⁿ
605
- 253: "380c18303c000000",
606
- // ² (ext_latin)
607
- 254: "00003c3c3c3c0000",
608
- // ■
609
- 255: "0000000000000000"
610
- // NBSP (ext_latin)
611
- };
612
- function l0(t) {
613
- let f = 0;
614
- for (let c = 0; c < 8; c++) t & 1 << c && (f |= 1 << 7 - c);
615
- return f;
616
- }
617
- const u0 = (() => {
618
- const t = B.slice();
619
- for (const [f, c] of Object.entries(h0))
620
- for (let e = 0; e < 8; e++) t[Number(f) * 8 + e] = l0(parseInt(c.slice(e * 2, e * 2 + 2), 16));
621
- return t.fill(0, 0, 8), t;
622
- })(), H = "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", j = /* @__PURE__ */ new Map();
623
- for (let t = 1; t < 256; t++) (t < 32 || t > 126) && j.set(H[t], t);
624
- for (const [t, f] of [
625
- ["β", 225],
626
- // β beta for ß
627
- ["μ", 230],
628
- // μ mu for µ
629
- ["Ω", 234],
630
- // Ω ohm for Ω
631
- ["∑", 228],
632
- // ∑ sum for Σ
633
- ["ϕ", 237],
634
- // ϕ for φ
635
- ["∈", 238]
636
- // ∈ for ε
637
- ])
638
- j.set(t, f);
639
- const d0 = { "–": "-", "—": "--", "‘": "'", "’": "'", "“": '"', "”": '"', "…": "...", "×": "x" };
640
- function F(t) {
641
- let f = "";
642
- for (const c of t) {
643
- const e = j.get(c);
644
- f += e !== void 0 ? String.fromCharCode(e) : d0[c] ?? c;
645
- }
646
- return f;
647
- }
648
- function L(t) {
649
- let f = "";
650
- for (let c = 0; c < t.length; c++) {
651
- const e = t.charCodeAt(c);
652
- f += e < 256 ? H[e] : t[c];
653
- }
654
- return f;
655
- }
656
- const Y = Object.freeze({
657
- A: "010101111101101",
658
- B: "110101110101110",
659
- C: "011100100100011",
660
- D: "110101101101110",
661
- E: "111100110100111",
662
- F: "111100110100100",
663
- G: "011100101101011",
664
- H: "101101111101101",
665
- I: "111010010010111",
666
- J: "001001001101010",
667
- K: "101101110101101",
668
- L: "100100100100111",
669
- M: "101111111101101",
670
- N: "110101101101101",
671
- O: "010101101101010",
672
- P: "110101110100100",
673
- Q: "010101101110011",
674
- R: "110101110101101",
675
- S: "011100010001110",
676
- T: "111010010010010",
677
- U: "101101101101111",
678
- V: "101101101101010",
679
- W: "101101111111101",
680
- X: "101101010101101",
681
- Y: "101101010010010",
682
- Z: "111001010100111",
683
- 0: "111101101101111",
684
- 1: "010110010010111",
685
- 2: "110001010100111",
686
- 3: "110001010001110",
687
- 4: "101101111001001",
688
- 5: "111100110001110",
689
- 6: "011100111101111",
690
- 7: "111001010010010",
691
- 8: "111101111101111",
692
- 9: "111101111001110",
693
- $: "011110010011110",
694
- "&": "010101010101011",
695
- "-": "000000111000000",
696
- "!": "010010010000010",
697
- ".": "000000000000010",
698
- "'": "010010000000000",
699
- " ": "000000000000000",
700
- ":": "000010000010000",
701
- "/": "001001010100100",
702
- ",": "000000000010100",
703
- "?": "110001010000010",
704
- "+": "000010111010000",
705
- ">": "100010001010100",
706
- "<": "001010100010001",
707
- "(": "010100100100010",
708
- ")": "010001001001010"
709
- });
710
- function p0(t) {
711
- for (const e of t)
712
- if (e.charCodeAt(0) >= 128 && F(e) === e && L(e) !== e) throw new RangeError(`No CP437 glyph for ${e}`);
713
- const f = F(t), c = new Uint8Array(f.length);
714
- for (let e = 0; e < f.length; e++) {
715
- const n = f.charCodeAt(e);
716
- if (n > 255) throw new RangeError(`No CP437 glyph for ${f[e]}`);
717
- c[e] = n;
718
- }
719
- return c;
720
- }
721
- function m0(t, f = "cp437") {
722
- if (!Number.isInteger(t) || t < 0 || t > 255) throw new RangeError("Glyph code must be 0..255");
723
- if (f === "cp437") return u0.slice(t * 8, t * 8 + 8);
724
- const c = Y[L(String.fromCharCode(t)).toUpperCase()] ?? Y["?"];
725
- return Uint8Array.from({ length: 5 }, (e, n) => {
726
- let s = 0;
727
- for (let r = 0; r < 3; r++) c[n * 3 + r] === "1" && (s |= 1 << r);
728
- return s;
729
- });
730
- }
731
- function w0(t, f, c = 1, e = 2) {
732
- if (R(f), !Number.isInteger(c) || !Number.isInteger(e)) throw new RangeError("Shadow offsets must be integers");
733
- const n = new g(t.w, t.h, 255);
734
- for (let s = 0; s < t.h; s++) for (let r = 0; r < t.w; r++) t.get(r, s) !== 255 && n.set(r + c, s + e, f);
735
- return n.blit(t, 0, 0, 255);
736
- }
737
- function R(t) {
738
- if (!Number.isInteger(t) || t < 0 || t > 254) throw new RangeError("Ink must be a palette index 0..254");
739
- }
740
- function j0(t, f = {}) {
741
- const { font: c = "cp437", color: e = 0, scale: n = 1, outline: s, shadow: r } = f;
742
- if (R(e), s !== void 0 && R(s), r && R(r.color), !Number.isSafeInteger(n) || n < 1) throw new RangeError("Scale must be a positive integer");
743
- const o = r?.dx ?? 1, i = r?.dy ?? 2;
744
- if (!Number.isSafeInteger(o) || !Number.isSafeInteger(i)) throw new RangeError("Shadow offsets must be integers");
745
- const a = typeof t == "string" ? t.replaceAll(`\r
746
- `, `
747
- `).split(`
748
- `).map(p0) : [t], h = Math.max(...a.map((w) => w.length));
749
- if (!h) return { width: 0, height: 0, pixels: new Uint8Array(), originX: 0, originY: 0 };
750
- const l = c === "cp437" ? 8 : 3, u = c === "cp437" ? 8 : 5, d = c === "cp437" ? 8 : 4, p = s === void 0 ? 0 : 1, m = Math.min(-p, r ? o : 0), b = Math.min(-p, r ? i : 0), X = Math.max(p, r ? o : 0), z = Math.max(p, r ? i : 0), I = ((h - 1) * d + l) * n + X - m, $ = ((a.length - 1) * (u + 1) + u) * n + z - b, S = new g(I, $, 255);
751
- a.forEach(
752
- (w, x) => w.forEach((y, k) => {
753
- m0(y, c).forEach((J, W) => {
754
- for (let v = 0; v < l; v++)
755
- J & 1 << v && S.rect((k * d + v) * n - m, (x * (u + 1) + W) * n - b, n, n, e);
756
- });
757
- })
758
- );
759
- const C = new g(I, $, 255);
760
- if (r && C.blit(w0(S, r.color, o, i), 0, 0, 255), s !== void 0) {
761
- for (let w = 0; w < $; w++)
762
- for (let x = 0; x < I; x++)
763
- if (S.get(x, w) !== 255) for (let y = -1; y <= 1; y++) for (let k = -1; k <= 1; k++) C.set(x + k, w + y, s);
764
- }
765
- return C.blit(S, 0, 0, 255), { width: I, height: $, pixels: C.px, originX: -m, originY: -b };
766
- }
767
- const g0 = {
768
- morning: { mul: [1, 0.94, 0.94], add: [14, 4, 10] },
769
- noon: { mul: [1, 1, 1], add: [0, 0, 0] },
770
- afternoon: { mul: [1.02, 0.96, 0.86], add: [8, 4, 0] },
771
- sunset: { mul: [0.9, 0.7, 0.74], add: [30, 10, 16] },
772
- night: { mul: [0.46, 0.5, 0.78], add: [8, 8, 30] },
773
- // Under the big top at night: warm show lights on everything.
774
- show: { mul: [1, 0.9, 0.86], add: [12, 4, 6] }
775
- }, T0 = {
776
- morning: [
777
- [120, 150, 230],
778
- [255, 214, 200],
779
- [200, 190, 240]
780
- ],
781
- noon: [
782
- [70, 130, 230],
783
- [200, 232, 255]
784
- ],
785
- afternoon: [
786
- [90, 140, 220],
787
- [250, 236, 200],
788
- [170, 200, 240]
789
- ],
790
- sunset: [
791
- [60, 40, 120],
792
- [255, 170, 90],
793
- [210, 90, 120]
794
- ],
795
- night: [
796
- [8, 8, 30],
797
- [40, 40, 96]
798
- ],
799
- show: [
800
- [6, 6, 28],
801
- [60, 40, 110]
802
- ]
803
- }, D = (t) => Math.max(0, Math.min(255, Math.round(t)));
804
- function M(t) {
805
- if (t.length !== 3 || t.some((f) => !Number.isFinite(f))) throw new RangeError("RGB must contain three finite components");
806
- }
807
- function b0(t, f) {
808
- M(t);
809
- const c = typeof f == "string" ? g0[f] : f;
810
- return M(c.mul), M(c.add), t.map((e, n) => D(e * c.mul[n] + c.add[n]));
811
- }
812
- function F0(t, f, c, e) {
813
- if (!Number.isSafeInteger(t) || t < 1 || t > 256) throw new RangeError("Ramp size must be 1..256");
814
- return M(f), M(c), e && M(e), Array.from({ length: t }, (n, s) => {
815
- const r = t === 1 ? 0 : s / (t - 1), [o, i, a] = e ? r < 0.5 ? [f, e, r * 2] : [e, c, (r - 0.5) * 2] : [f, c, r];
816
- return o.map((h, l) => D(h + (i[l] - h) * a));
817
- });
818
- }
819
- function Y0(t, f, c = [0, 255]) {
820
- if (t.length !== 768 || t.some((s) => s > 63)) throw new RangeError("Expected a 768-byte six-bit VGA palette");
821
- if (c.some((s) => !Number.isInteger(s) || s < 0 || s > 255)) throw new RangeError("Preserved palette indexes must be 0..255");
822
- const e = new Set(c), n = t.slice();
823
- for (let s = 0; s < 256; s++) {
824
- if (e.has(s)) continue;
825
- const r = [P(t[s * 3]), P(t[s * 3 + 1]), P(t[s * 3 + 2])];
826
- n.set(
827
- b0(r, f).map((o) => o >> 2),
828
- s * 3
829
- );
830
- }
831
- return n;
832
- }
1
+ import { Pixels as o, dither as t, rng as p } from "./kit/pixels.js";
2
+ import { PaletteBuilder as l } from "./kit/palette.js";
3
+ import { centered as a, createPcText as x, outlined as c, text as d, textWidth as f } from "./kit/pcText.js";
4
+ import { CLEAR as s, asciiArt as h, asciiSprite as T, outline as u, outlineInPlace as _, over as P, recolor as R, scaleBlit as b, scaleBlitTransparent as A } from "./kit/blit.js";
5
+ import { bevel as I, blob as S, gradient as g, pool as B, rampShift as O, shadeAt as Y, speckle as v } from "./kit/shading.js";
6
+ import { describe as w, readBounds as E, textInk as F } from "./kit/textBounds.js";
7
+ import { Reel as H, dimmed as L } from "./kit/reel.js";
8
+ import { FONT8X8 as k } from "@lewismoten/gamemaker-sandbox-engine/gfx/font8x8";
9
+ import { dropShadow as D, encodeText as N, glyphRows as X, renderText as j } from "./text.js";
10
+ import { TIME_OF_DAY_LIGHT as Q, TIME_OF_DAY_SKY as U, adjustPalette as q, colorRamp as z, hsvToRgb as J, lightColor as V, rgbToHsv as Z } from "./colors.js";
11
+ import { createMicroText as ee, micro as re, microAdvance as oe, microWidth as te } from "./kit/microText.js";
12
+ import { MICRO_GLYPHS as ie, MICRO_SQUARE_GLYPHS as le, microGlyphs as me } from "./microFont.js";
13
+ import { flipX as xe, flipY as ce, resampleBlit as de, rotate as fe, turn180 as ne, turn45 as se, turn90 as he } from "./kit/transforms.js";
14
+ import { clamp as ue, mixc as _e, noise2 as Pe, smooth as Re } from "./kit/coverPaint.js";
15
+ import { buildRampPalette as Ae, wrap as Ce, wrapWithBuilder as Ie } from "./kit/palRamps.js";
16
+ import { FONT_CP437 as ge } from "@lewismoten/gamemaker-sandbox-engine/gfx/cp437Glyphs";
17
+ import { fromCp437 as Oe, toCp437 as Ye } from "@lewismoten/gamemaker-sandbox-engine/text/cp437";
833
18
  export {
834
- E as CLEAR,
835
- B as FONT8X8,
836
- u0 as FONT_CP437,
837
- Y as MICRO_GLYPHS,
838
- E0 as PaletteBuilder,
839
- g as Pixels,
840
- _0 as Reel,
841
- g0 as TIME_OF_DAY_LIGHT,
842
- T0 as TIME_OF_DAY_SKY,
843
- Y0 as adjustPalette,
844
- O0 as bevel,
845
- P0 as blob,
846
- S0 as centered,
847
- F0 as colorRamp,
848
- I0 as describe,
849
- T as dimmed,
850
- K as dither,
851
- w0 as dropShadow,
852
- p0 as encodeText,
853
- L as fromCp437,
854
- m0 as glyphRows,
855
- R0 as gradient,
856
- b0 as lightColor,
857
- N0 as outline,
858
- a0 as outlined,
859
- C0 as over,
860
- $0 as readBounds,
861
- v0 as recolor,
862
- j0 as renderText,
863
- V as rng,
864
- A0 as scaleBlit,
865
- G as shadeAt,
866
- U0 as speckle,
867
- N as text,
868
- r0 as textInk,
869
- i0 as textWidth,
870
- F as toCp437
19
+ s as CLEAR,
20
+ k as FONT8X8,
21
+ ge as FONT_CP437,
22
+ ie as MICRO_GLYPHS,
23
+ le as MICRO_SQUARE_GLYPHS,
24
+ l as PaletteBuilder,
25
+ o as Pixels,
26
+ H as Reel,
27
+ Q as TIME_OF_DAY_LIGHT,
28
+ U as TIME_OF_DAY_SKY,
29
+ q as adjustPalette,
30
+ h as asciiArt,
31
+ T as asciiSprite,
32
+ I as bevel,
33
+ S as blob,
34
+ Ae as buildRampPalette,
35
+ a as centered,
36
+ ue as clamp,
37
+ z as colorRamp,
38
+ ee as createMicroText,
39
+ x as createPcText,
40
+ w as describe,
41
+ L as dimmed,
42
+ t as dither,
43
+ D as dropShadow,
44
+ N as encodeText,
45
+ xe as flipX,
46
+ ce as flipY,
47
+ Oe as fromCp437,
48
+ X as glyphRows,
49
+ g as gradient,
50
+ J as hsvToRgb,
51
+ V as lightColor,
52
+ re as micro,
53
+ oe as microAdvance,
54
+ me as microGlyphs,
55
+ te as microWidth,
56
+ _e as mixc,
57
+ Pe as noise2,
58
+ u as outline,
59
+ _ as outlineInPlace,
60
+ c as outlined,
61
+ P as over,
62
+ B as pool,
63
+ O as rampShift,
64
+ E as readBounds,
65
+ R as recolor,
66
+ j as renderText,
67
+ de as resampleBlit,
68
+ Z as rgbToHsv,
69
+ p as rng,
70
+ fe as rotate,
71
+ b as scaleBlit,
72
+ A as scaleBlitTransparent,
73
+ Y as shadeAt,
74
+ Re as smooth,
75
+ v as speckle,
76
+ d as text,
77
+ F as textInk,
78
+ f as textWidth,
79
+ Ye as toCp437,
80
+ ne as turn180,
81
+ se as turn45,
82
+ he as turn90,
83
+ Ce as wrap,
84
+ Ie as wrapWithBuilder
871
85
  };