Features
- option to disable transparent darkrooms stacking multiple transparent layers
d9d3ac8e4
ZScript
- add template types to some internal functions
633d75471
The following internal functions have switched from using
untyped
to template types:void ArrayPushBack(T[] arr, T val) void ArrayPushFront(T[] arr, T val) void ArrayPushAt(T[] arr, T val, int index) T ArrayPopBack(T[] arr) T ArrayPopFront(T[] arr) T ArrayPopAt(T[] arr) void ArrayCopy(T[] dest, T[] src) int SizeOfArray(T[] arr) void ResizeArray(T[] arr, int sz) void OwnArray(T[] arr) void DestroyArray(T[] arr) void printfa(str* format, T[] args) void sprintfa(str* buf, str* format, T[] args) T Min(T arg1, T arg2, ...T rest) T Max(T arg1, T arg2, ...T rest) T Choose(T arg1, ...T rest)
This means that the type
T
must match other occurrences ofT
throughout the entire signature, given the types of the parameters used by the callsite. For example, this code no longer compiles:printfa("hello %d", 1) // Second param is not an array Object objects[] = {new Object()}; ArrayPushBack(objects, 1) // Second param is not an Object int v = ArrayPopBack(objects) // Cannot convert Object to int
Note: for now,
SizeOfArray
andResizeArray
still allowchar32
for their array parameters, since that is common for string operations and we don't have a formal string type yet. - add garbage collector for automatic memory management
d4bc547f8
Objects created by scripts are now automatically deleted when they are no longer reachable from any script.
This removes needing to manually delete objects you create (either with the
delete
operator orFree()
), and mostly removes any reason to ever callOwn()
.See the new "Object Memory Management" section in ZScript_Additions.txt for further details.
Bug Fixes
Player
- 'Spotlight' combos on changer/ethereal ffcs still shooting light
99d4786b9
- fix buggy color flickering on big player sprites
5a6bf306e
- hardcode 120 for zscript alpha register
d23a9bdd1
This fixes some quests that only look at the alpha version and, seeing it was now 0 presented an error message to the user.
Editor
- 'View Map' favorite command skipping menu
b9ea47f75
- Crash in ZInfo menu if descriptions are long
9546a257e
ZScript
- some array-related functions breaking for arrays >65535 in size
f6ad9203a
- class variables not shadowing global vars properly
46ed8bf58
- bad optimization causing global vars to sometimes read incorrectly
b000fc9e2
- some wrong error messages related to mapdata FFC access
bf68795d9
- websocket pool being destroyed on 'cont_game()'
ae375c530
- socket arrays sometimes going invalid?
12e3b9a92
Patched the issue here, not the cause. Not sure what caused it to sometimes go invalid, but a validity check seems sane.
- 'delete' within a destructor being buggy
0bb0da1de
- disallow casting custom objects to unrelated types
ed6faae63
A bug in type conversion allowed this code to compile:
Object obj = new Object(); int number = obj; int numbers[] = {obj};
The above code now produces a compiler error.
- derive language runtime version from compiled scripts
a772dd873
The script engine checks the version a script was compiled in to vary some behavior. Previously this version was set to the section version in the qst file format, but that is updated even if scripts were not re-compiled. Now we look directly at the script metadata to set this version. This avoids issues with saving a quest in a new version without a recompile.
Web
- packaged quests not loading correctly
49b71a2a1
Build
- use better library for json
a698632b7
Refactors
ZScript
- standardize script object management
be20f347b
This keeps script-created objects in the same map, gives all objects a unique id, and implements allocation and retrieval for any object type using the same methods. This reduces some duplicated code, and should help with implementation of a potential garbage collector feature.
Bitmap objects are a bit special, and still need to be refactored.
- document, clean up, and sanity check websocket stuff
ce2f07d9c
- document, clean up, and sanity check websocket stuff
764e539e0
- migrate user_bitmap to script object system
68329daf9
Incidently, this increases the maximum number of user bitmaps to 256.
Tests
- add playground_bitmap_credits.zplay
d6b398ad4
CI
- use macos-13 for newer clang
Relevant changes:
- ci: update to macos-13 in other places too
6bb570d37
- ci: update to macos-13 in other places too