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

wip fix float_label too fast in some cases #4429

Open
wants to merge 1 commit into
base: master
from

Conversation

@gfgtdf
Copy link
Contributor

commented Oct 5, 2019

fixes #4347

the fix kinda works but for some reason it created errors, when undrawing out-of-map parts. Also i feel dirty after touching the drawing code.

now its livetime is no longer measured in frames
in particular its lifetime is not indepndent of the
current frames per second
@@ -598,7 +598,7 @@ class display : public video2::draw_layering
bool discard_previous;

announce_options()
: lifetime(100)
: lifetime(1600)
, discard_previous(false)

This comment has been minimized.

Copy link
@stevecotton

stevecotton Oct 6, 2019

Contributor

Please update the comment "Lifetime measured in frames" on line 590

int xpos(std::size_t width) const;
SDL_Point get_loc(int time);
surface get_surface(int time);
bool is_expired(bool time);

This comment has been minimized.

Copy link
@stevecotton

stevecotton Oct 6, 2019

Contributor

is_expired is unused

sdl_copy_portion(screen,&rect,buf_,nullptr);
sdl_blit(surf_,nullptr,screen,&rect);
sdl_copy_portion(screen, &buf_pos_, buf_, nullptr);
sdl_blit(get_surface(time), nullptr, screen, &buf_pos_);

This comment has been minimized.

Copy link
@stevecotton

stevecotton Oct 6, 2019

Contributor

Inconsistent checking for surf_ != nullptr - it's not checked here, but inside get_surface there's a check which will make that function return nullptr.

@gfgtdf

This comment has been minimized.

Copy link
Contributor Author

commented Oct 6, 2019

these requests are true, but i probalby won't implement them until i found the casue of the actual error, which is that it kinda still looks worse than before. I was kinda hoping that someone woudl have an idea on that one.

@stevecotton

This comment has been minimized.

Copy link
Contributor

commented Oct 6, 2019

If you're going to be doing a lot more on this, would it be a sensible refactor to drop the whole "undraw" logic first?

IIUC the undrawing is an optimisation from the time that few things were moving on screen - now that Wesnoth has lots of animated terrain and units doing idle animation, it might make more sense to just redraw the whole screen each frame. All of those can be turned off in the display settings, but so can the floating text.

@gfgtdf

This comment has been minimized.

Copy link
Contributor Author

commented Oct 6, 2019

If you're going to be doing a lot more on this

i really hope i don't.

it might make more sense to just redraw the whole screen each frame

yes i really don't intend to do such huge changes right now, there is a reason why people are working on godot port rn, and the main reason for that is afaik noone really likes our current drawing engine anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.