Skip to content

Emscripten support #52

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Emscripten support #52

wants to merge 5 commits into from

Conversation

dxdxdt
Copy link

@dxdxdt dxdxdt commented Aug 14, 2024

Sharing my experimental Emscripten target support. Try it out:

https://snart.me/demos/emscripten/ft2-clone/

vær så god!

dxdxdt added 3 commits August 14, 2024 06:19
- Fix stuttering in background: use emscripten_sleep() only to yield
@8bitbubsy
Copy link
Owner

I mean, cool and all, but the mouse pointer has coordinate mapping issues for me on your web test link. It makes it quite unusable so far...

@dxdxdt
Copy link
Author

dxdxdt commented Aug 14, 2024

@8bitbubsy well, that's not the only problem(as per the notes). The mapping issue must be both from the scaling factor and canvas event translation. I know I'm still taking baby steps. Just wanted to get your attention and see if the Emscripten support is something you'd be interested. I don't mind maintaining a separate fork. Close the PR if you think it's not worth it. Leave it open if it looks promising.

Well, I've never used the original FT myself, but I quite don't understand why ft2-clone is so reliant on mouse when the original is from the 90's. Just a thought, not trying to troll or anything.

@8bitbubsy
Copy link
Owner

8bitbubsy commented Aug 14, 2024

As long as it's a nice and simple patch that doesn't change the behavior of the FT2 clone on other platforms, I'll merge it eventually if you manage to iron out the bugs. :)

The FT2 clone is reliant on the mouse just like original FT2, simply because it tries to be a copy of FT2. If you want less mouse-driven trackers, there are probably some alternatives out there.

@TheArcaneBrony
Copy link

I wonder if this is the same bug that causes the mouse to stop working when changing the scale factor under Linux (NixOS, sway)

@dxdxdt
Copy link
Author

dxdxdt commented Feb 5, 2025

Recommend me a good track to include in the demo. The one I picked kinda sucks. No disrespect for the author, though.

It will require some code change, mostly #ifdef macros. As for the recursive deletion, I think I found the better solution that requires minimum change.

I suspect the fix could be something as simple as ignoring the scaling factor depending on the platform. The whole scaling factor thing is not really necessary for web. The factor is probably being applied twice.

I don't know about Sway.

@dxdxdt
Copy link
Author

dxdxdt commented Feb 6, 2025

Spent couple hours to troubleshoot. Turns out, it wasn't the scaling factor. See dxdxdt@4b635a7.

DO NOT merge. I still don't like how deleteDirRecursive() turned out. I think I can do better than that. The program freezes up in fullscreen mode. Need to figure out why...

https://snart.me/demos/emscripten/ft2-clone/

Made a launcher so that you can load any mod off the url like so: https://snart.me/demos/emscripten/ft2-clone/ft2-clone.html?ft2c_load_url=https%3A%2F%2Fapi.modarchive.org%2Fdownloads.php%3Fmoduleid%3D37685%23blue_val.s3m&ft2c_load_filename=blue_val.s3m

Remember to flush the cache! (open the dev tool before opening the link/clicking on the button(because Ctrl + Shift + R is captured by the module), check Disable cache in the Network tab, refresh)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants