Commit Graph

816 Commits (master)

Author SHA1 Message Date
Webster Sheets 37deea46c5 Fix (and document) depth linearization 2021-03-27 00:32:41 -04:00
Karl F 9e44b09314 Happy new year!
HAPPY MERRY 2021!
2021-01-03 19:40:16 +01:00
Webster Sheets 7c9753af16 Fix guns needing combat target, modelviewer config
Fixes #5103
Fixes #5099
2021-01-02 18:31:37 -05:00
Webster Sheets f8c91ade0b Port NavTunnel widget to pigui 2020-12-21 23:40:33 -05:00
Webster Sheets b480e22c36 Refactor screen projection functions
Fixes issues with directions being projected as positions.
Clean up several now-unused functions.
Move screen projection functions from Body to Engine where they belong.
2020-12-21 23:40:33 -05:00
Webster Sheets f7365fd5c8 Add player aim-assist, calc lead in FixedGuns
- Add limited (~1.5 degree) aim assist for the player, using the existing lead pip calculations
- Moved the target lead calculations into FixedGuns instead of WorldView
- Refactored Quaternion.h for simplified construction of axis-angle vectors.

Fix target and frame indicators being misaligned in external camera.
2020-12-02 00:27:29 -05:00
Webster Sheets 7506dcb849 It is the nature of all things to die...
and the reaper's due must be paid.

As we fly back to base after another successful mission, let us clear
comms in a moment of silence for the wingmates who no longer fly in
this squadron.

- To Robn, who wrote newUI in the first place. Without you, there would
  be no newUI or pigui, and I'd still be complaining about oldUI.
- To Johnbartholomew, who spearheaded the move of existing systems to
  newUI and implemented plenty of code we still use today.
- To ecraven, who did all of the work of adding ImGui to the code base
 and worked tirelessly to port existing screens.
- To vakhoir, who not only worked tirelessly to port the most
  recalcitrant of screens, but developed UI frameworks and paradigms
  that made working on the UI a pleasure instead of a pain.

This commit totally removes the newUI from the codebase. Everything that
made reference to it (save the LuaConsole) has been ported or struck
from the code. This has simplified some systems significantly, has
allowed us to drop 8,000+ lines of C++ code, cut our build times
significantly, and brings us one step closer to a modern rendering and
tools pipeline.
2020-12-01 13:02:34 -05:00
Webster Sheets aeebf6e514 Fix a few bugs with the Input system
- 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.
2020-11-15 01:51:34 -05:00
Webster Sheets 5c957eae97 Fix foward angle indicator
Now properly points to the front of the craft
Also added a proper screen-space depth linearization function to WorldView.cpp
2020-11-14 03:35:22 -05:00
Webster Sheets 37c96041e1
Refactor Body inheritance tree to remove Object and CityOnPlanet (#4995)
* Remove CityOnPlanet from Object hierarchy

* Remove Object from the inheritance hierarchy

* Rename Object -> ObjectType
2020-11-11 19:33:04 -05:00
Webster Sheets f5d7038d69 Refactor to InputFrame 2.0
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.
2020-11-11 18:41:34 -05:00
Webster Sheets a51ee57a09 Refactor view control API
- Rename InteractionController->ViewController
- Use Body's flag mechanism to exclude bodies from drawing
- Pave the way for non-ShipView ViewControllers via SetViewController()
2020-09-07 22:17:41 +01:00
Webster Sheets 126b36419a Cleanup warnings and diagnostic pragmas
- Remove a number of unused variables
- Clean up a few assertions checking if an unsigned variable might be negative
- Consolidate miniz diagnostics into the miniz header
- Make sure lookup3.c doesn't throw unused variable warnings
2020-08-16 01:22:52 -04:00
Webster Sheets f748b0a2e9 Cleanup SectorView, move nav target sound to pigui
- 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
2020-08-02 17:35:29 -04:00
Webster Sheets f64e78d62f Cleanup WorldView, inherit from PiGuiView
- Move some less-used signals to PlayerShipController rather than Pi
- Remove WorldView's dependency on newUI
- Remove unused signal connections in WorldView
2020-08-02 17:35:09 -04:00
Webster Sheets 5f30a3c3ac Remove debug info and (unused) target info display 2020-08-02 17:35:09 -04:00
Webster Sheets b3da50faa1 Move WorldView debug info to pigui 2020-08-02 17:35:09 -04:00
Webster Sheets d9e8532e0e clang-format changes 2020-08-02 17:35:09 -04:00
Webster Sheets b71787c942 Major changes to WorldView screen functions
- Body::GetTargetIndicatorPosition now returns local-space coordinates
- CameraContext has a getter for parent frame, renamed GetCamFrame to GetTempFrame, added GetCameraOrient/Position
- Implemented matrix4x4 utilities to construct from orient+pos, fast inverse transform for position vectors
- Fixed bug where mouse would be locked if held while docking
- Preliminary work on ShipViewController, made WorldView::shipView an unique_ptr (why didn't I do it that way in the first place?)
- Cleaned up some cruft from WorldView and moved to appropriate locations
- Completely changed the way WorldSpaceToScreenSpace etc. works, now no longer requires camera frame
- Added WorldView::RelSpaceToScreenSpace, meant for pigui to use for displaying e.g. body:GetPositionRelTo(player)
- WorldSpaceToScreenSpace now operates on frame-relative coordinates, use RelSpaceToScreenSpace for player-relative coordinates
2020-08-02 17:35:09 -04:00
Edoardo Morandi e6b9cd8d71 Remove many warnings 2020-04-25 01:31:42 +02:00
Webster Sheets 64e768e9c5 Change Pi::input to a pointer
Pi.cpp is not included because it's currently being gutted
Decoupled Input::Init() from Pi::config to better support headless mode
2020-03-26 00:34:04 -04:00
Karl F 436db08636 Happy new decade!
May you live long and prosper!
2020-01-01 10:47:46 +01:00
mike-f1 4f1eaa41d3 Update all files to store and use FrameId instead of raw pointers 2019-11-16 17:54:14 +01:00
mike-f1 e6403fc1ad Decouple includes; Remove some unused variable; Fix an equation in Space.cpp 2019-10-20 11:19:45 +02:00
Webster Sheets 7534cc2bca Move set-speed control to an axis binding, remove WorldView::ChangeFlightState. 2019-06-01 13:45:36 -04:00
mike-f1 75956b9fd0 Decouple includes of Sfx.* and trade dependency from Ship with dependency from ModelBody
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
2019-05-21 17:50:50 +02:00
Webster Sheets 5cbec9bdf2 Properly translate and localize the bindings options view.
(+ run jq . < en.json for formating)
2019-04-16 09:02:21 +02:00
John Jordan 147220a56a Fix game load crash typo 2019-03-21 17:30:51 +00:00
Webster Sheets c815e4aba9 Refactor sound code to it's own folder, delete Pi::BoinkNoise. 2019-03-10 16:45:34 -04:00
Webster Sheets 34e896550a Split view controller to it's own class, added InputFrame code.
This conforms better to the new Input paradigm, and fixes a number of bugs
relating to the ship view incorrectly rotating while in another view.
2019-03-10 21:42:11 +01:00
Andrew Copland d8c6e73513 Removal of dead function declarations, const and pass by reference changes 2019-03-02 20:31:00 +00:00
mike-f1 1de66bf587 Include decouple, second round 2019-02-15 21:57:17 +01:00
mike-f1 f1a53cffd6 Remove some inludes from Pi and get things right in order to compile 2019-01-22 20:10:28 +01:00
Karl F d2ab921b62 Happy New Year!
Awesome sauce (for next year):
find . -type f -exec sed -i 's/2008-2018 Pioneer Developers'/'2008-2019 Pioneer Developers/g' {} \;

closes #4507
2019-01-03 15:28:42 +01:00
Jeremy List 3147c12097 Insert missing newline at end of file 2018-10-28 11:58:47 +13:00
Jeremy List 1b3ab9e878 Apply clang-format 2018-10-28 11:44:18 +13:00
Jeremy List b6f46e3dfa Restore "WorldView" key bindings to event dispatch cycle.
This ties up some loose ends from cf91b0870f
2018-10-27 14:36:08 +13:00
Webster Sheets 3a3a13edec Update pioneer to use the new save system. 2018-10-11 11:45:57 -04:00
Webster Sheets cf91b0870f Update WorldView to use the new system, change the key binding UI. 2018-09-07 17:07:44 -04:00
Webster Sheets e8a98c2b6a Improve Joystick / Input Handling (#4432)
* 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.
2018-09-06 12:15:17 +01:00
Peter 3590faf4a9 Remove obsolete C++ code.
Cleanup, remove C++ in-flight F4 window.
2018-07-13 22:13:25 +02:00
Paul B Mahol 7742a5ddcc add flyby camera view
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-07-04 21:55:56 +02:00
Taylor Talkington 4e6956f8b2 Move LowThrust Setting to ImGui
Clicking on the low thrust indicator or pressing F8 now shows the slider
above the low thrust indicator. The slider can be used to adjust the
amount of thrust when 'low thrust' is active. Clicking the low thrust
indicator or pressing F8 again hides the slider.
2018-01-08 07:28:29 -05:00
Karl F 7225e9c723 Happy New Year!
Ten years in the making now, but how can we improve upon perfection
for ten more years?
2018-01-01 21:22:12 +01:00
John Bartholomew 7c3a13a0c0 Remove almost all includes of Serializer.h, include GameSaveError.h where necessary. 2017-12-26 13:02:26 +00:00
Peter b8ef1f155f Move CommsLog to lua 2017-08-19 23:27:05 +02:00
Peter 03c690e734 Move various HUD parts to lua. 2017-08-19 23:27:05 +02:00
Peter 16424e0248 Add support for showing gauges. Add planetary info.
Modules can now add gauges with ui.registerGauge (see
data/pigui/modules/gauges.lua for details).

Latitude/Longitude are now shown with imgui.
2017-08-12 19:17:46 +02:00
Andrew Copland 41575a7618 Merge pull request #4005 from fluffyfreak/under-pressure
Simple atmospheric crush pressure
2017-05-13 13:21:27 +01:00
Peter 93104a3984 The Great Disinheritance: make FixedGuns a component 2017-05-10 13:49:06 +02:00