Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rez gets stuck compiling FONT #250

Open
briankendall opened this issue Jun 2, 2024 · 1 comment
Open

Rez gets stuck compiling FONT #250

briankendall opened this issue Jun 2, 2024 · 1 comment
Labels

Comments

@briankendall
Copy link
Contributor

I've attached a rez file containing the definition of a FONT resource, as decompiled by MPW's DeRez. If I try to compile it with Retro68's version of Rez and give it the correct header search paths so that it can find SysTypes.r from Apple Universal Interfaces 3.4, then it'll get stuck and run indefinitely.

(Luckily it's not hard to work around since if I don't include SysTypes.r when running DeRez it'll export the FONT as just binary data, which compiles fine.)

test.r.txt

@briankendall briankendall changed the title Rez get stuck compiling FONT Rez gets stuck compiling FONT Jun 2, 2024
@autc04
Copy link
Owner

autc04 commented Jun 2, 2024

Diagnosis: Rez miscalculates an array size and starts meditating about a gigabyte-sized FONT resource. Some unoptimized code that was never intended to deal with more than a few megabytes follows, so it seems stuck.

The reason for miscalculating it is that the array size is calculated from reading back parts of the already-written output, which the architecture I came up with for my Rez 10 years ago doesn't really support. At the very least, I'll have to rearrange some things in the code, so this will not be a quick fix.

Currently, Rez runs as in two passes; the first pass is supposed to lay things out and generate an intial version of the resource; the second pass then fills in things that depend on the first pass, such as $$CountOf, $$Word, $$Bitfield. This works nicely for the more common pattern where some integer in the resource is defined to be an array count or an offset, but it fails horribly for the FONT resource, where an array size is calculated in a non-trivial way.

That will have to be changed...

@autc04 autc04 added the bug label Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants