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

Game screen not stretched with the window anymore #138

Open
jmfergeau opened this issue Oct 9, 2022 · 9 comments
Open

Game screen not stretched with the window anymore #138

jmfergeau opened this issue Oct 9, 2022 · 9 comments

Comments

@jmfergeau
Copy link
Contributor

jmfergeau commented Oct 9, 2022

I don't know what happened with xorg or my driver or whatever but, suddenly, after months of displaying it correctly, now it doesn't stretch the game's window as intended, making it practically unplayable on big screens.

Screenshot_20221009_135348

I tried fullscreen, scaling, even the -640 but nothing fixes it...

Thanks

@pocak100
Copy link
Contributor

It's the same for me.

I don't know if SDL or x.org or something else changed, but the problem is that now SDL 1.2 gives a 24-bit surface by default instead of 32 bits (with an unused alpha channel). According to a comment, currently the game can only upscale from the latter.
See sdl/djgraph.cpp line 212:

&& pVisSrc->pSurface->format->BytesPerPixel == 4//Current scaling blit implementation only supports 4BPP [dj2016-10] [TODO: Handle other format, OR if upgrading to libsdl2, just use libsdl's scale blit function]

A quick hack to get it to work is to explicitly ask SDL for a 32-bit surface.
E.g. change graph.cpp end of line 184 to

	if (NULL == (pVisMain = djgOpenVisual( bFullScreen?"fullscreen":NULL, iWidth, iHeight, 32)))

That does the trick for me, but may not be optimal. There's also a pull request for SDL 2.0 that sidesteps the issue.

@davidjoffe
Copy link
Owner

Hi, sorry (haven't had time to look closely at this as I'm extremely busy with real life work and others demands right now and unfortunately only have a few spare minutes a day unfortunately for Dave Gnukem game as it's free) but just want to comment, there have been some recent commits from other contributors to add Debian support (which is obviously very valuable and helpful) but I suspect there's a chance the changes (e.g. Makefile changes) may possibly break current builds ... we'll unfortunately just need to please test (if you can) and if there are conflicts or build breakages try solve them and deal with them as they come up, see my comments here, thanks so much:

#131

@davidjoffe
Copy link
Owner

It's 'likely' I'll soon be integrating Matteo Bini's implementation of updating Dave Gnukem to SDL2 and this may change slightly again - I don't know if it'll fix it also as it also has that addition of requesting 32-bit surface so perhaps - this should all be tested again after the SDL2 update

@davidjoffe
Copy link
Owner

@pocak100 Thanks for the quickfix!

@davidjoffe
Copy link
Owner

Hi all, please try the latest version (SDL2 support and which also includes that line) and report if this is still an issue or if it's solved? Thanks

@jmfergeau
Copy link
Contributor Author

Tested on my arch, worked like a charm to me. Thanks ^^

@davidjoffe
Copy link
Owner

davidjoffe commented Nov 30, 2022

Thanks so much! That really helps to know.
Let me know if you may be interested in having direct contributor access to Dave Gnukem repo?

I see your profile it says:
"I'm also a software translator french-english, an opensource lover and I develop videogames as a hobby."

It just happens I've been thinking lately of possibly implementing support for translated/localized versions of Dave Gnukem, and it just happens literally this morning I was thinking of some possible nice solutions to relatively easily add support to possibly create a French localized version of Dave Gnukem ... a French version would be very cool!

Let me know if you'd be interested in helping do translations? That would be really awesome, to have a French Dave Gnukem.

I've started working on the localization support in the game backend, and even grabbed some French text from Google Translate (yes I know, horrible bad translations, not valid for actual localization, it was just to test the code changes and work on the code side of things) to help test potential support in some screenshots the other day.

  • Bad Google Translate translations ahead - sample quick n dirty test screenshot I had made the other for testing backend code changes, yes there's bad Afrikaans in there, I was just looking at issues relating to diacritics that's why I did that:

2022-11-28 16_50_59-Dave Gnukem

This is just to give you the idea, but imagine the above but with good proper translations

I don't know French unfortunately so I can't even rate the translations but yes I know Google Translate is NOT suitable for "real things" if not at least signed off by real human translators to check and edit).

(My real-life work at TshwaneDJe relates to language stuff and to localization and translation so I have a pretty good idea of how to go about implementing the required code changes, but I can't do actual translations as that needs a "real translator". But I am aware of the pitfalls and difficulties of localization in general too - and how much work it is to do reasonably decent translations by a translator too. Ideally would be good to have quality translations.)

I know translation is non-trivial work though and I don't have a budget to pay translators, so at this point it would need to be voluntary open contribution.

Also if anyone is interested in helping with other languages please let me know?

The official "Issue" to discuss that is: #178

@davidjoffe
Copy link
Owner

davidjoffe commented Nov 30, 2022

(Technically: The current main game font doesn't support French diacritics, as it's an ancient non-Unicode raster font I did largely by hand centuries ago around the time Stone Age people were first creating ASCII, I had a look in Photoshop and concluded it would be "too painful" and not worth it to try adapt the current 8x8 font to add diacritics - BUT long story short, I found the quite nice looking open retro font that does seem to have the necessary diacritics for French - it's TTF and I was first thinking I could use my new TTF code (but that would add a new dependency, creating some maintenance work for porters & eg Debian package management so ideally I don't want to add new dependencies if I can avoid it), but then I thought I could also alternatively just pre-render into a raster font all the characters needed for French and other major Latin-alphabet-based languages and then posssibly with zero new dependencies but just some work on the coding backend for utf8 in the raster font rendering stuff and then to add support for loading translations and some UI code for selecting language we could do this, that is some fun 'weekend coding'.
But anyway yes I am keen to do those coding changes to support localization, but would need human translators to do actual translations!)

@jmfergeau
Copy link
Contributor Author

jmfergeau commented Dec 1, 2022

I've started working on the localization support in the game backend, and even grabbed some French text from Google Translate (yes I know, horrible bad translations, not valid for actual localization, it was just to test the code changes and work on the code side of things) to help test potential support in some screenshots the other day.

Sure! Would be a pleasure to help! I love the game and i love translating games i love when i can ^^
I've just cloned the localization branch. There's indeed some corrections to do! lol I'll start on that ^^

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

No branches or pull requests

3 participants