wfc icon indicating copy to clipboard operation
wfc copied to clipboard

CLEANUP Label Never Reached

Open nsmryan opened this issue 2 years ago • 4 comments

The wfc__create_allowed_tiles function has a CLEANUP section that is not reachable. There is a return before this label, and no goto to jump to it. Is there are missing check that should jump to this label, such as on the return of malloc?

https://github.com/krychu/wfc/blob/38b08ab7a276ba0e4266c3b85ef7f32cc59d4bce/wfc.h#L899

nsmryan avatar Apr 26 '22 14:04 nsmryan

good catch yes 👍 I'll prep a PR. Thanks for reporting.

How's your game going? Are you using wfc with any success? :)

krychu avatar Nov 09 '22 16:11 krychu

I am using it with good success! I still plan to do more with this at some point but I am using this library to generate levels for my roguelike, and they are generally pretty good. I think the main thing is really just playing with the seed, while the wfc library itself does a great job.

I don't know if I mentioned this, but I also wrapped wfc as a TCL extension to play with seed interactively in TCL. https://github.com/nsmryan/tclwfc

nsmryan avatar Nov 10 '22 04:11 nsmryan

oh nice! great to hear it's useful.

Nice about TCL bindings, I can link to that in the docs when I update them next time.

I'm currently testing various custom rand() implementations. High chance one is going to end up in wfc. Generally this means another boost in performance, but also cross platform stability.

Quick question: do you use max_collapse_cnt in wfc_run? I think it might not be an useful argument.

krychu avatar Nov 12 '22 10:11 krychu

I have never tried using that option. I'm glad to hear about a speed boost- always welcome even though its been fast enough for me so far.

nsmryan avatar Nov 13 '22 18:11 nsmryan