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

Tuxs action updates regardless of whether Tux is being drawn. #2613

Merged
merged 3 commits into from
Aug 29, 2023

Conversation

tylerandari13
Copy link
Contributor

Ok hear me out...

Basically it fixes Tux.get_action() not giving the correct action when Tux isn't being drawn.

When Tux.get_visible() is false Tux's sprite isn't updated at all. This interferes with Tux.get_action() because it relies on the sprite updating. What I'm gonna do to fix this is make Tux's sprite update regardless of whether Tux is visible but only draw Tux if Tux.get_visible() is true.

Basically when `Tux.get_visible()` is false Tux's sprite isn't updated at all. This interferes with `Tux.get_action()` because it relies on the sprite updating. What I'm gonna do to fix this is make Tux's sprite update regardless but only draw Tux if `Tux.get_visible()` is true.
src/object/player.cpp Outdated Show resolved Hide resolved
src/object/player.cpp Outdated Show resolved Hide resolved
@tylerandari13 tylerandari13 marked this pull request as draft August 26, 2023 01:07
@tylerandari13
Copy link
Contributor Author

Drafting this for now because I just found a pretty big bug. Apparently if you abort a level in the editor it crashes with this segmentation fault:

[WARNING] /home/tylerandari12/STcompilation/supertux/src/supertux/world.cpp:62 Failed to load levels/community2016/info:Couldn't open file 'levels/community2016/info': not found

Error: signal 11:
/home/tylerandari12/STcompilation/supertux/build/supertux2(_ZN12ErrorHandler17print_stack_traceEv+0x32)[0x55a53f9407ac]
/home/tylerandari12/STcompilation/supertux/build/supertux2(_ZN12ErrorHandler12handle_errorEi+0x4c)[0x55a53f940774]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7ff36402b520]
/home/tylerandari12/STcompilation/supertux/build/supertux2(_ZN6Player4drawER14DrawingContext+0x72b)[0x55a53f5ec7d7]
/home/tylerandari12/STcompilation/supertux/build/supertux2(_ZN17GameObjectManager4drawER14DrawingContext+0x111)[0x55a53f6757c7]
/home/tylerandari12/STcompilation/supertux/build/supertux2(_ZN6Sector4drawER14DrawingContext+0xff)[0x55a53f72a559]
/home/tylerandari12/STcompilation/supertux/build/supertux2(_ZN6Editor4drawER10Compositor+0xff)[0x55a53f7d9745]
/home/tylerandari12/STcompilation/supertux/build/supertux2(_ZN13ScreenManager4drawER10CompositorRNS_9FPS_StatsE+0x89)[0x55a53f721f5d]
/home/tylerandari12/STcompilation/supertux/build/supertux2(_ZN13ScreenManager9loop_iterEv+0x425)[0x55a53f7233ab]
/home/tylerandari12/STcompilation/supertux/build/supertux2(_ZN13ScreenManager3runEv+0x2f)[0x55a53f723481]
/home/tylerandari12/STcompilation/supertux/build/supertux2(_ZN4Main11launch_gameERK20CommandLineArguments+0x12b9)[0x55a53f6a8569]
/home/tylerandari12/STcompilation/supertux/build/supertux2(_ZN4Main3runEiPPc+0x2ad)[0x55a53f6a8ce5]
/home/tylerandari12/STcompilation/supertux/build/supertux2(main+0x73)[0x55a53f58a5ac]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7ff364012d90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7ff364012e40]
/home/tylerandari12/STcompilation/supertux/build/supertux2(_start+0x25)[0x55a53f58a475]
Segmentation fault (core dumped)

If anyone knows whats wrong please let me know. I will continue playing around with this in the meantime.

@tylerandari13 tylerandari13 marked this pull request as ready for review August 26, 2023 01:38
@tylerandari13
Copy link
Contributor Author

lol nevermind i fixed it

@mrkubax10 mrkubax10 added category:code involves:scripting status:needs-review Work needs to be reviewed by other people type:bugfix Pull Requests that fix bugs. labels Aug 28, 2023
@mrkubax10 mrkubax10 merged commit 1bb3629 into SuperTux:master Aug 29, 2023
33 checks passed
@mrkubax10 mrkubax10 removed the status:needs-review Work needs to be reviewed by other people label Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants