-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fonts Unchained: decoupling font classes #42520
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZhilkinSerg
added
[C++]
Changes (can be) made in C++. Previously named `Code`
Code: Infrastructure / Style / Static Analysis
Code internal infrastructure and style
SDL: Tiles / Sound
Tiles visual interface and sounds.
labels
Jul 28, 2020
barsoosayque
force-pushed
the
decouple-fonts
branch
from
August 17, 2020 16:15
dba2305
to
a003473
Compare
ZhilkinSerg
reviewed
Aug 17, 2020
ZhilkinSerg
reviewed
Aug 17, 2020
ZhilkinSerg
reviewed
Aug 17, 2020
ZhilkinSerg
reviewed
Aug 17, 2020
Co-authored-by: ZhilkinSerg <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[C++]
Changes (can be) made in C++. Previously named `Code`
Code: Infrastructure / Style / Static Analysis
Code internal infrastructure and style
SDL: Tiles / Sound
Tiles visual interface and sounds.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Infrastructure "Decouple Font classes and Font rendering in SDL related code"
Purpose of change
Continuation of work on fixing I-am-Erk/CDDA-Tilesets#133 (previous PR: #42227). I need this so I can pass fonts to
cata_tiles
and render some symbols there.And as always, making rendering code more independent.
Describe the solution
Mostly copy-paste from
sdltiles.cpp
intosdl_font.h
/sdl_font.cpp
. I haven't changed any logic in Font classes. Cleaned things up a little, used newGeometryRenderer
instead of old static functions.Describe alternatives you've considered
Possibly, merge
SDL_Renderer_Ptr&
andGeomentryRenderer_Ptr
together in some sort ofRenderer_Ptr
which is capable of rendering everything. But the PR is big enough already.Getting rid of statics
fontwidth
andfontheight
, but they are tricky and also out of scope for this PR.Testing
Loaded up the game, hud renders fine, inventory and crafting menu renders fine. Overmap also renders fine.
Changed font settings, restarted the game, tried everything again, no problems.
Run rendering benchmark: no performance decrease there either.
Additional context
Honestly, I expected it to be much more painful than it was. And I'm not 100% that my test have absolute coverage, but I can't think of other places to test.