-
Notifications
You must be signed in to change notification settings - Fork 443
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
H3INTRO: Use INTRORIM and preserve aspect ratio #3041
base: develop
Are you sure you want to change the base?
Conversation
ec524ee
to
8f07ca1
Compare
Will it work for resolutions that are not 3x4, e.g HD/FullHD? |
Not yet |
3f39fb2
to
d286e0c
Compare
Now all intro videos always have the correct aspect ratio. |
d286e0c
to
afa0011
Compare
Done |
Tested, looks good with keeping aspect ratio and rim. :) |
I tested it some more and noticed that it breaks when one changes the window size by dragging it to the left or right or top, not when one manually changes the window size. Also, I can already reproduce a similar issue with the latest develop build (439ce11). It seems like SDL doesn't get a usual resize event when one maximizes the window or sets it to half of the screen via the window manager. This is all the same VCMI instance after resizing it by dragging it to the screen edges: Maybe this issue combined with my code to use the actual window size instead of the resolution selected in the launcher results in the completely broken videos. |
5d7a3a3
to
55946a9
Compare
When I keep resizing the window using latest develop (1192dbf) I get the following:
I started VCMi in windowed mode, reduced the window's height, dragged it to the top of the screen to maximize it, dragged it back and further reduced the window height. I repeated this a few times. So it seems for the given intro video height of 600 px, a texture with a huge width is created that matches the ratio of the window. When it crashes the ratio is even higher than this: |
a8e768c
to
bb093fa
Compare
I'll still need to add interface scaling for the intros. |
2e097f8
to
9d29dc0
Compare
9d29dc0
to
3a602bd
Compare
Tested it with various resolutions, aspect ratios and interface scaling factors and it seems to work as expected. Before merging, I'd remove the debug output, but keep it for now in case the MR still has to be adapted. |
9f9494a
to
3fb819d
Compare
Extract methods Pass pointer to pointer to introRimTexture to fix the following warning: warning: parameter ‘introRimTexture’ set but not used [-Wunused-but-set-parameter] Cf. https://stackoverflow.com/a/30887279/2278742
6e25792
to
32b1967
Compare
Also fix glitches while resizing by using SDL_RenderClear()
introRim.mp4