Oliveshark / breakhack

A casual coffee-break roguelike
https://store.steampowered.com/app/931040/BreakHack/
GNU General Public License v3.0
32 stars 5 forks source link

Unable to create texture from rendered text: Couldn't find glyph #64

Closed walkero-gr closed 2 years ago

walkero-gr commented 2 years ago

Describe the bug I am working on a BreakHack port for AmigaOS 4. Although that the game works pretty well, with a few problems here and there, I have an issue with some texts not shown, like showing the how_to_play_tooltip, like it is shown at the following screenshot.

BreakHack 4 0 3 _001_20220831

By investigating it seems that the error comes from the line 182 when an outlined font is requested. I altered the code to avoid using outline fonts and the texts appear just fine, except that they are really thick because white texts and white outline mix.

To Reproduce I am not sure how you can reproduce it since this operating system is commercial and runs only on specific PPC-based hardware.

Expected behavior The expected behaviour is to show those texts fine

Screenshots Other screens seem to work fine like:

BreakHack 4 0 3 _001_20220830

BreakHack 4 0 3 _002_20220830

Desktop (please complete the following information): Latest code from repo is used for the port SDL 2 v2.0.20 SDL2_ttf v2.20.1

Additional context My questions for now:

  1. Is the repo code the latest available that I need for the port?
  2. Is the game still in development and make sense for me to work on fixes? Would you accept PRs with those fixes?
  3. Do you have any info to share on how to tackle that issue?

And last, but not least, I bought this awesome game on steam, and I compared the .pack files for data and assets, with the ones that exist in this repo. Should there be any changes? The .pack files seem like plain zip files, right? Is there a reason why you choose to use physfs library and do not have those files extracted in the first place? I am asking because physfs is one more dependency for your code that could be avoided, but I might be wrong on that, since I haven't investigated the code completely, and I might miss something.

Thank you so much for your help.

walkero-gr commented 2 years ago

So, I investigated the issue more today and I came up with a simple solution that seems to work fine. What I did was to change the TTF_RenderText_Solid() with TTF_RenderText_Blended(). It seems the problem is on the returned values where TTF_RenderText_Blended() returns a high quality ARGB surface, but the TTF_RenderText_Solid() returns an 8-bit surface, and possibly that's the reason it fails.

I would like to ask you why you use TTF_RenderText_Solid() in first place? Would my solution be a valid one or there are issues you tried to fix?

Some screenshots: BreakHack 4 0 3 _001_20220831

BreakHack 4 0 3 _002_20220831

LiquidityC commented 2 years ago

Hello and thanks for a very extensive and explanatory report. Super cool that you are porting to Amiga. Makes me wish I had one.

As for your questions:

walkero-gr commented 2 years ago

@LiquidityC Thank you so much for your reply and for answering my questions. So far the game works pretty well on my system, but I have to fix a couple of issues in the fullscreen mode. It seems that the graphics are not scaled as they should. But more on that in future issue reports if needed.

When I finish it and if I am happy with the result, I will probably make a PR.

Thank you again.