Skip to content

Fix: the banner render position not clamped to screen bounds#2258

Open
Chang-zhi wants to merge 6 commits into
Phobos-developers:developfrom
Chang-zhi:develop
Open

Fix: the banner render position not clamped to screen bounds#2258
Chang-zhi wants to merge 6 commits into
Phobos-developers:developfrom
Chang-zhi:develop

Conversation

@Chang-zhi

Copy link
Copy Markdown
  • Clamp PCX/SHP/CSF banner render position to the visible area after centering, preventing off-screen drawing
  • Prevent a potential crash when a PCX banner exceeds the top screen edge
  • Add corresponding documentation and credits

- Clamp PCX/SHP/CSF banner position to visible area after centering
- Prevent potential crash when PCX banner exceeds the top screen edge
- Add corresponding documentation and credits
@Chang-zhi

Copy link
Copy Markdown
Author

This is a before-and-after comparison.
BANNERPR

@DeathFishAtEase DeathFishAtEase requested review from Fly-Star-him and removed request for Fly-Star-him June 17, 2026 15:14
@DeathFishAtEase

Copy link
Copy Markdown
Collaborator

This is some opinions from ststl-s, one of the original authors of the feature:

I think it's fine. You could consider adding a global feature, a tag that defaults to true, to control whether the Banner is always displayed within the ViewBounds or still partly outside, but it's probably not necessary. Map authors can just change the assets themselves.

我认为是没什么问题的,可以考虑加一个全局功能,默认为true的标签,控制是否让Banner固定显示在ViewBounds内,还是仍然一部分在外面,不过应该没什么必要,地图作者自己改素材罢(

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@Chang-zhi

Copy link
Copy Markdown
Author

This is some opinions from ststl-s, one of the original authors of the feature:

I think it's fine. You could consider adding a global feature, a tag that defaults to true, to control whether the Banner is always displayed within the ViewBounds or still partly outside, but it's probably not necessary. Map authors can just change the assets themselves.

我认为是没什么问题的,可以考虑加一个全局功能,默认为true的标签,控制是否让Banner固定显示在ViewBounds内,还是仍然一部分在外面,不过应该没什么必要,地图作者自己改素材罢(

I see your point, and I'm a bit worried. If a mapmaker turns the tag off, the crash would still happen when a PCX banner goes above the screen. I'm not sure that's acceptable. Unfortunately, I'm not familiar enough with reverse engineering to add a new hook that modifies the game's PCX rendering logic.

@DeathFishAtEase

Copy link
Copy Markdown
Collaborator

I see your point, and I'm a bit worried. If a mapmaker turns the tag off, the crash would still happen when a PCX banner goes above the screen. I'm not sure that's acceptable. Unfortunately, I'm not familiar enough with reverse engineering to add a new hook that modifies the game's PCX rendering logic.

From ststl-s:

Mainly, if someone tries to make a large image keep moving toward the screen center, forcibly restricting it would require the author to crop a lot of assets.
It depends on whether this crash is acceptable to users and reviewers; for example, it might be possible to clearly state in the documentation that specific situations will cause a crash,
so that modders can avoid it by reading the documentation.

主要是如果有人试图做一个很大的图像一直向屏幕内移动的话如果强行限制了的话作者就需要剪非常多的素材
需要看崩溃是否能接受的,例如说明书里写特定情况会崩溃
这种不这样做就不会崩溃的或许可以

@DeathFishAtEase DeathFishAtEase added ❓Phobos bug Something isn't working properly Tested ⚙️T1 T1 maintainer review is sufficient labels Jun 18, 2026
@DeathFishAtEase DeathFishAtEase requested a review from MortonPL June 18, 2026 14:30
- Add ClampToScreen boolean (defaults to true) to control whether
  PCX/SHP/CSF banners are clamped to the visible area
- Update documentation, credits, and changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❓Phobos bug Something isn't working properly ⚙️T1 T1 maintainer review is sufficient Tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants