-
Notifications
You must be signed in to change notification settings - Fork 46
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
Would adding dummy functions be worth it? #111
Comments
We've been doing this for a few functions if I remember well. |
I've made this snippet that can be used in the header of the
So far I haven't been successful running the games, but at least it helps seeing the functions that are missing for the game to run. I forced lutro-roguelike to go through this compatibility layer and it worked. So that means that this should work as long as the game uses compatible functions. I tried it with your love-vespa and it almost works. It showcases what I meant, the game runs while spewing errors wherever incompatibilities arise, without completely crashing. |
Made a few stub functions for common things, but there could be more. Which functions do you run into often? Some functions would work as warnings. Others, not so much.... window.setFullscreen could be ignored, while lutro.joystick.getJoysticks couldn't be. |
Well, I was thinking just making it generalized, instead of going one by one, any index accessed that is not known would display an error or warning in the terminal (even if you do
Wrapping in Lua cannot really cover unimplemented methods in userdata objects, though (e.g. the ones returned by But after writing this and seeing the games running with all this boilerplate I'm realizing that it's not worth it, while it runs and can be helpful as base for modifying the Löve code and porting the game, in Lutro current state this is not really gonna be able to make most Löve games playable without additional work that would have to be put on each individual game. |
I was trying to make several Löve games work in Lutro but I always stumble with problems.
I was thinking that maybe for Löve compatibility the missing functions could be filled with dummies that just reported the function as not supported but that would not cause an instant crash.
Something like the equivalent to this:
Maybe the games won't really work 100% as intended when doing this, but perhaps more games would at least be playable.
It'll also make it easier to see what functions need to be implemented/replaced for the game to run. Bonus points if the warning message could also show the file and line number of the call, or something like that.
What do you think? is it worth it?
The text was updated successfully, but these errors were encountered: