GeezerVison is showing github.com — Make the editor window resizable and fill it with the (wrapping) map by FlexApex · Pull Request #51 · Return-To-The-Roots/s25edit
Conversation
FlexApex
commented
Jun 27, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Selecting resolutions from the options listbox requires a lot of clicking and many modern resolutions are missing.
A much more userfriendly solution is to allow user to resize the s25edit window, like any other application.
This PR implements exactly that and was tested successfully on Linux with various resolutions, including a 5k widescreen display. It was written with Opus 4.8.
-
Create the window with SDL_WINDOW_RESIZABLE and a 640x480 minimum size, and follow SDL_WINDOWEVENT_SIZE_CHANGED by recreating the display surface/texture at the new size (ResizeDisplay), so the working area grows with the window.
-
Rework the terrain renderer so the wrapping world tiles across the whole viewport instead of leaving a black void when the window is larger than the map. DrawTriangle now draws one map-tile copy at a given offset; the new drawTriangleTiled replicates each triangle at every visible map-period offset. This replaces the old single-wrap logic (GetAdjustedPoints and the k-pass edge handling), which assumed the viewport was never larger than the map.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The map editor window could only be created at a fixed size (or fullscreen).
Allow it to be resized and maximized like the game client:
- Create the window with SDL_WINDOW_RESIZABLE and a 640x480 minimum size, and
follow SDL_WINDOWEVENT_SIZE_CHANGED by recreating the display surface/texture
at the new size (ResizeDisplay), so the working area grows with the window.
- Rework the terrain renderer so the wrapping world tiles across the whole
viewport instead of leaving a black void when the window is larger than the
map. DrawTriangle now draws one map-tile copy at a given offset; the new
drawTriangleTiled replicates each triangle at every visible map-period offset.
This replaces the old single-wrap logic (GetAdjustedPoints and the k-pass
edge handling), which assumed the viewport was never larger than the map.
|
Hello new contributor! Are you on discord? https://discord.gg/k8h6YZwA6
Window resizing was already merged in #46.
Also resolution is now saved across restarts in #44.
I've noticed the black area for small maps & big screens #37 (comment) but not submitted PR, I have some OpenGL branches where I wanted to fix it but reviews and approvals the take time.
Can be worth getting fixed still!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.