Opened 5 years ago
Last modified 15 months ago
#5555 new defect
[macOS] loading a mod causes rendering with wrong screen size
Reported by: | Friggigatto | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Backlog |
Component: | Core engine | Keywords: | |
Cc: | Krinkle | Patch: |
Description (last modified by )
When activating mods in 0 A.D. alpha 23 in OS X 10.11.6, graphic glitches appear. I've attached a screenshot.
The top part of the screen is repeated, and also the mouse position is off (the pointer is not visible in the screenshot, but it is hovering above the "learn to play" button).
My machine is a MacBook Pro mid-2012.
EDIT:
- similar issue described in #5938
reproducible
- this bug is reproducible from the current
git version
all the way toAlpha XX Timosthenes
[17965], after which I stopped testing further - the only thing that has changed over the years is the size of the "black" box at the top in
A23
, it was quite large as seen in the first picture of this description - with
A24
the size of the black box became smaller as seen in the 2nd picture in the description
Attachments (4)
Change History (15)
by , 5 years ago
Attachment: | graphic_glitches_0ad.jpg added |
---|
comment:1 by , 5 years ago
comment:2 by , 5 years ago
I've experienced something similar. Happens every time after pressing "Start mods", e.g. when enabling or disabling fgod (I have no other mods currently).
- macOS 10.14.6
- MacBook Pro 15" Retina
- Resolution 2880x1800 (2 dppx, as 1440x900)
- Graphics card: AMD Radeon R9 M370X 2 GB; and Intel Iris Pro 1536 MB. I have the macOS "Automatic graphics switching" setting disabled, which means it is (should be) using the AMD Radeon always.
On A23, and on trunk until "recently", what happened for me is that the top 150px (154px?) is red, and the actual game is pushed down (partly off-screen). The mouse iterations are all wrong at that point (based on where the pixels should be, not where they currently are).
Last week I did a full rebuild of my trunk install, and since then the bug changed. It's now getting stretched out. The game is 150px less tall, but then stretched back out. Again, the mouse is still "correct" that is, it is acting on where the pixels should be.
After this, I quit the game and restart, at which point everything is fine until the next time I toggle a mod.
by , 5 years ago
Attachment: | capture-a23-red.png added |
---|
by , 5 years ago
Attachment: | capture-r22798-stretch.jpg added |
---|
comment:3 by , 5 years ago
Cc: | added |
---|
comment:4 by , 5 years ago
Per elexis, I instrumented the before-last line of CVideoMode::SetVideoMode
as follows:
debug_printf("window size (xres, yres): %d %d\n", g_xres, g_yres); debug_printf("window position (winX, winY): %d %d\n", m_WindowedX, m_WindowedY);
Upon triggering the bug by pressing "Start mods", the automated relaunch that triggers the bug, logs the following:
… TIMER| InitVfs: 1.847 ms Writing the mainlog at …/0ad/logs/mainlog.html TIMER| CONFIG_Init: 4.879 ms Sound: AlcInit success, using Built-in Output window size (xres, yres): 1440 746 window position (winX, winY): 805240832 805240832 UserReport written to …/0ad/logs/userreport_hwdetect.txt TIMER| RunHardwareDetection: 3.836 ms …
Notice that the reported yres is 154px short of the actual height (900px).
comment:5 by , 5 years ago
In the report Stan attached to #5599, we can see that CVideoMode::m_CurrentW
and other members are not initialized.
Given that one has the code at hand and found a place where the according window size is off, it should be possible by reading the code and adding more printf to locate the call that produces the wrong result.
comment:6 by , 5 years ago
Description: | modified (diff) |
---|---|
Keywords: | mod glitches removed |
comment:7 by , 5 years ago
Summary: | loading a mod causes graphic glitches on OS X 10.11.6 → loading a mod causes rendering with wrong screen size on OS X 10.11.6 |
---|
comment:8 by , 15 months ago
Description: | modified (diff) |
---|---|
Summary: | loading a mod causes rendering with wrong screen size on OS X 10.11.6 → [macOS] loading a mod causes rendering with wrong screen size |
- a closely related ticket mentioned in the description (#5938)
comment:10 by , 15 months ago
The problem persists even after applying the patch from: comment:7:ticket:6649
-
source/ps/VideoMode.cpp
a b bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) 397 397 flags |= SDL_WINDOW_OPENGL; 398 398 else if (m_Backend == Renderer::Backend::Backend::VULKAN) 399 399 flags |= SDL_WINDOW_VULKAN; 400 m_WindowedX = m_WindowedY = SDL_WINDOWPOS_CENTERED_DISPLAY(m_ConfigDisplay); 400 if (fullscreen) 401 m_WindowedX = m_WindowedY = SDL_WINDOWPOS_UNDEFINED_DISPLAY(m_ConfigDisplay); 402 else 403 m_WindowedX = m_WindowedY = SDL_WINDOWPOS_CENTERED_DISPLAY(m_ConfigDisplay); 401 404 402 405 #if OS_MACOSX && SDL_VERSION_ATLEAST(2, 0, 6) 403 406 if (m_Backend == Renderer::Backend::Backend::VULKAN)
Debug
- setting a debug message like this:
-
source/ps/VideoMode.cpp
a b bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) 511 511 } 512 512 } 513 513 514 LOGWARNING("before SDL_GetWindowSize Width:%d Height:%d", m_CurrentW, m_CurrentH); 514 515 // Grab the current video settings 515 516 SDL_GetWindowSize(m_Window, &m_CurrentW, &m_CurrentH); 516 517 m_CurrentBPP = bpp; 518 LOGWARNING("after SDL_GetWindowSize Width:%d Height:%d", m_CurrentW, m_CurrentH); 517 519 518 520 if (fullscreen) 519 521 SDL_SetWindowGrab(m_Window, SDL_TRUE);
-
- after triggering the issue, this was the outcome
# notice the height changed WARNING: before SDL_GetWindowSize Width:1680 Height:1050 WARNING: after SDL_GetWindowSize Width:1680 Height:1028
- making the following change:
-
source/ps/VideoMode.cpp
a b bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) 512 512 } 513 513 514 514 // Grab the current video settings 515 SDL_G etWindowSize(m_Window, &m_CurrentW, &m_CurrentH);515 SDL_GL_GetDrawableSize(m_Window, &m_CurrentW, &m_CurrentH); 516 516 m_CurrentBPP = bpp; 517 517 518 518 if (fullscreen)
-
- the problem becomes "less bad" for
Vulkan
, the window gets cut off from the bottom and the cursor works correctly when hovering over an element, forOpenGL
it remains the same as described in the ticket
by , 15 months ago
Attachment: | bottom.png added |
---|
Which mods? It sounds like it might be an issue with the mod.