Page MenuHomeWildfire Games

Scale cursor according to gui.scale value
ClosedPublic

Authored by Dariost on Apr 12 2017, 11:19 AM.

Details

Reviewers
domdomegg
elexis
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP19667: Scale the cursor according to the GUI scale (HiDPI support).
Trac Tickets
#3875
Summary

When changing gui.scale to scale the whole gui the size of the cursor is not affected, so in HiDPI screens it remains very small

Test Plan

Starting the game the cursor is scaled correctly

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Dariost created this revision.Apr 12 2017, 11:19 AM
Dariost added a reviewer: Restricted Owners Package.Apr 12 2017, 11:22 AM
domdomegg accepted this revision.Apr 13 2017, 1:06 AM
domdomegg added a subscriber: domdomegg.

Manually tested, fixes bug and makes playing experience much better. Automated tests pass.

May be worth updating the copyright to 2017 on all files updated as per the 0ad coding conventions.

This revision is now accepted and ready to land.Apr 13 2017, 1:06 AM
Dariost updated this revision to Diff 1224.EditedApr 13 2017, 1:22 AM

Updated copyright year on all changed files as suggested by @domdomegg

domdomegg accepted this revision.Apr 13 2017, 1:44 AM

Lastest commit is trivial; just updating copyright notices

mimo added a subscriber: mimo.Apr 13 2017, 9:44 AM

domdomegg, did you only test the patch or also check the code? the latter is needed before accepting a revision.

Did check code, I'm fact because track was down I tried to fix this myself and pretty much did the exact same thing before I found this.

mimo added a comment.Apr 13 2017, 11:11 AM

Thanks (that was not clear from your previous comment), it will ease following reviews.

domdomegg awarded a token.
elexis accepted this revision.May 27 2017, 11:16 AM
elexis added a subscriber: elexis.

Patch correct since it scales the cursor correctly.
Patch complete because all cursor draw calls are treated.
Thanks!

source/lib/res/graphics/cursor.cpp
75 ↗(On Diff #1224)

Was wondering whether we can avoid the copy and the if, but not really. Front falls off when multiplying in the first SDL_CreateRGBSurfaceFrom call and skipping the if.

Note to self: Don't read SDL tutorials from 2008.

80 ↗(On Diff #1224)
246 ↗(On Diff #1224)

else if ( while at it

249 ↗(On Diff #1224)

Since the adjacent cases don't have scopes, that one here can go too

source/lib/res/graphics/cursor.h
42 ↗(On Diff #1224)

drawing size

This revision was automatically updated to reflect the committed changes.