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

cl_text_entities (show/hide text in entities) for performance #340

Merged
merged 1 commit into from Nov 7, 2015

Conversation

Projects
None yet
6 participants
@rbmz
Contributor

rbmz commented Sep 28, 2015

Signed-off-by: rbmz rbmz@users.noreply.github.com

cl_text_entities (show/hide text in entities) for performance
Signed-off-by: rbmz <rbmz@users.noreply.github.com>
@heinrich5991

This comment has been minimized.

Contributor

heinrich5991 commented Oct 2, 2015

See https://github.com/ddnet/ddnet/pull/340/files?w=1 for an easier-to-read diff.

Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1);
}
void CRenderTools::RenderSwitchOverlay(CSwitchTile *pSwitch, int w, int h, float Scale, float Alpha)
{
if(g_Config.m_ClTextEntities == 0)

This comment has been minimized.

@heinrich5991

heinrich5991 Oct 2, 2015

Contributor

This and below should probably !g_Config.m_ClTextEntities. Otherwise, the code looks fine to me. What's your use case for this? Does the text rendering slow down the client?

@cinaera

This comment has been minimized.

Contributor

cinaera commented Oct 2, 2015

Looks fine as a temporal workaround.
Changes to the text render would improve the performance overall (batching the draw calls)

@Chairn

This comment has been minimized.

Contributor

Chairn commented Oct 2, 2015

gfx_text_overlay does the same no?

@rbmz

This comment has been minimized.

Contributor

rbmz commented Oct 2, 2015

@heinrich5991: yes

@Chairn:
I did not know about gfx_text_overlay.
Seems to be used as a parameter to decide whether to hide text when zooming out:

  if(EndX - StartX > g_Config.m_GfxScreenWidth / g_Config.m_GfxTextOverlay || EndY - StartY > g_Config.m_GfxScreenHeight / g_Config.m_GfxTextOverlay)
    return; // its useless to render text at this distance

it does hide text in teleporters, it also completely hides speedups (instead of just the speedup numbers)

@H-M-H

This comment has been minimized.

Member

H-M-H commented Oct 21, 2015

I tested this locally and everything looks fine so far
@rbmz please be so kind and change g_Config.m_ClTextEntities == 0 to !g_Config.m_ClTextEntities as heinrich5991 suggested, then I will likely merge :)

@timakro

This comment has been minimized.

Member

timakro commented Nov 7, 2015

Since HMH and heinrich looked at it I just merged it and
changed g_Config.m_ClTextEntities == 0 to !g_Config.m_ClTextEntities in 201782d.

timakro pushed a commit that referenced this pull request Nov 7, 2015

Tim Schumacher
Merge pull request #340 from rbmz/master
cl_text_entities (show/hide text in entities) for performance

@timakro timakro merged commit cbffcd4 into ddnet:master Nov 7, 2015

1 check passed

ci/circleci Your tests passed on CircleCI!
Details
@heinrich5991

This comment has been minimized.

Contributor

heinrich5991 commented Nov 7, 2015

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment