Page 1 of 1

Strange cropped image in the Android version

Posted: 10 Mar 2020, 23:17
by vmarcelo
I installed the android version of Onscripter-Ru, everything worked fine except the image of the game itself

https://imgur.com/a/UfhPMKd

I tried changing the resolution of the game but nothing happens

Can anyone help me?

Re: Strange cropped image in the Android version

Posted: 10 Mar 2020, 23:22
by vit9696
I could suggest trying to add render-self=no to ons.cfg, but most likely it is some issue with your phone/drivers.

Re: Strange cropped image in the Android version

Posted: 10 Mar 2020, 23:45
by vmarcelo
I tried to do that, but nothing happened either, i searched a lot before posting here

Re: Strange cropped image in the Android version

Posted: 10 Mar 2020, 23:49
by vmarcelo
I forgot to say but, my phone is a Motorola One Vision

Re: Strange cropped image in the Android version

Posted: 24 Nov 2020, 12:21
by Khlover
I am also experiencing this issue on a Sony Xperia 1, it's somewhat playable but it's like the screen believes it's the right size.

I can see this as when navigating the menu I have to tap an inch or two to the left of the item I want to select.

Changing resolutions does not appear to resolve the issue, nor does the suggested ons tweak.

Any help would be greatly apreciated.

Re: Strange cropped image in the Android version

Posted: 26 Nov 2020, 01:46
by GeniuneWinrar
i have the same problem on windows. everything is on 1080p just like my monitor. but on windowed mode the screen is too big so everything is cropped

Re: Strange cropped image in the Android version

Posted: 04 Mar 2021, 10:43
by ndgnuh
I'm having the same problem on RedmiNote9 Pro. Have anyone found out how to workaround this? :(

Re: Strange cropped image in the Android version

Posted: 05 Mar 2021, 04:15
by ndgnuh
GUYS I DID A THING!

Apk + patched source here: https://github.com/ndgnuh/onscripter-ru ... longscreen

Edit: I forgot to mention that you have to put the game in fullscreen mode. Here is my ons.cfg just in case

Code: Select all

fullscreen
prefer-renderer=GLES3
force-fps=30
window-width=2560
game-script=wh.file
render-self=no
scale
If you find tapping your phone have no effect on the buttons, it is because the button is somehow miss-placed. In that case, pull down the statusbar real hard so that the navigation bar and the status bar popup, after that everything should be normal again (maybe?).

I was blind patching so I don't guarantee that this will work on your phone. But as long as the chance is not zero... >:)

Image

Re: Strange cropped image in the Android version

Posted: 09 Mar 2021, 22:58
by vit9696
Congratulations! It is a useful find, though now I believe the workaround is much simpler.

UPD: Most of the discussion is ongoing in https://github.com/ndgnuh/onscripter-ru ... n...master.
[+] Spoiler
The only relevant change seems to be an ons.cfg change, not the engine change. Let me explain why. Here is the changeset you made:
https://github.com/ndgnuh/onscripter-ru ... n...master

1. dw > 0 will essentially be always false on Android, as it equals preferred_width, which can only be 0, as it is set exclusively via ONScripter::setPreferredWidth function, and this function cannot be called on anything but desktop platforms. See the preprocessor guide in Loader.cpp. Therefore the change does nothing to the game behaviour.
2. rw and rh also are essentially script_width and script_height values passed to the WindowController::applyDimensions function, so replacing rw with script_width and rh with script_height does not change the code behaviour. All the values remain the same.
3. Returning true instead of false from WindowController::updateDisplayData also makes no difference for Android as this path is not taken. In the ons.cfg you have scale option, which is equivalent to scaled_flag in the code. As a result displayData.fullscreenDisplay is always set to a valid screen inside the for (int d = 0; d < displays; d++) loop, and then the function enters the if (displayData.fullscreenDisplay) condition and always returns with true.

All this combined no code change happened after you modded the engine. The only actual change that helped you is the addition of fullscreen option, which forces SDL in fullscreen in mode. I believe this is where the bug was. Please try to just add this option with the unmodded engine and confirm that it works. Afterwards, please take down the repo not to confuse people.