BambooBasic

Version History, and general rambling! ;)

v1_2g (Another big'un)

	- New: Target > Desktop (Vulkan). A second Windows target on the Vulkan runtime that the
	  Linux editions use, so a game behaves the same on Windows and Linux, shaders and all.
	  Programs import BBRuntimeVulkan.decls, shaders are GLSL, and #If DESKTOP_VK picks it in
	  conditional compiling. BGI (the same Win32 gizmos as DX12), canvases with their own
	  swapchains, and movies (Media Foundation) all work.
	  See "Desktop (Vulkan) Target" in the docs.

	- New JSON functions: jsonBeginObjectField starts an object as a field's value
	  ("address": {...}), and jsonAddString, jsonAddInt and jsonAddDouble add values with no key
	  to an array ("hobbies": ["Reading", "Cycling"]). Neither could be written before.
	  Thanks to Mike for spotting it.
	- New: the JSON functions on both web targets. All 21 are there, writing and reading, and
	  they give the same text as desktop, character for character.
	- New: objects can be read back. jsonReadObject gives a field's object as JSON text, ready
	  for the other readers, and jsonGetObjectCount and jsonGetObjectKey go through its fields
	  in order. A key of "" means the text itself, so they work on an object from
	  jsonGetArrayElement too. Thanks to Mike for asking.
	- Fixed: the JSON readers stopped at a value that had the same text as the key, so in
	  {"type":"name","name":"Bob"} reading "name" gave "". A "zip" inside a string could match
	  too. Only keys count now.
	- Fixed: a string with the word New in it, such as "New York", stopped the build with
	  "Type mismatch" when the result was put in a variable:
	  json = jsonWriteString(json, "city", "New York")

	- New: b2dDrawImage9Slice draws an image as a box of any size with its corners kept at
	  their own size (9-slice), for panels, buttons and windows that fit any resolution.
	  Desktop (DX12 and Vulkan) and both web targets. Example: 1 - Graphics/NineSlice.bam.
	- New: sprite sheets. b2dCreateSubImage cuts an image out of another image (a sprite sheet
	  or atlas, any size, anywhere in it) and b2dCreateAnimSubImage cuts an animation out of
	  one. They share the sheet's texture - nothing is copied - and work with every draw,
	  collision and pixel function. Sprites from one sheet drawn one after another share a
	  draw call (200 sprites: 9 draw calls). All targets.
	  Example: 1 - Graphics/SpriteSheet.bam. Thanks to Mike for the idea.
	- Faster (DX12): images drawn one after another from the same texture (one image drawn
	  many times, or a sprite sheet's pieces) are now one draw call instead of one each.
	  20,000 sprites went from 172 to 651 fps, the mixed scene from 543 to 1291 fps.
	- Fixed (DX12): a program that loaded and freed images over and over ran out of image
	  slots after 512 loads; freed images now give their slot back. b2dGrabImage could take
	  another image's slot, b2dCopyImage lost the copy's smooth/sharp setting, and freeing a
	  locked image leaked its pixels.
	- Fixed (web): b2dDrawAnimImage on a plain image drew nothing (desktop draws the whole
	  image as frame 0), b2dDrawImageEx / b2dDrawAnimImageEx with a missing image put the
	  shader on the image drawn before, and b2dFreeMovie left the movie's texture behind.
	- Fixed (web): b2dCopyImage gave a copy that shared the original's texture, so freeing
	  one broke the other. The copy now has its own texture, as on desktop.
	- New: the includes folder (BambooBasic/includes). An Include that isn't found beside
	  the program is looked for there, so files shared between projects go in it once and
	  are included by name. BBR_INCLUDE.bam is in it, so Include "BBR_INCLUDE.bam" works
	  in any project without copying it. A file beside the program still wins, the code
	  made from an included file stays in your project, and the IDE's autocomplete reads
	  the folder too. Desktop, web and PlayStation. Thanks to Mike for the idea.
	- New: Data, Read and Restore, the classic BASIC way to keep tables of values in a
	  program. Data 3, "Forest", 1.5 holds numbers and strings, Read takes the next ones
	  into variables (converted to each variable's type), and Restore goes back to the
	  start, or to a label: .level2 on its own line marks a place, and Restore level2 reads
	  from there. Desktop, web and PlayStation. Example in Language/22 - Data, and "Data,
	  Read and Restore" in the docs. A variable called data, read or restore still works.
	  Thanks to KURON for asking.
	- Fixed: joining a number to a string with & gave junk (or blanks) when the number was an
	  array element (s = "n=" & arr[1]), a field ("hp=" & o\hp) or came first (a & " x").
	  An element of a Global array ("g=" & garr[2]) didn't compile at all.
	  Print was fine; assignments, Locals, Returns and a function's arguments weren't. On the
	  web, a & b & " x" added the numbers first. Desktop, web and PlayStation.
	- New: Build > Clean Build Files... deletes the C++, object and list files a build leaves
	  beside the program (its Includes' too), keeping the .bam files, the program, DLLs and
	  Media, so the folder is ready to share.
	- New: the Open and Save As dialogs start in the folder you last used. It's a setting in
	  IDE Options (on by default).
	- New: Help > Copy Bug Report Form copies the system details and the forum's bug report
	  headings, ready to paste into a new thread and fill in.
	- New: the IDE's settings (editor.conf, recent files and the open files) are kept in your
	  user settings folder (%APPDATA%\BambooBasic), so a new version of BambooBasic starts
	  with them. The first run takes over the ones in config\.
	  Thanks to Mike for all of these.
	- Fixed: Go to Definition (right-click) said "not found" for a Function or Method with a
	  return type (Function Make:String(...)), for anything in an Include in another folder
	  (Include "lib/wsg.bam", "../shared/util.bam"), and for anything in an Include's own
	  Includes. It now finds all three, and opens the file at the definition.
	- Changed: Go to Definition is now Shift+F12. F12 is Debug > Continue, so it only ever
	  said "Not currently debugging." (Ctrl+F12 is Show Desktop on KDE, so Shift+F12 is the
	  same key on Windows and Linux.) Thanks to Mike Hart for both.

	- Fixed: building one of a program's Include files on its own, then a Quick Build of the
	  main file, failed with a missing "_program.h" header. Quick Build now sees that the
	  generated files were changed by the other build and transpiles again.
	- Fixed: a locked build file is locked again when the IDE reopens it.
	- Fixed: the Contents list was empty after the IDE reopened its files, until you edited
	  or switched tabs.
	- USB (ISO): the runtime that goes on the stick now comes with BambooBasic itself
	  (userlibs), so it always matches this version.
	  Thanks to Mike for the bug reports.

	- Fixed: more than one text shader in a frame. Text drawn with a second text shader, or with
	  the same shader in another font, went missing, and shaded text over 256 characters lost
	  its start. Image and text shaders also all used the last draw's parameters, so two copies
	  of a shader with different settings looked the same.
	- Fixed: AnimImageGlow.hlsl glowed at the edges of the whole sprite sheet, not each frame.
	  Its new parameters 4 and 5 take the frame size.

	- New: tilemaps, the tm commands, on desktop and both web targets. Build a map in code or
	  load one exported from Tiled (.tmj), draw it in layers with parallax, animated tiles,
	  flips and zoom, and change it while playing. Only the tiles on screen cost anything.
	  Collisions are questions your game asks: tmBoxHit, tmRayCast, and pixel shapes on tiles
	  with tmGroundProbe for slopes and loops. tmSetTileAuto paints and digs terrain and sorts
	  out the edges. Five examples in "29 - Tilemaps". See "Tilemaps" in the docs.
	  From Tiled it reads layers using several tilesets, image layers, infinite maps and the
	  background colour (tmUseBackground). Isometric, staggered and hexagonal maps work too, from
	  Tiled or built in code, and tmDrawLayerRow puts sprites in among the tiles on any shape of
	  map, so a character can walk behind a wall. New examples: IsoWalk and HexBoard.
	- A frame can now hold about 174,000 images on desktop, up from about 43,000. Past the
	  limit, what's drawn last goes missing with no error.

	- New: Target > USB (ISO). Build makes a bootable ISO of your game: write it to a USB
	  stick and a PC starts straight into the game, with no system to install. It powers off
	  when you quit. Build and Run tries it in QEMU. The tools are a one-time download. See
	  "USB Target" in the docs.

	- Git in the IDE (View > Git). A Git window to commit, pull and push, with a list of
	  what changed and tick boxes for what goes in; change marks beside your code (green new,
	  blue changed, red deleted) that update as you type, with a click to see or put back the
	  old lines; compare a file with its last commit side by side; the history of a project
	  or a file (open, compare or undo any commit); branches (switch, new, merge, delete, put
	  changes aside); and help sorting out merge clashes (keep yours, theirs or both). It
	  works on one Git project at a time - a repository, or one folder inside it - so other
	  files you have open never get committed by accident. It uses Git itself (a free
	  download from git-scm.com) and Git's own sign-in for GitHub and GitLab. See "Git" in
	  the docs.
	- Edit > IDE Options > Remember the IDE's size and position. Off unless you turn it on. If
	  the saved place is on a screen that's no longer connected, the IDE opens centred instead.
	- Twaddle > Copy System Info. Copies your IDE version, system, graphics card and screens to
	  the clipboard, ready to paste into a bug report.
	- Fixed: a pale line round the outline of an image drawn scaled, when its transparent pixels
	  hold a colour such as white (Inkscape saves them that way). No need to export it again.
	- Build > Command Line... - the arguments your program gets when you run it from the
	  IDE (Build and Run, Safe Build and Run, debugging), for testing sysArg, sysArgCount and
	  sysCommandLine. Kept for each program. On the web targets they go in the page address
	  (MyGame.html?level=3&mute), which is where a web program reads them.
	- New: Build > Build For Itch (Web), on the web targets. It builds your game and makes a
	  zip ready to upload to itch.io as a browser game (ItchOutput folder in your project),
	  with a plain page that scales the game to fit itch.io's window and its fullscreen
	  button, keeping its shape. Choose a page title and crisp pixels for pixel art. It warns
	  about file names whose upper and lower case don't match (fine on Windows, missing on
	  itch.io) and about itch.io's size limits. See "Publishing on itch.io" in the web docs.
	- Fixed: a web game on another site's page, such as itch.io, didn't get the keys when
	  clicked: they went to the site's page, and Space scrolled it.
	- Fixed: on the web, MouseX and MouseY were wrong when the page showed the game bigger or
	  smaller than its own size, and 2 pixels out on the normal page (its border).
	- New: conditional compiling, so one program can build for several targets. #If, #ElseIf,
	  #Else and #EndIf, with Not, And, Or and brackets, and #Define for names of your own.
	  Each target sets its names: DESKTOP_WIN, DESKTOP_DEB, DESKTOP_ARC (and DESKTOP for all
	  three), WEB_GPU, WEB_GL2 (and WEB for both), TARGET_PS1 and TARGET_USB. Code that's left
	  out is never read, so it can hold another target's Import, Include or commands.
	  #If False switches a block off. The editor greys out what the selected target leaves
	  out. See "Conditional Compiling" in the docs, and the example in
	  "21 - Conditional Compiling".
	- New: fileFileDate, fileFileTime and fileFileStamp, for when a file was last written.
	  The date and time come in the same form as sysCurrentDate and sysCurrentTime ("04 Nov
	  2026", "18:30:20"). The stamp is seconds since 1970, for comparing which file is
	  newer. Copying a file keeps its time. On the web, the time is recorded whenever a file
	  is written, so a file saved before this version has none until it's saved again.
	- New: sysLocalDate, today's date in the player's own style, as their computer or
	  browser writes it: 11/4/2026 in the US, 04/11/2026 in the UK. It's for showing on
	  screen; it differs from player to player, so use sysCurrentDate for anything saved.
	- Fixed: on the web, sysCurrentDate gave 04/11/2026 instead of 04 Nov 2026 as on desktop.
	  It's now the same everywhere.
	- New: ReDim, EraseDim and ArrayLength, for arrays whose size changes while the program
	  runs. ReDim map[w][h] gives new sizes and keeps what fits; EraseDim map[w][h] gives new
	  sizes and clears it; EraseDim map on its own clears it and keeps its sizes.
	  ArrayLength(map, 0) and ArrayLength(map, 1) give the sizes, and -1 for a dimension the
	  array doesn't have. They work on Local and Global
	  arrays, on every target. See "Resizing Arrays" in the docs and ReDim.bam in the Arrays
	  examples.
	- Fixed: Safe Build failed on a Global array used from another file or from a small
	  function ("..._size_0 was not declared").
	- A function can return an array sized while the program runs, into an array sized with
	  other names: Local level:Int[w][h] = CreateGrid(w, h), where CreateGrid has
	  Local grid:Int[cols][rows]. This was refused before, unless both used the same numbers.
	  The copy takes what both arrays have. On the web, returning a 2D or 3D array from a
	  function didn't work at all, and now does.
	- Fixed: a 2D or 3D Local array declared inside a loop or an If block didn't compile on
	  desktop. Such arrays are now freed when their block ends, each time round a loop and
	  on Exit, Continue and Return. A function with no Return used to keep its 2D and 3D
	  arrays forever; they're freed too now.
	- Edit > Go to Line... (Ctrl+G). The line you go to is put in the middle of the editor.
	- View > Sort Contents A-Z puts the toolbar's Contents list in name order. Picking an
	  entry there now puts it in the middle of the editor, and an entry on the very first
	  line works (it did nothing before).
	- Fixed: typing a word and then a space while the autocomplete list was showing took the
	  word but lost the space.
	- Typing a closing ", ) or ] when the editor has already put one after the cursor now
	  steps over it, so typing "x" gives "x", not "x"". A quote typed in front of a string
	  still starts a new one.
	- Fixed: the IDE froze for a couple of seconds after each pause in typing in a long
	  file kept in Git. The change marks never found the file's last commit, so they
	  marked every line as new and redrew them all every time. Now only the lines you've
	  changed are marked.
	- Fixed: the Output tab's X did nothing (only File > Close closed it). It now closes the
	  tab, and the next build opens it again.
	- Fixed: File > Open opened a second tab for a file that was already open. It now
	  switches to that file's tab.
	- Fixed: "a" & x + 1 and "a" & -x now work out the sum, then join it. Before, the first
	  didn't compile on desktop and joined wrongly on the web, and the second gave garbage.
	- Fixed: Print a && b now works. Print "text" && x gives an error saying to use a single &.
	- Fixed: a comparison inside Abs, Min, Sqrt and the other maths functions, or inside Chr,
	  Asc, ToInt, ToDouble or ToString, was an assignment: r = Abs(a = 1) changed a. It's now
	  compared, as it is for your own functions.
	- Fixed: with no sound device, audio start-up is tried once per Graphics rather than on
	  every audio call. The game carries on silent.
	- Fixed: Quick Build could miss changes to Included files. A build with nothing to do forgot
	  which files the program included, so later edits to them weren't built until the main file
	  changed. Projects affected sort themselves out on their next build.
	- Fixed: sound pops. Only the 16 loudest sounds were mixed, so a program with more running
	  than that, even silent loops, cut sounds dead and popped. A sound started quietly also
	  clicked, as it began at full volume and faded down.
	- Fixed: on desktop, leaving out b2dFlush() before b2dSetDefaultRenderTarget() could draw a
	  render target into itself, so its picture changed from run to run. The switch back now
	  waits its turn, as it does on the web. b2dFlush() there is still fine, and no longer needed.
	- Render targets on desktop: more than 256 draws in a frame no longer reuse a constant slot
	  the graphics card may not have read yet, and going straight from one target to another
	  now finishes with the first one properly.
	- Fixed: the IDE could use a lot of CPU with a Git-tracked file open that had change marks.
	- Fixed (thanks MikeHart): on desktop, audMusicPlaying gave 0 after audStopMusic and a
	  second audPlayMusic. The desktop music functions wanted the number audPlayMusic returned,
	  the web ones the audLoadMusic handle, and the handle only worked on desktop by luck the
	  first time. Now audStopMusic, audPauseMusic, audResumeMusic, audSetMusicVolume,
	  audSetMusicPan and audMusicPlaying take the audLoadMusic handle on every target, and act
	  on that music's latest play. The channel audPlayMusic returns still works too.
	- audPlayMusic on desktop now returns a channel, like audPlaySound, so the channel
	  functions work with it too. Playing music that's already playing restarts it.
	- On desktop, audChannelPlaying and audMusicPlaying give 0 while paused, as on the web.
	- The music pages in the docs say all this, and their examples are fixed.

v1_2f (Big'un)

	- New: a second web target, Web (WebGL2), in the Target menu beside Web (WebGPU). WebGPU
	  still isn't in every browser (Linux ones especially) or on older graphics, and WebGL2
	  is in practically all of them - so a game for a casual, wide audience can now run
	  anywhere. Import BBRuntimeWebGL2.decls instead of BBRuntimeWeb.decls: the same
	  functions, the same behaviour and the same pictures (checked pixel for pixel against
	  WebGPU), only what draws them differs. Which one runs is your choice when you build;
	  the page never swaps on its own. Shaders for it are GLSL (.glsl) instead of WGSL. See
	  "Building for the Web" in the docs, which now has a section on choosing between them.
	- Web examples ending _wgl are for Web (WebGL2), as _web ones are for Web (WebGPU). A set
	  of them is in the examples, and 9 - Shaders\ScreenShader_wgl.bam is the first web
	  shader example (a CRT effect).
	- Moving a web program between WebGPU and WebGL2 (by its Import line) keeps your
	  customised HTML page: only its <script> line for the runtime changes. If the Target
	  menu doesn't match the program's Import, the editor offers to switch it, as it does
	  between desktop and web.
	- When the graphics card stops responding (Windows resets the driver and the game stops
	  with "The graphics device was lost"), device_lost.txt beside the game now says more:
	  the GPU work that hadn't finished, the operation it stopped on (a draw, a copy...),
	  and, if it read memory it shouldn't have, where. Desktop only.
	- Web games no longer fail to start now and then with "Your graphics hardware can't run
	  this game in the browser" (the console said "No available adapters"). The browser can
	  have no WebGPU adapter for a moment (its GPU process starting or restarting), so the
	  runtime now asks again a few times over about 4 seconds, with each power preference,
	  before giving that message. The message now also says what fixes it when it has worked
	  before: close every window of the browser and start it again (reloading isn't enough).
	- Fixed adding a string function's result onto a String variable not compiling when the
	  function takes a number: s = s & strMid(t, i, 2) (or strLeft, strRight...) stopped with
	  "Type mismatch: Cannot assign int to std::string". The number inside the brackets was
	  mistaken for the type of the whole thing.
	- Fixed Return with an = comparison doing an assignment instead: Return a[x] = 0 now gives
	  True or False like an If would, and no longer overwrites a[x]. Desktop and web.
	- Fixed Asc() not going into an Int: b = Asc(t) (or Asc(t) + 1) stopped with "Type
	  mismatch: Cannot assign std::string to int".
	- Fixed passing a string function with sums in its brackets to your own function or
	  method: Show(strMid(t, i + 1, 1)) stopped with "expects type std::string but got int".
	  Desktop and web.
	- Asc() on the desktop now gives 128-255 for characters above 127 (accented letters, the
	  bytes of a UTF-8 £, binary data), the same as the web and strAsc. It used to give
	  negative numbers. If you added BitAnd $FF to work round it, that still works.
	- Fixed flag = b = 7 (and Local flag:Int = b = 7) changing b instead of comparing it: the
	  second = is now a comparison, so flag is True or False and b is left alone. Desktop and
	  web.
	- Numbers in scientific notation work: 2.0e-11, 1.5E+3, 1e6. The sign after the e used to
	  be split off as a minus or plus, so they wouldn't compile. Desktop and web.
	- b2dGetFPS() works on the web too (it was missing from the web runtime): frames shown
	  in the last second, the same as the desktop.
	- New: a built-in profiler. b2dShowProfiler(True) shows a panel with FPS, frame times and a
	  graph of them (stutters show as spikes), the CPU time your code used, the GPU time, the
	  number of draw calls, and your own sections: wrap code in sysProfileStart("Name") and
	  sysProfileEnd("Name") and it appears with its time and share of the frame. The figures can
	  also be read in code: b2dGetFrameTime, b2dGetGPUTime, b2dGetDrawCalls, sysProfileTime.
	  Desktop and web (on the web the GPU time is an estimate). See examples/BambooRuntime/
	  28 - Profiler.
	- Fixed the web runtime stopping when a frame drew more than about 8,000 rectangles, images
	  or text characters ("writeBuffer ... too large"): the vertex buffers now grow as needed.
	- Building a program for the wrong target is caught. If the program is a web one (it
	  imports BBRuntimeWeb.decls) but the Target menu is on Desktop, or the other way round,
	  the editor now asks before building: switch to the right target and build, build anyway,
	  or cancel. The transpilers also stop with a clear message instead of making a program
	  that crashes on start ("Failed to load BBRuntimeWeb.js" / "Bad Image").
	- Web: an Int divided by an Int is now a whole number, as on the desktop (7 / 2 = 3). It
	  used to give 3.5 in the browser, so an Int could hold a fraction and an array index
	  could miss - Local gx:Int = i / cells, garr[a / b], Print a / b. Divisions with a
	  Double in them (7.0 / 2, x / 2 where x is a Double) still give 3.5.
	- Web: ToInt() now cuts towards zero like the desktop: ToInt(-2.5) is -2 (it was -3),
	  and a tiny number such as 0.0000003 gives 0 (it could give 3).
	- New: b2dNoRuntimeSplash() starts a compiled program without the BambooBasic splash
	  screen. Call it before b2dGraphics. If the graphics can't start, a message box says why.
	- Programs that don't use AutoCall run their loops and function calls much faster. The
	  AutoCall timer check ran on every pass of every loop and read the clock each time; it's
	  now left out unless the program uses AutoCall, and skipped while no timers are set.
	  A tight loop of simple sums ran up to 28 times faster. Desktop and web.
	- New operator ShrU, a shift right that fills with zeros: -1 ShrU 28 is 15, where
	  -1 Shr 28 is -1 (Shr keeps the sign). Handy for pulling apart colours and other packed
	  32-bit values. Desktop and web., there is a point to this.
	- Fixed Print with a shift or a comparison in it not compiling: Print a Shr 1 and
	  Print "x=" & a Shr 1 now work.
	- Web: Print 1 & 2 now prints 12, as on the desktop (it added them and printed 3).
	- Hex numbers from $80000000 to $FFFFFFFF are now negative Ints, as they should be:
	  Print $FFFFFFFF gives -1 (it gave 4294967295), and comparing an Int with one works
	  properly - If x < $80000000 used to be true for x = 1. Smaller hex numbers are
	  unchanged. Desktop and web.
	- Fixed passing a global array to your own function in some places: with Global buf:Byte[8],
	  Local n:Int = Total(buf) stopped with "expects type uint8_t* but got uint8_t". Desktop
	  and web.
	- New: b2dSetImagePixels(image, pixels, width, height) fills a whole image from an Int
	  array in one call, one $AARRGGBB colour per pixel. Far quicker than b2dSetPixel for every
	  pixel, so you can draw your own pixels each frame (software rendering, plasma effects,
	  emulators). Desktop and web.
	- New: b2dSetImageSmooth(image, False) keeps an image's pixels sharp when it's drawn
	  bigger or smaller, for pixel art and retro screens. True puts the smoothing back.
	  Desktop and web.
	- New: fileReadBytes and fileWriteBytes read or write a block of bytes between a file and
	  a Byte array in one call, much quicker than a byte at a time. Desktop and web.
	- New: sound streams, for sound your program makes as it runs (a synth, a tracker
	  player, a *cough* emulator). audCreateStream(rate, channels) starts one, audQueueStream sends
	  it 16-bit samples from a Short array, audStreamQueued says how much is still waiting,
	  and audFreeStream stops it. If you fall behind it plays silence instead of stopping.
	  Desktop for now.
	- Fixed Return with an = comparison after a one-line If: If a > 0 Then Return a = b
	  assigned b to a instead of comparing them (Return on its own line was already fixed).
	  Desktop and web.
	- Byte (0 to 255) and Short (-32768 to 32767) are now documented and highlighted, with
	  three fixes: sums go back into them (b = b + 1 wouldn't compile, and nor would putting
	  a Byte array element straight into an Int); Print of a Byte shows the number instead
	  of a character on the desktop; and on the web they now wrap like the desktop's do
	  (300 in a Byte is 44, 40000 in a Short is -25536). Desktop and web.
	- New: sysArgCount(), sysArg(i) and sysCommandLine() read the command line a program
	  was started with: sysArg(1) is the first argument (quoted paths kept whole, quotes
	  taken off), sysArg(0) the program itself. On the web they read the page address's
	  ?query instead: game.html?level=3&mute gives level=3 and mute.
	- New: audSetReverb(preset, volume) puts reverb on the sound effects you play from then
	  on (not music): 1 room, 2-4 studio small/medium/large, 5 hall, 6 half echo, 7 space
	  echo, 8 chaos echo, 9 delay, 0 off. They are the PlayStation's own reverb presets,
	  worked out the same way, so a sound has the same reverb on desktop and web.
	- Fixed + with a string and a number: "Score: " + score printed part of the text or
	  garbage (Print "loaded " + 1 printed "oaded "), and "Speed " + 2.5 wouldn't compile.
	  + now joins whenever either side is a string, left to right like the web always did:
	  "a" + 1 + 2 is "a12", 1 + 2 + "a" is "3a". The same goes for & chains: "a" & n & 1
	  joins n and 1 instead of trying to OR them.
	- Fixed "Volume " & ToInt(v * 100) on the desktop: the number came out as one odd
	  character (or, with more after it, didn't compile). ToInt and ToDouble now join as
	  numbers. The web was already right.
	- New example: BambooRuntime\2 - Audio\Reverb.bam (and Reverb_web.bam) to try each
	  reverb preset and volume on a pistol shot.
	- Building is much faster. The transpiler turns big programs into C++ several times
	  quicker, and a program split into Include files is now built a file at a time: each
	  .bam becomes its own C++ file, and only the files you changed (and anything that
	  depends on them) are compiled again, several at once. Drifter Wings, a 12,000 line
	  game split into 52 files, went from 33 seconds a build to 5.5 for a full build and
	  under 2 seconds after editing a function. Desktop only (the web doesn't compile).
	  See examples/Language/20 - Multi-file
	- Build > Quick Build Mode now decides this: ticked, only what changed is built again;
	  unticked, everything is built from scratch.
	- Fixed reading a field straight off a function's result in a sum or a Print:
	  Print FurthestRight()\name stopped with a type error. Desktop and web.
	- Fixed debug builds stopping when an Element Local was declared inside a loop.
	- Fixed = inside brackets being taken as an assignment instead of a comparison:
	  b2dSetImageSmooth(img, mode = 2) set mode to 2, Show(a = 2) changed a, and
	  arr[i = 1] = 9 assigned i. An = inside brackets (a function's arguments, a
	  sub-expression, an array index) now always compares.
	- Fixed comparisons in Print: Print a = 2 assigned 2 to a (it now prints whether a is
	  2: 1 or 0, or true / false in a web browser), and
	  Print a <> 2 wouldn't compile. Desktop and web.

v1_2e

	- BGI works on the web! GUI programs now build for the Web target too. Windows, buttons,
	  lists, menus, tabs, tree and list views, toolbars, date/time pickers, rich text boxes,
	  canvases and the rest are drawn inside the page's canvas, in the same classic Windows
	  look, using Dear ImGui (built into the runtime, nothing extra to install). The same bgi
	  calls, handles and events work, so most GUI programs carry over as they are - the loop
	  body moves into WebLoop() like any web program. Designer (.bgi) files are built into the
	  program, so bgiLoadGizmos works straight away. See docs/web.html (BGI section), and the
	  *_web examples in examples/BambooRuntime/11 - BGI and 13 - Designer.
	- A browser can't stop and wait, so on the web message boxes and the open, save, colour
	  and font dialogs return at once and the answer arrives as an event - see the new
	  BGI_EVENT_ID_DIALOG, _FILEDIALOG, _COLORDIALOG and _FONTDIALOG in BBR_INCLUDE.bam. A web
	  page can't close itself either, so the main window's X folds it up to a little title
	  bar (X or a double-click opens it again); other windows close as normal.
	- The web RichTextBox does real formatting: bold, italic, underline, sizes and colours,
	  mouse selection, copy/paste and undo, and it reads and writes RTF, so files go back and
	  forth with the desktop version.
	- Added IGI, the Immediate Gizmo Interface: an in-game GUI built on Dear ImGui, for menus,
	  HUDs, debug panels and editors drawn over your game. Call the igi functions every frame
	  (values go in, new values come out: volume = igiSliderInt("Volume", volume, 0, 100)) -
	  windows, buttons, sliders, text boxes, drop-downs, lists, trees, tabs, menus, pop-ups,
	  images and more, 69 functions. Unlike BGI it's fully styleable: themes, all of ImGui's
	  colours (with ImGui's names, so shared ImGui themes copy across), roundings, sizes and
	  your own fonts. Same on desktop and web. See docs/igi.html and examples/BambooRuntime/27 - IGI.
	- IGI has a code editor: syntax colouring, line numbers, undo, marked lines with tooltips
	  (for errors), read-only and more. Languages are .lang text files you can write yourself;
	  BambooBasic (coloured like the IDE), C++, Lua, WGSL and HLSL come in userlibs\languages.
	  See the code editor section of docs/igi.html and example 05_CodeEditor.
	- Fixed strInstr on the web: it now counts from 1 and returns 0 when not found, like the
	  desktop and the docs (it used to return 0-based positions and -1).
	- Fixed a screen shader on the desktop leaving trails in 2D programs: b2dCls now clears to
	  the b2dSetClsColor colour under a screen shader too.
	- Fixed ToDouble / ToInt of a String array element (ToDouble(words[1])) not compiling on
	  the desktop, in a Print as well as anywhere else.
	- Game controllers work on the web! The same inpCreateController, button, D-pad, trigger,
	  stick and vibration calls as desktop, with the same XINPUT_GAMEPAD_* constants, using
	  the browser's Gamepad API. A browser only shows a pad once a button has been pressed on
	  it, so wait for that rather than quitting when none is found. Rumble works in Edge and
	  Chrome. See Controller_Down_web and Controller_Hit_web in examples/BambooRuntime/3 - Input.
	- Added fileExportWeb(), fileImportWeb() and fileImportWebResult() (web only), for any web
	  program: export downloads a file from the browser's storage to the user's computer, import
	  lets them pick a file to bring in (check fileImportWebResult each frame for its name).
	- Added bgiExportFileWeb() and bgiImportFileWeb() (web only): the same for BGI programs, with
	  the import's answer arriving as a BGI event. The RichTextBox web example has Export RTF
	  and Import RTF buttons to show them off.
	- File -> New -> BGI Application now asks Desktop or Web, and writes the right template
	  for each (the web one also switches the build target to Web). The designer keeps its
	  event dispatcher up to date wherever it lives, WebLoop() included.
	- Fixed the New BGI Application template using old calls that no longer exist, and the
	  designer's generated onSelect handlers calling a missing Str().
	- Designer fixes: switching tabs now saves the dialog to the right .bam.bgi, text with
	  quotes or < > & in it saves and loads properly, and nested submenus load correctly.
	- bgiProcessGizmoEvents: menu items now fire their own onClick, and list and combo boxes
	  fire onSelect. bgiLoadGizmos: empty tab controls, list views and toolbars load, and
	  nested submenus keep their items.
	- b2dSetMaxFPS now really caps the frame rate when vsync is off.
	- Tree view: renaming a node updates its text. Spinners take the full 32-bit range.
	- The b2d file dialogs could hand back a garbled file name; fixed.
	- Web target: s = s & Chr(13) (a string added to with &) no longer gets mistaken for a
	  number.
	- Web target: the right and middle mouse buttons were swapped (VMOUSE_RBUTTON read the
	  middle button and VMOUSE_MBUTTON the right); fixed.
	- The web server could randomly fail to send a script, so a page sometimes didn't start;
	  fixed.
	- Fixed small bugs in the Trigonometry, BackupRestore, Controller_Hit and TCP/UDP
	  transfer examples.
	- Docs: the designer page is rewritten, and docs/web.html has the new BGI section. The BGI
	  reference pages note where the web behaves differently.

v1_2d (Release was skipped as other things cropped up)

	- Movies are real video files now! b2dLoadMovie takes an .mp4, .mkv, .webm and so on
	  directly - the old .bbv format and its converter are gone. Same calls as before (play,
	  pause, resume, stop, loop, volume, draw, draw scaled), and the picture keeps time with a
	  real clock, so a slow frame skips rather than slowing the film down. The soundtrack plays
	  through the same audio engine as everything else. Decoding is done by Windows' own Media
	  Foundation on desktop, and by HTML5 video on the web. See examples/BambooRuntime/1 - Graphics (DrawMovie...).
	- Added b2dLoadMesh(), which loads 3D models baked to .bb3d, animated ones included. The
	  runtime stores the model and blends its animation frames; your program turns and
	  projects the points and draws the faces, the 3D-in-2D way. b2dMeshAnimate will blend ANY
	  two frames, so if a model's animation clips are rubbish (some exporters make every clip
	  the whole animation) you can still loop just the frames you want. Models with no texture
	  carry their own face colours - b2dMeshFaceR/G/B. Animation frames are compressed in the
	  file, so animated models stay small. Desktop + Web. See examples/BambooRuntime/26 - 3D in 2D (Mesh...),
	  and docs/3d_in_2d.html.
	- Added b2dFreeMesh(), to free a loaded mesh (and its texture) when you're done with it.
	  Desktop + Web.
	- Added Tools -> GLB to .bb3d Mesh Converter to the IDE, to make those models. Point it at a
	  .glb, pick a folder and a name, and it writes the .bb3d plus the texture as a .png. Skeletal
	  animation is baked to frames at the rate you choose. Afterwards it offers a preview you can
	  scrub through frame by frame, which is the way to find out which frame numbers are which
	  movement when a model's clips are no help.
	- Added b2dDrawImageQuad(), which stretches an image over any four corners, and
	  b2dDrawImageQuadDepth(), the same with a depth per corner so textured faces hide each
	  other properly without sorting. The UV versions, b2dDrawImageQuadUV and
	  b2dDrawImageQuadDepthUV, let each corner show a chosen part of the image - atlases, or
	  a model's own texture mapping. Desktop + Web. See examples/BambooRuntime/26 - 3D in 2D (ImageQuad...).
	- Added b2dLoadTTF(), which loads a .ttf/.otf font and gives back a normal font handle, so
	  every text command works with it. Glyphs are drawn as they're needed, so proper Unicode
	  works too - accents, Cyrillic, Greek, even CJK. Desktop + Web.
	- b2dDrawQuadDepth now works on the web target too.
	- Debug builds of big programs compile MUCH faster. The debugger used to send every
	  global and constant after every single line, which made the generated code enormous
	  (27 MB for Anti-Tetrafied); it now sends them only when you are actually paused, which
	  took that down to 556 KB. As a bonus, globals now show in the variables panel while you
	  are paused inside a function too, not just in Main.
	- Fixed building a string with & that includes a function returning a number, like
	  s = "Score: " & GetScore(). It would not compile unless you Printed it directly. Same
	  for a plain number (s = "Lives: " & 3).
	- Fixed & inside brackets in a Print, like Print strUpper("Lives: " & lives), which came
	  out as a bitwise OR and wouldn't compile. Also Chr() and Asc() in a Print, two string
	  literals joined with & ("a" & "b"), and & with numbers on the web target.
	- Sprite sheets (b2dLoadAnimImage) and fonts (b2dLoadFont) no longer bleed into the
	  neighbouring frame or letter when drawn small.
	- Two or more movies playing at once now all move - before, only the last one played did.
	- b2dLoadMesh returns 0 for a damaged or cut-short .bb3d file instead of crashing.
	- Mesh examples no longer draw the model tinted by the help text colour.
	- Fixed the clean-up of old build files being able to delete files OUTSIDE your project,
	  if a project folder had been copied or moved. It now only touches files inside the
	  build folders, and never a .bam.
	- Web target: True/False now come out as 1/0, like desktop, so an Int flag survives being
	  turned into a string and back.
	- Builds work with Windows 11's Smart App Control switched on. It blocks MinGW's linker
	  helper (collect2.exe), which made every desktop build fail at the link step; the IDE now
	  spots this and links with ld.exe directly instead, with the exact same settings.
	- The web server no longer gives up if another program is already using port 8000 - it
	  moves on to the next free port (8001, 8002...) and shows the real address in its window.
	  It also takes the port for itself only, so it can't end up sharing one with another
	  program, and its status now says when it fails instead of always saying "Running".
	- Added the AI Assistant (View -> AI Assistant, Ctrl+Shift+A): a Claude chat window in the
	  IDE, using your own Anthropic API key. Attach your code and it can explain it, fix build
	  errors and edit attached files for you (Ctrl+Z undoes). See docs/ai_assistant.html.

v1_2c

	- Added b2dDrawQuadDepth - like b2dDrawQuad but each corner takes its own depth
	  (0..1), interpolated per-pixel by the GPU. This is what proper "3D in 2D" wants:
	  interpenetrating and steeply-tilted faces now resolve correctly per pixel, so
	  you can draw everything in any order with no backface culling. (b2dSetDepth gives
	  a whole quad ONE flat depth, which can't separate a solid's own overlapping
	  faces - that's what this fixes.) Desktop + Web; see the "3D in 2D" doc.
	  NOTE: feed perspective-correct corner depths (a + b/z), not raw view-z.
	- New examples: "26 - 3D in 2D Stress" (rotating-cube benchmark) and
	  "27 - Quad Depth" (flat vs per-corner depth toggle), desktop + web.

v1_2b

	- Big one: the runtime is now 2D across the board. The 3D (b3d*) engine has been
	  retired so every target (Windows, Web, Linux) sits on the same 2D runtime and
	  the same API. The old 3D runtime stays available but won't be updated.
	- The handful of functions worth keeping have been renamed from b3d* to b2d*
	  (display setup, cls, flip, the frame loop, and the full-screen shaders).
	- 3D-in-2D! A few small 2D additions make real 3D possible with 2D commands:
		- b2dDrawQuad - draw an arbitrary 4-point polygon (not just rectangles)
		- b2dSetDepth - a proper per-pixel GPU depth buffer for 2D primitives, so you
		  can draw in any order and let the hardware sort out what's in front (see docs
		  + the new "3D in 2D" tutorial)
	- b2dSetClipRect / b2dClearClipRect - 2D scissor clipping.
	- Indexed images now build a full mipmap chain (no more shimmer when scaled down)
	  and the 2D texture limit is up from 256 to 512.
	- BGI canvases are now 2D-only (bgiCreateCanvas).
	- Removed the 3D tools from the IDE's Tools menu.
	- Fixes: palette-cycling text draw order, F1 detailed-help lookup, and web
	  key-repeat firing key-hits every frame.

v1_2
	
	- Another one for the codgers amongst us; Palette Cycling & Indexed Colour functions (see docs)
	- Fixed a few editor loose ends
	- Fixed FileCopy bug that would always return 0, even if the file was copied successfully
	- Added "PreCalc" block, this runs at build time, inside the transpiler, and bakes its 
	  results into your program as an array literal. (See docs) 
	- Added "AutoCall", which calls a function once/every specified amount of milliseconds... Think
	  Amstrad CPC's software interrupt mechanism... Sorry, I had to do it! ;)
	- Added With...EndWith block, for adding data to type and element fields (syntax sugar really),
	  again, see docs.
	- Added string interpolation for string variables/objects fields e.g. 
		
		Local age:Int = 49
		Print "My age is {%age}"
		
		Output: My age is 49
		
	- Added "Sequence"'s, which are BambooBasic's version of proper list containers (See docs)
	- Added Elements, which can we used with Sequence lists (Like Types, but not, again, see docs) 
	- Hopefully fixed intergrated/discrete combo GPU device crashes (and stop Window
	  updates breaking settings), also, a fall back to WARP, so the app shouldnt die when opened
	  on less-spec'd machines, though, it will probably run like shit! :D

v1_1
	
	- Added "Experimental" web target
	- Fixed screen shader code as I had hardcoded values in them when testing with the CRT shader
	- Fixed mid-frame GPU buffer resizing when dynamically adding entities.
	- Transpiler fix, detects unclosed blocks (If, Select etc etc)
	- Fixed type iteration crash when removing objects from the internal list in a For Each loop
	- Fixed jsonGetArrayCount returning the wrong value.
	- Added b3dCenterMesh(), b3dOpenFileDialog(), b3dSaveFileDialog and b3dOpenFolderDialog.
	- Fixed b3dCountTriangles for GPU meshes
	- Fixed DXGI shutdown crash (Cheers Amon)
	- Fixed b3dLoadBRSFile() function in regards to rotation.

v1_0

	- Full release... To much to add since I added 3D stuff, but, this IS the baseline now!