Commit Graph

12 Commits

Author SHA1 Message Date
Kartik K. Agaram 007b965b11 audit all asserts
Each one should provide a message that will show up within LÖVE. Stop
relying on nearby prints to the terminal.

I also found some unnecessary ones.

There is some potential here for performance regressions: the format()
calls will trigger whether or not the assertion fails, and cause
allocations. So far Lua's GC seems good enough to manage the load even
with Moby Dick, even in some situations that caused issues in the past
like undo.
2023-11-18 11:32:01 -08:00
Kartik K. Agaram 6e54ad55d9 yet another set of bugfixes
The key API change I'd underestimated: opening a file used to return nil
on failure, and now returns false.
2023-08-30 23:52:25 -07:00
Kartik K. Agaram 06ad5c4e8c bugfix in source editor
We now need to explicitly select the directory we want to read from.
2023-08-30 22:30:20 -07:00
Kartik K. Agaram f82c0de502 cleaner API for file-system access
Thanks to physfs and nativefs.lua

nativefs still introduces some inconsistencies with love.filesystem with
relative paths:

  * love.fs.read: reads from save dir if it exists, falls back to source dir if not
  * nativefs.read: reads from save dir if it exists, falls back to source dir if not ✓

  * love.fs.write: always writes to save dir
  * nativefs.write: always writes to source dir (since no restrictions)

  * love.fs.newFile followed by file:open('r'): reads from save dir if it exists, source dir if not
  * nativefs.newFile followed by file:open('r'): always reads from working dir

  * love.fs.newFile followed by file:open('w'): always writes to save dir
  * nativefs.newFile followed by file:open('w'): always writes to working dir

So avoid using relative paths with App primitives.
2023-08-30 19:04:06 -07:00
Kartik K. Agaram da21512440 bugfix: drawings in source editor
Broken since 2022-09 X-(

Scenario:
* switch to source editor
* draw a line
* wait 3 seconds

Before this commit the app would crash and then fail to restart until
you deleted the created .lua file from save dir.

This is not the first time I've confused Lua's files and LÖVE's
droppedFile objects. Just never rely on multiple args in file:write().
2023-05-30 00:02:09 -07:00
Kartik K. Agaram 86517606a1 clean up some final bifold code 2023-04-01 20:39:53 -07:00
Kartik K. Agaram d1dd3e441f fix support for absolute paths in Windows 2022-09-26 15:19:47 -07:00
Kartik K. Agaram d1d05fe5c9 migrate old settings, attempt #3
This time we have to handle absolute filenames.
Now lines-polygon-experiment fork should merge successfully, at least.
2022-09-19 00:53:25 -07:00
Kartik K. Agaram 9a41c7c176 more correct absolute path detection 2022-09-11 08:31:05 -07:00
Kartik K. Agaram 528c64d690 support drawings in the source editor 2022-09-05 11:29:39 -07:00
Kartik K. Agaram 9a1e297ee3 duplicate 2022-09-03 14:59:57 -07:00
Kartik K. Agaram e1c5a42f31 editing source code from within the app
integrated from pong.love via text.love:
  https://merveilles.town/@akkartik/108933336531898243
2022-09-03 14:13:22 -07:00