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

Handle Screen resizing [$34] #933

Closed
InfernoZeus opened this issue May 10, 2013 · 5 comments
Closed

Handle Screen resizing [$34] #933

InfernoZeus opened this issue May 10, 2013 · 5 comments
Labels
<Enhancement / Feature> New features, or enhancements on existing Organization: Bounty Bounties for claim (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@InfernoZeus
Copy link
Contributor

Is this something that can't be done because of cross-OS compatibility, or is it something that's been rejected by design?

Otherwise I'm willing to spend some time trying to implement it.

There is a $34 open bounty on this issue. Add to the bounty at Bountysource.

@kevingranade
Copy link
Member

Neither, it's just that no one has successfully made it happen.
On May 10, 2013 12:35 PM, "InfernoZeus" notifications@github.com wrote:

Is this something that can't be done because of cross-OS compatibility, or
is it something that's been rejected by design?

Otherwise I'm willing to spend some time trying to implement it.


Reply to this email directly or view it on GitHubhttps://github.com/TheDarklingWolf/Cataclysm-DDA/issues/933
.

@kevingranade kevingranade changed the title Handle Screen resizing Handle Screen resizing [$20] Sep 23, 2014
@kevingranade kevingranade added the Organization: Bounty Bounties for claim label Sep 23, 2014
@kevingranade kevingranade changed the title Handle Screen resizing [$20] Handle Screen resizing [$34] Sep 25, 2014
@kevingranade kevingranade added the Organization: Bounty Bounties for claim label Sep 25, 2014
@SeanMirrsen
Copy link
Contributor

What does screen-resizing entail in this case, exactly? Just being able to change terminal dimensions without reload (which is a prerequisite anyway), or actually drag-resizing the window?

@namarrgon
Copy link
Contributor

Right now the game doesn't handle drag-resizing very gracefully:

The curses-build only makes use of the area of the terminal with which it was started. A recent(?) change seems to have made the viewport scale vertically but the sidebar does not stick to the right side of the screen (none of the UIs like inventory, map etc. resize either) so the gain in screen-real-estate is minor:
2014-10-06-120100_754x546_scrot
The SDL-build needs the "gamesize" set in the options menu and resizing the window during runtime will result in black bars in the new areas:
2014-10-06-120602_746x540_scrot
http://imgur.com/a/Xt6hM/all

These screenshots are from the Linux build and I have to assume that the OSX version behaves the same.
The "curses"-build on Windows also requires setting the window-size in the options-menu and won't permit drag-resizing by default. Forcefully resizing the window shows the same behavior as the SDL-build on linux: black bars in the new areas.

The "hardcoded" size in the options-menu is clunky at best. The way to change the size right now is:

  • save current state
  • open options-menu
  • set the new size
  • restart the game
  • load the previous state
  • (repeat until you found the right size)

This might be a rather unusual use-case or something that is infrequently used after the initial setup but would also help to unclutter the options-menu.

IMO the goal here should be to allow for dynamic changes to the window-size by "drag-resizing" for the curses as well as for the SDL versions.

@SeanMirrsen
Copy link
Contributor

Then we might as well toss font selection in there instead, and make the fontlist generator recognize bitmap ASCII tilepages. So that you can dynamically scale the terminal size to your window size, and choose the fonts you want to use in the options.

How does one enable drag-resizing in the Windows build? I'd like to try a hand at this, but I literally don't know how to start with that being first step. >_>

@namarrgon
Copy link
Contributor

We are talking about de/increasing the amount of visible "cells" by resizing the window, right? Or do you mean to just increase the font-size when the window-size grows while keeping the amount of "cells" constant?

The Windows WM is somewhat strict in enforcing the hints received from clients but there is a range of tools for Windows to override this. One of them is: https://code.google.com/p/altdrag/
The other Dirty Hack™ is to make SDL mark the window resizable (untested but should work):

diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp
index 35f6cfd..7186f4e 100644
--- a/src/sdltiles.cpp
+++ b/src/sdltiles.cpp
@@ -247,6 +247,8 @@ bool WinCreate()

     if (OPTIONS["FULLSCREEN"]) {
         window_flags |= SDL_WINDOW_FULLSCREEN;
+    } else {
+        window_flags |= SDL_WINDOW_RESIZABLE;
     }

     window = SDL_CreateWindow(version.c_str(),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Enhancement / Feature> New features, or enhancements on existing Organization: Bounty Bounties for claim (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

No branches or pull requests

4 participants