Conversation
- Leverage Westwood's native TacticalClass::ZoomInFactor pipeline with smooth interpolation - Add ZoomManager for bidirectional ScreenToTactical and TacticalToScreen coordinate transformations - Hook mouse message dispatching to accurately translate click selection, rubberband dragging, hover, and building placement preview coordinates - Add Ctrl+MouseWheel zooming and middle-click zoom reset - Register configurable Zoom In, Zoom Out, and Reset Zoom commands - Add INI options under [Phobos] in ra2md.ini
… zoom hotkey/wheel INI options - Fix mouse desynchronization: eliminate Windows LPARAM mutations in ScrollClass::Message_Handler that corrupted WWMouseClass coordinates, keeping OS and game cursors 100% in sync - Centralize coordinate mapping by hooking DisplayClass::ProcessClickCoords (0x692300) and DisplayClass::UpdateDragBand (0x4AC380) - Add TacticalZoom.Wheel and TacticalZoom.Hotkeys configuration options in ra2md.ini and rulesmd.ini - Make Zoom In, Zoom Out, and Reset Zoom commands dynamically registered for the Hotkeys menu under Interface
… native mouse handling - Decouple ZoomManager from Westwood's global ZoomInFactor so PrimarySurface update stays 1:1 - Render tactical layers to Alternate and composite into ViewBounds, keeping UI regions crisp - Maintain native cursor coordinates and use stack translation for tactical click targeting - Align code with Phobos formatting guidelines and clean comments
|
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. |
| - `TacticalZoom.Wheel` enables mouse wheel zooming (`Ctrl + Wheel`). | ||
| - `TacticalZoom.Hotkeys` enables keyboard commands. | ||
| - `TacticalZoom.Max` sets the maximum zoom magnification. | ||
| - `TacticalZoom.Step` sets the zoom increment per step. |
There was a problem hiding this comment.
should explain how these values reflect to actual operation ingame
There was a problem hiding this comment.
Like this? I updated the first message
TacticalZoom.Scrollenables mouse wheel zooming (Ctrl + Wheel) and middle click zoom reset.TacticalZoom.KeyEnabledenables keyboard commands.TacticalZoom.Maxsets the maximum zoom magnification (e.g.2.5allows zooming in up to 2.5x).TacticalZoom.Stepsets the zoom increment per wheel notch or hotkey press.TacticalZoom.Smoothtoggles smooth frame-by-frame interpolation between zoom levels.
… blank lines, and expand documentation
…ture/zoom-in-support
|
so far 2 problems in testing: also, is it possible to make it support zoom out as well? |
- Ensure crop center parity in GetBlitRects to eliminate sub-pixel oscillation during zoom interpolation - Avoid resetting camera position every frame, only re-clamping when map boundaries are violated - Hook DisplayClass::Mouse_Left_Press (0x4AC310) to synchronize rubberband start coordinates - Bind ScreenToTactical and TacticalToScreen to DSurface::ViewBounds dimensions
Unfortunately, one thing is the zoom-in (easy, is a simple crop of the visible area, native) and another thing is supporting a true zoom-out is not feasible with the current implementation because the map should be rendered much bigger and then downscale. You can try starting the game with a wider resolution and then zoom-in to your desired one, so not all computers should support that, I think. Can you try if those 2 bugs are fixed? |
|
Coronia, By the way, how works in newer c&c games this bug#2 ? Maybe making area selection and zoom mutually exclusive? |
|
I have tested the 11 hours ago build, with the selection box bug. Also, maybe there could be default zoom value initially set between original and completely zoomed. To have "zoom out" ability from start. Another suggestion to have mouse scroll only without "ctrl", but I don't know if it's possible to control mouse over sidebar vs mouse over render box. |
What kind of change is this?
Skip Changelog).Skip Changelog,Skip Docs).Skip Docs).Skip Changelog,Skip Docs,Skip Credits).Description
Tactical zoom
Ctrl + Wheel) and configurable keyboard hotkeys.TacticalZoomenables or disables tactical zoom.TacticalZoom.Scrollenables mouse wheel zooming (Ctrl + Wheel) and middle click zoom reset.TacticalZoom.KeyEnabledenables keyboard commands.TacticalZoom.Maxsets the maximum zoom magnification (e.g.2.5allows zooming in up to 2.5x).TacticalZoom.Stepsets the zoom increment per wheel notch or hotkey press.TacticalZoom.Smoothtoggles smooth frame-by-frame interpolation between zoom levels.In
uimd.ini:In
RA2MD.INI:Map Action
514Set tactical zoomValue): Zoom percentage above 100% base (0= 1.0x / 100%,50= 1.5x,100= 2.0x,150= 2.5x).Param3): Transition rate (0= instant cut,>0= smooth transition speed per frame).Param4): Minimum visible screen width in pixels (0= unconstrained).Param5): Minimum visible screen height in pixels (0= unconstrained).In
mycampaign.map:Note
Hotkey Commands
[ ]Tactical Zoom Commandsuimd.ini.TXT_ZOOM_IN,TXT_ZOOM_IN_DESC,TXT_ZOOM_OUT,TXT_ZOOM_OUT_DESC,TXT_RESET_ZOOM, andTXT_RESET_ZOOM_DESCinto your.csffile.