* Build all of the lines into a single buffer once, render as necessary and offset using the transform
* Added an optimisation during sector selection to reduce the number of sectors generated. Reserving the size of some vectors.
* Stupid formatting
* DistanceBetweenSqr to avoid sqrts
* Avoid more square roots and reserve the nodes array size with a guess at it's required capacity
- fix segfault in the system map if a centered ship is removed
- reset the system map view if the centered ship is hidden
- if the mission target is a specific systembody, when you press the "set
as nav target" button, the sector map is set to the correct star of the
multiple system
- shrink the searchbar window in the sector map when nothing is shown on
it
Still not as perfect as I'd like it, but it runs, works correctly, and closes with ESC.
Need to double-press the console binding to close it due to some state tracking being lost when re-adding the input frame.
- Refactor InputFrame add/remove to support the console better.
- Remove the unneeded HandleSDLEvent virtual method on View.
- Fix a binding name mismatch issue.
- Add a (disabled) PerfInfo debug tab for debugging the input system.
Significantly refactored the Input class, added Input::Manager to handle
most duties of the Input system.
Replaced the legacy KeyBindings system with the new InputBindings
(namespace subject to change) system for handling key state and key
chords - among other improvements, there is no longer a hardcoded
dependency on Pi::input anymore, as well as storing the binding state in
the binding itself, completely decoupling InputBindings from the input
system that handles input events and significantly reducing the
complexity of the binding system.
Input::Manager now is totally responsible for generating binding events,
removing the need for WorldView::HandleSDLEvent and its ilk - interested
parties can simply bind to the onPressed event and they will only be
notified when the binding in question is part of an active input frame
and nothing else has grabbed the input event, vastly simplifying control
flow.
Among other effects, this almost totally eradicates the need for
Pi::IsConsoleActive().
The lua Console widget is slightly broken as a result of this change,
it doesn't handle activation/deactivation state changes properly. The
solution to this seems to simply be a direct rewrite in PiGui, which
I don't expect to cause too many issues.
I've added a CMake option to use LLD to speed up incremental build link
times; this seems to be somewhat platform dependent and is not
implemented for windows at this time.
Serialization of key bindings to the config file is totally completed,
although support for a graphical method of binding multi-key chords is
not anticipated for this pull request.
Allows older cards without support for GL_ARB_clip_control to use the reverse-Z buffer
Introduced a ResetDepthRange function to allow SectorView to clean up after itself.
This is intended to replace Gui::Screen::Project in 90% of cases
It's a much better function to use especially in the case of a resizing screen.
Rewrite part of SystemView to take advantage of this function.
Fix directional indicators not screen-culling
Remove all OpenGL 2.x like methods from the renderer API, now the matrix state
is the responsibility of the caller via MatrixTicket / StateTicket.
Still TODO is improving the viewport state tracking, although that should be
rather simple to fix.
Fixes#4901
System map: add a check to see if we are in hyperspace
Sector map:
- move the drawing of the player's indicator from DrawNearSector up to
Draw3D
- calculate the interpolated position of the player's indicator during
a hyperjump
- don't display current system during hyperjump (lua-side)
- fix selected system indicator (green circle), it pointed not to
the the selected system, but to the current system
Also:
- add easing function into utils.cpp to smooth the movement of the
player indicator
- move fuel reduction from the start of the hyperjump to the end
- force handling of lua events immediately after entering system
- Moved playing the 'target selected' sound to PiGui instead of C++
- Removed several unused functions/methods from SectorView
- Removed the WorldView method handler previously responsible for playing the target selected sound
- Better documentation and behavior for pigui.playSfx
- fix that Auto Route button crashes game when no hyperdrive fitted. Add
3 possible options - successful route building, no drive, no valid
route. Also turn the last static function in LuaSectorView.cpp into a
lambda, because it turned out that it was not needed in other functions.
- fix that when moving the SectorView camera by entering coordinates to
the search field, the camera position gets "locked" to the coordinates
and you can't move it (now it moves only when the search bar changes)
- clear route strings when enging the game, otherwise, when the game
restarts, a segfault occurs
- fix that the "remove jump" button continued to remove jumps even
when the route became empty
- reordered sections in the object information widget, added icons to
the names of stars in the multisystem
- it turns out that a hyper jump is possible not only to the stars, but
also to the "substellar objects", but they do not return in the method
GetStars. Since a specific body should be shown in the route planner,
implemented an additional method GetJumpable, that gets all the bodies
available for jumping (IsJumpable == true), and this is synchronized
with what you can click in the systeminfo view
- also I had to change the route check, now it’s not the star index that
is checked, but just the path (this check is performed for multisystems,
so that only the specific body that registered in the route is always
selected)
- remove method SectorView::SwapSelectedHyperspaceTarget, because it is
not used anywhere
- clang satisfaction
- move detailed route calculation to a separate function, now it does
not execute every frame, only when changing the route or when changing
the equipment
- attach lambda functions to the OnPressed callbacks of these input actions
instead of the generic OnKeyPressed callback
- add some comments
- Change view movement mode to XY-constrained planar movement
- Rename map movement axes, invert key bindings for consistency
- Fix axis colorations in Drawables::Axes3D
- Used the previously defined lines in /core/*.json, so I added an
additional line search for this directory
- Add some strings to input-core/en.json
- Convert key pairs in axis
- Remove unused bindings in KeyBindings.h
- Completely remove several bindings that became irrelevant
- Use some input bindings for the sector map in the system map
- redo the hyperjump planner from a separate module to a part of the
system map module, so that its position and size could be controlled by
system map module
- add a button bar on the right
- add handler functions for the zooming and rotation buttons to the
SectorView class, and LuaSectorView.cpp
- add the actual measurement of the size of the windows, or rather their
simplified counterparts (dummies) to precisely align the windows
relative to each other
- add button for centering on the selected object
- add function SwitchToPath, that only selects the system or also moves
to it, depending on the settings
- replace "SetHyperSpaceTarget" function to "SwitchToPath" function, when
player click "Set As Navigation Target" in mission briefing
- draw legs for all systems in the route
- draw lines to the selected system from the current system and from the
end of the route
- set visibility params from button states every game start
Bold decisions to simplify the interface:
- remove the description of the current system and the hyperjump target,
now there is a description of only the selected system
- hyperjump is done *only* to the next waypoint
- not a system is remembered in the route, but a specific star, and the
jump is carried out on it
Forward declare Space in Ship.h; Make things compiling again
Decouple WorldView.h; Some other decouple here and there
Decouple Renderer no more included in RenderState; Model not including directly its childs
* Get input handling into its own class, get it out of the core monolith.
* Started work on implementing the input refactor.
Don't even bother compiling this one, it is absolutely broken.
* Continue upgrading and implementing.
Still don't try to compile this.
* IT'S ALIVE!
Or, in other words, it compiles and runs just fine. Still need to re-implement
axis binding and finish moving away from KeyBindings.inc.h, but we're most of
the way there.
* Moved the lua-side code over to the new system.
Still needs changes to work with the localization system and properly
implement axis deadzone and inversion, but it's most of the way there.
* Finalized the new Input changes.
Hyperjump Planner also includes an 'auto-route' feature
that selects the shortest duration route based on Dijkstra's algorithm.
Changes in addition to the hyperjump planner:
Reduced font size (declutters the sector map)
Expose ui.isItemClicked
Added a yellow line to the sector map for the selected route
Reduced the squares in the 'far' sector map to 0.25 size
Reduced alpha of the squares in the 'far' sector map
no more quick and dirty labels. made the point stand out from the background clutter with contrast background. centered the label and decreased the margins slightly. label no longer overlaps the star.