The `if` statement should have been a `for` loop, in order to allow recursively
sorting the subarrays with quicksort, and not resort to shell sort after
one step.
Additionally:
- Firm up PNG loader with some additional checks.
- Add helper functions to `core:image` to expand grayscale to RGB(A), and so on.
TODO: Possibly replace PNG's post-processing steps with calls to the new helper functions.
A package has canonically always been a directory, but odin allowing you to build a single-file package confused newcomers who didn't understand why they could then not access variables and procedures from another file in the same directory.
This change disallows building single-file packages by default, requiring the `-file` flag to acknowledge you understand the nuance.
`-help` for these commands also clarifies the difference.
```
W:\Odin>odin build -help
odin is a tool for managing Odin source code
Usage:
odin build [arguments]
build Compile directory of .odin files as an executable.
One must contain the program's entry point, all must be in the same package.
Use `-file` to build a single file instead.
Examples:
odin build . # Build package in current directory
odin build <dir> # Build package in <dir>
odin build filename.odin -file # Build single-file package, must contain entry point.
Flags
-file
Tells `odin build` to treat the given file as a self-contained package.
This means that `<dir>/a.odin` won't have access to `<dir>/b.odin`'s contents.
```
```
W:\Odin>odin run examples\demo\demo.odin
ERROR: `odin run` takes a package as its first argument.
Did you mean `odin run examples\demo\demo.odin -file`?
The `-file` flag tells it to treat a file as a self-contained package.
```
Add `print(x, y, text, color, quad_buffer)` version that takes `[]quad`.
(Same internal memory layout as []u8 API, but more convenient for the caller.)
Add optional `scale := f32(1.0)` param to `print` to embiggen the glyph quads.
```odin
// Example for use with vendor:raylib
quads: [999]easy_font.Quad = ---
color := rl.GREEN
c := transmute(easy_font.Color)color
num_quads := easy_font.print(10, 60, TEXT, c, quads[:])
for q in quads[:num_quads] {
tl := q.tl.v
br := q.br.v
color = transmute(rl.Color)q.tl.c
r := rl.Rectangle{x = tl.x, y = tl.y, width = br.x - tl.x, height = br.y - tl.y}
// Yes, we could just use the `color` from above, but this shows how to get it back from the vertex.
// And in practice this code will likely not live as close to the `easy_font` call.
rl.DrawRectangleRec(r, color)
}
```