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

Re-writing ImTui (ImGui curses backend) #73164

Merged
merged 2 commits into from
May 4, 2024

Conversation

katemonster33
Copy link
Contributor

@katemonster33 katemonster33 commented Apr 21, 2024

Summary

Infrastructure "refactored ImTuis drawing code to fix a black screen issue, and to improve performance"

Purpose of change

Fixes: #73031
Fixes: #73392

Describe the solution

ImTui was using a single ncurses window to draw all its data. this window encompasses the whole screen, which meant that no matter what, when that window was refreshed the first time, the screen would be blacked out.

The new and improved ImTui uses several windows based on the windows ImGui is attempting to draw. This means that ImTui can't overwrite cells on the terminal outside of where a window is meant to be drawn.

Describe alternatives you've considered

Testing

load the game, verify you are not greeted with a black screen.

also verify that any spaces where an ImTui window was drawn are overwritten, as expected, when it is closed. this part got rolled into #73426

Additional context

During my testing I was working a lot with WSL, and found this weird case where, if you build CDDA from a fresh copy with no localization, every time you start the game you get the same black screen bug and you have to press a key to show the language selection. I couldn't reproduce it in Linux so I wrote it off as unrelated.-

@github-actions github-actions bot added <Bugfix> This is a fix for a bug (or closes open issue) Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Info / User Interface Game - player communication, menus, etc. [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Apr 21, 2024
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 23, 2024
@katemonster33 katemonster33 marked this pull request as ready for review April 24, 2024 21:01
src/cata_imgui.cpp Outdated Show resolved Hide resolved
src/crash.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Apr 24, 2024
@katemonster33 katemonster33 marked this pull request as draft April 25, 2024 02:47
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 25, 2024
@katemonster33 katemonster33 marked this pull request as ready for review April 25, 2024 16:42
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Apr 25, 2024
@katemonster33 katemonster33 force-pushed the imgui_curses_issues branch 2 times, most recently from e5fca20 to 48e9351 Compare May 1, 2024 03:02
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 1, 2024
@katemonster33
Copy link
Contributor Author

i devised a way i can optimize this so I don't need the TWindow struct and all the calculations needed to get the window bounds. I am going to mark as draft so I can try to implement it

@katemonster33 katemonster33 marked this pull request as draft May 3, 2024 03:19
@github-actions github-actions bot added the ImGui Anything related to the new ImGui UI for SDL/tiles or ImTui for curses builds label May 3, 2024
@katemonster33 katemonster33 force-pushed the imgui_curses_issues branch from 0a6a5eb to f499bda Compare May 3, 2024 16:58
@katemonster33 katemonster33 marked this pull request as ready for review May 3, 2024 16:58
@Maleclypse Maleclypse merged commit 33769a4 into CleverRaven:master May 4, 2024
27 of 37 checks passed
SurFlurer added a commit to SurFlurer/Cataclysm-DDA that referenced this pull request Aug 26, 2024
…_curses_issues"

This reverts commit 33769a4, reversing
changes made to fe47393.
this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style ImGui Anything related to the new ImGui UI for SDL/tiles or ImTui for curses builds Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Top part of keybindings menu isn't shown on first open Blank window when launching curses
2 participants