Commit Graph

18793 Commits (b7cfc56b59103d6d0f8b7f9087d44bfc5cb3673a)

Author SHA1 Message Date
Webster Sheets 46dad22901
Merge pull request #4786 from Web-eWorks/ui-hot-reload
New require() implementation
2020-02-11 11:55:59 -05:00
Webster Sheets 408c03ed12 Incorporate suggested review changes 2020-02-06 00:41:46 -05:00
Webster Sheets 5c08ff0153 Replace broken module names in lua code
Note that this does not refactor the code base to use the require 'module.name' format yet; this simply allows the game to run under the new system.
2020-02-02 21:47:18 -05:00
Webster Sheets 5cb068ff12 Remove old lua_import() code. 2020-02-02 21:45:27 -05:00
Webster Sheets a79848a24a Port pi_lua_import_recursive to new system
Bugfix load_from_core, refactor pi_lua_import and pi_lua_import_recursive..
2020-02-02 21:38:31 -05:00
Webster Sheets 68cc2ea057
Update Changelog.txt 2020-02-02 17:35:12 -05:00
Webster Sheets 5299492517
Merge pull request #4758 from cwyss/contbutton
Make continue button load _quicksave if autosave not active
2020-02-02 17:21:29 -05:00
Webster Sheets daf088f359
Merge pull request #4787 from Gliese852/reject-back-project
Improve System Map rendering and interaction
2020-02-02 17:20:29 -05:00
Webster Sheets 420a445a0f
Merge pull request #4784 from Gliese852/ellipse-again
Small additional improvements to orbit calculation (#4784)
2020-02-02 17:08:28 -05:00
Webster Sheets 8ff5080384
Merge pull request #4779 from vakhoir/bugfix/font_bake_memory_leak
Fix on-demand glyph loading
2020-02-02 17:03:17 -05:00
Gliese852 a086c771f6 indentation & clang satisfaction 2020-02-02 15:16:39 +03:00
Gliese852 393408cd34 Minor improvements to System Map
1. Reject back-projected 2d objects.
Since the function Gui::Screen::Project does not cull points
(and most likely should not), this must be done manually, as was
done in the SectorView.cpp for labels. Checking z < 1 in the Normalized Device
Coordinates discards points that are further than the zfar clipping plane,
and beyond the center of the camera. The points between the center of the
camera and the znear clipping plane remain. They may be needed.

2. Adjust z-far plane for projection to clip space.
With a severe zooming in, the coordinates of objects can become too large and
fly out of the z-far plane. Therefore, it was done so that the z-far plane
moved away proportionally. But with a severe zooming out, it z-far plane can
become smaller than DEFAULT_VIEW_DISTANCE, and this is also taken into account.

3. Change the axis of rotation when dragging the mouse horizontally.
Set horizontal rotation around the axis of the ecliptic. It seems to me that
it’s more convenient to examine the system. For good, it was necessary to
rename the variable from m_rot_z to m_rot_y, but I did not want to
recompile everything.

4. Do not calculate and draw the player’s orbit when it is docked or landed.
2020-02-02 15:16:39 +03:00
Webster Sheets ce887abf96 New require() implementation
We now load files via Lua 5.2 require() semantics instead of raw paths.
This means we've dropped the current directory implicit lookup, and
instead we use module names to semi-uniquely identify a package.

We mimic the behavior of package.path for the data/libs/ directory,
with an eye to allowing client code to extend that behavior later on.

Loaded modules are cached in a two-stage cache; the first stage maps
module names to file paths to avoid duplicate loads, and the second
stage maps file paths to the return value of a module.

package.reimport(name) can be used to purge the cache of a specific
name and force it to be reimported (as the name suggests). It returns
the imported module, similarly to require().

This implementation deprecates import() and translates old-style calls
to that function to the new module names. It complains loudly in the log
when it does so, so we can keep track of what modules need to be updated.
2020-02-02 03:02:18 -05:00
Webster Sheets ecf0ecbf97
Merge pull request #4776 from Web-eWorks/ui-hot-reload
Rewind PiGui stack in case of an error
2020-02-01 22:23:01 -05:00
Webster Sheets 0b3235ffeb Lua: Add package.core, remove import_core() 2020-02-01 21:18:39 -05:00
Webster Sheets 491ab1f37f Restore the ImGui stack after a lua error throw 2020-02-01 21:18:39 -05:00
Gliese852 ed3b134327 Small additional improvements to orbit calculation
Was: orbit with 0.9999 < e < 1.0001 forced to e = 1.0001 (hyperbola)
Now: orbit with 0.9999 < e < 1      forced to e = 0.9999 (ellipse)
     orbit with 1   <=   e < 1.0001 forced to e = 1.0001 (hyperbola)

In an elliptical orbit, when the eccentricity is fixed at 0.9999, and
the speed increases, the semi-major axis shrinks and the apocenter moves
toward the star. Therefore, a condition check has been added that prevents
the ship from shifting in this case.
2020-02-01 19:14:07 +03:00
Pioneer Transifex 105d06e33f auto-commit: translation updates 2020-01-31 03:01:20 +01:00
vakhoir 13f7645433 Rename m_ranges to m_invalid_glyphs
Rename containsGlyph to isValidGlyph
Change the approach to checking if a font can handle a glyph. The original approach was to pass the valid glyph range to the constructor. When it's not found by ImGui we call AddGlyph where we check if it's valid for the font. In the event where ImGui couldn't handle a glyph that was defined as valid in the constructor, that led to constant re-baking of fonts. The new approach is to change m_ranges (which used to contain valid glyph ranges) to m_invalid_glyphs, which contains only invalid glyphs that we tried to add to the font but failed. The next time AddGlyph is called, we skip the font since it's unable to handle the glyph.
2020-01-30 19:37:41 +01:00
Pioneer Transifex 2fdfd89085 auto-commit: translation updates 2020-01-30 03:01:28 +01:00
Andrew Copland 5938ecc39f
Update Changelog.txt 2020-01-29 10:31:45 +00:00
Andrew Copland bdd05617b5
Merge pull request #4777 from Gliese852/orbits
Fix / improve orbit calculations.
2020-01-29 10:31:17 +00:00
Karl F f6ae4c7270 Update Changelog
Cherry-picking 2 commits from semi-unrelated PR #4746, to prevent bitrot
2020-01-29 10:52:17 +01:00
Armin Kretschmer d2d4697a5b Trigger event on missile launch 2020-01-29 10:38:57 +01:00
Armin Kretschmer 6506fa763c Notice missile launch 2020-01-29 10:38:31 +01:00
Webster Sheets 8c7fb4ad17
Update Changelog.txt 2020-01-28 19:16:54 -05:00
Webster Sheets b902837ddb
Merge pull request #4764 from cwyss/onscreen-objects
Improve usabiltiy of in-space body indicators
2020-01-28 18:55:08 -05:00
Webster Sheets 4e7744af9a
Merge pull request #4770 from Gliese852/issue4719
Fix mission screen obscuring buttons
2020-01-28 18:46:38 -05:00
Webster Sheets 0fa7440eec
Merge pull request #4774 from vakhoir/feature/ship_market
Ship market
2020-01-28 18:42:26 -05:00
Webster Sheets fd673ab079
Update Changelog.txt 2020-01-28 18:10:21 -05:00
Webster Sheets f86d6ce467
Merge pull request #4767 from vakhoir/bugfix/savegame_dialog
ModalWindow class that allows nesting
2020-01-28 18:09:18 -05:00
Gliese852 ab04807300 indentation + clang format satisfaction 2020-01-28 09:01:47 +03:00
Gliese852 633e996859 Fix calculation of the orientation matrix and parabolic orbit problem
1. Fix orientation matrix calculation
It was found that the orbit orientation matrix is calculated through
the Euler angles, which are calculated from the velocity and position
vectors, and many divisions are made in which the denominator can
unpredictably approach 0. All this was removed since the matrix is
easily calculated directly from the vectors.

2. Transition without distortion from an elliptical orbit to a hyperbolic
When moving from an elliptical orbit to a hyperbolic one, the eccentricity
passes through 1 (parabola), when the average anomaly is zero everywhere,
except for infinity. Therefore, the ship at this time is attracted to
the point of the pericenter, because there is not enough accuracy to
go from the true anomaly to the middle anomaly and back, and stay in
the same coordinates. Therefore, I suggest jumping from an ellipse
with e = 0.9999 to a hyperbole with e = 1.0001. These orbits are
very similar, almost identical. Moreover, ellipses with
0.9999 < e < 1 are also considered as hyperbolas, so that there are
no distortions at a low speed of the ship.
2020-01-28 09:03:30 +03:00
Gliese852 dc0599397b Fix orbit calculation for ships with low speeds
1. Improve numerical method for Kepler's equation
It turned out that numerical methods are implemented with a fixed number of
iterations (5), and they are not always enough. Moreover, testing showed
that in some cases the solution does not converge and even 10,000
iterations are not enough. Therefore, a more slowly converging
bisection method was added, in case the main method fails in 10 iterations.

2. Stabilize low speed orbits
When the ship has low speed, its orbit is a very elongated ellipse,
and its true anomaly is very very close to pi. Trimming the variable to
1 - 1e-6 before taking the arccos does not allow it to get close to pi
enough, so there is a strong shift from the true position. Therefore,
it was removed.
2020-01-28 09:01:47 +03:00
vakhoir a5d696e7eb Ship market
Explicitly set ModelSpinner pauseTime to 0 in constructor
Launch Request button alignment fix in Lobby View
2020-01-25 18:21:50 +01:00
vakhoir 9d18440690 ModalWindow class that allows nesting
Checking isWindowHovered in market widget, so it ignores mouse events under a modal window
2020-01-25 18:18:57 +01:00
Webster Sheets ec789570ec Split LuaUtils.cpp into topical files 2020-01-21 16:25:38 -05:00
Webster Sheets ec410f31d8 Update includes to point to new lua/ directory 2020-01-20 18:13:45 -05:00
Gliese852 7cd3f5501a indent only 2020-01-20 16:00:56 +03:00
Gliese852 0a53193c2d file corrections, no indent
hide comms button in flight, because it duplicates the button function in the upper right corner of the window
hide the system-overview-window when we are not looking into the world
2020-01-20 15:52:36 +03:00
Webster Sheets cfe2e75a8c Move lua initialization out of Pi.cpp 2020-01-20 00:59:32 -05:00
Webster Sheets b0e87b9090 Move every Lua-related .h/.cpp file to src/lua/
- The rationale is very simple - there are literally 200 or more source files
  in src, and the lua files are fairly well self contained with very few
  external dependencies.
- This also means I have 79 less entries to scroll through
2020-01-19 22:00:14 -05:00
Karl F 99a2e0b452 Added new contributor 2020-01-17 17:56:53 +01:00
Webster Sheets 5cc007257b
Update Changelog.txt 2020-01-16 17:11:59 -05:00
Webster Sheets 0abf5b62b9
Merge pull request #4772 from cwyss/profiler
CMake profiler build option: support older versions of cmake
2020-01-16 17:11:23 -05:00
cwyss ebb01fcdbb CMake profiler build option: support older versions of cmake 2020-01-16 21:20:59 +01:00
Webster Sheets c452c5469f
Update Changelog.txt 2020-01-14 19:31:42 -05:00
Webster Sheets 90b447ba49
Merge pull request #4771 from Gliese852/noscrollbar
Don't save window sizes for fullscreen windows; avoid scrollbar issues at different resolutions
2020-01-14 19:30:09 -05:00
Gliese852 8063a5254b fix issues #4468 or #4699 - unpleasant scrollbars 2020-01-14 17:39:36 +03:00
cwyss 37ceda8b1a Restore old behaviour: main body handling of collapsed in-space bodies
- Use main body's coordinates to place indicator
- If group contains nav target, this becomes the main body
2020-01-12 22:10:54 +01:00