Commit Graph

54 Commits (spacecruft)

Author SHA1 Message Date
Levin Li 318b4378a9 Fix lua crash in cleanup 2022-02-18 01:30:10 -08:00
Hleb Valoshka f969b37c3e Refactor font handling code
* Add cache for loaded fonts
 * Replace `const std::string &` with `std::string_view` in print
 * Remove static load method
 * Reformat with clang-format
 * Return bool from celestiacore::set*Font
2022-01-20 12:10:30 +03:00
Andrew Tribick f0e6ff3673 Refactor bigfix and univcoord 2021-12-30 21:30:18 +01:00
Andrew Tribick b683c7801d Return std::string_view from Tokenizer::getStringValue to reduce copying 2021-12-29 13:08:54 +01:00
Hleb Valoshka 50deb54bff Remove unneeded fs::path.string() conversions 2021-12-28 21:14:29 +01:00
Andrew Tribick 4f913eb3ad Collapse nested namespaces 2021-12-28 21:14:29 +01:00
Hleb Valoshka 14af83a391 Implement Logger to replace raw cerr/cout and DPRINTF usage 2021-12-20 17:54:50 +03:00
Hleb Valoshka 8a903b0d0d [celx] Add acceleration time to observer:gotoselection()
+ replace magic values with constants
 + small cleanup
2021-11-25 16:22:09 +03:00
Hleb Valoshka 189f6372e3 [celx] handle locations in object:localname() 2021-11-25 01:12:46 +03:00
Hleb Valoshka 2ff075d843 [celx] Fix location type returned by loc:getinfo()
getFeatureType() returns std::uint64_t
  + C++14 style for lambda
  + tiny-tiny optimization around std::string usage
2021-11-18 10:57:42 +03:00
Andrew Tribick ec232b7fad Fix for debug builds
- Include fmt/ostream.h in debug.h to allow formatting filesystem paths
- Avoid including headers via debug.h on non-debug builds
2021-10-26 10:17:48 +03:00
Hleb Valoshka 811ed4ff3c Fix a few error messages 2021-10-23 12:15:01 +03:00
Hleb Valoshka ccd01c460f Fix fs::path printing using fmt 2021-10-23 12:15:01 +03:00
Hleb Valoshka 42790d9013 Replace deprecated fmt::fprintf calls 2021-10-19 19:35:23 +03:00
Hleb Valoshka 6f666280fd [celx] fix paths in loadtexture() and runscript() 2021-09-06 20:53:36 +03:00
Hleb Valoshka 8153d2b5b4 [celx] Use default GLSL program in gl.Begin 2021-07-29 10:36:37 +03:00
Joseph C Wang 05cb7196b5 make it compile with fmt v8 2021-06-27 20:52:35 +03:00
Hleb Valoshka bece12f6e4 Refactor Image class and image capture
* use GL_MESA_pack_invert to flip captured buffer
 * move enum PixelFormat to own file
 * use PixelFormat instead of GL formats in Image
 * provide captureImage() in CelestiaCore
 * use CelestiaCore methods to capture images in Qt UI
2021-06-16 14:15:32 +03:00
Levin Li b4858b1e72 Use shared_ptr around TextureFont 2021-05-24 08:37:01 +08:00
Levin Li e3297b7775 Namespacing Marker* and Rect 2021-05-23 11:03:07 +08:00
Hleb Valoshka 1c078b1186 Don't use deprecated methods 2021-05-21 17:44:43 +03:00
Levin Li 9d74b326a9 Implement skip_permission_denied and align behavior with std::filesystem 2021-05-17 08:00:17 +08:00
Levin Li 80fb64ecc5 Use quoted include for lua.hpp 2021-03-27 22:30:39 +08:00
Levin Li a32e905556 Fix for lua 5.4 2021-03-14 20:40:59 +08:00
Hleb Valoshka f16c355d11 Add a new body parameter "reflectivity" complementing albedos 2021-03-10 17:51:10 +03:00
Hleb Valoshka 332840fdd1 Refactor Url class
* Critical change:
   - Drop Url versions 1, 2 and 4. Versions 1 and 2 are
     too old and can't be handled properly. Version 4
     was added to handle 64 bit RenderFlags but we can
     encode them in backward compatible way by adding a
     new parameter "nrf" ignored by Celestia 1.6.

 * Use string_view to reduce memory allocation during Url
   parsing.

 * Use non-throwing functions to parse numbers.
2021-03-08 14:08:36 +03:00
Hleb Valoshka b954e279a2 A bit of refactoring in legacy scripting support 2021-03-08 14:08:36 +03:00
Hleb Valoshka ba7e0602a0 Remove 'using namespace std' from header files 2021-03-08 14:08:36 +03:00
Hleb Valoshka 959d31de70 Fix LuaState::loadScript() usage 2021-03-03 20:18:32 +03:00
Levin Li 1f150db611 separate modelview and projection 2020-10-06 13:39:09 +08:00
Hleb Valoshka 0811e7c350 Remove make_shared and make_unique to keep single style 2020-07-07 08:15:18 +03:00
Hleb Valoshka 9e956abe3d Remove support for legacy TXF fonts 2020-06-24 17:14:31 +03:00
Levin Li 56ac73be36 Replace is_directory checking method 2020-06-23 21:13:12 +08:00
Hleb Valoshka 1c668d3d7f Fix warnings reported by clang/gcc 2020-06-20 10:11:09 +03:00
Hleb Valoshka c588f80824 OpenGL ES 2.0 initial support 2020-06-15 19:27:46 +03:00
Hleb Valoshka 0b6940565a [celx] Update ColorAttributeIndex value in gl.Color
...to fix font colors
2020-06-09 21:28:37 +03:00
Hleb Valoshka 457fcc1bac [celx] Return text width from font:render
...instead of updating ModelView matrix, fixes text rendering in LUT5
2020-06-09 21:28:37 +03:00
Hleb Valoshka a33e24914b [celx] Add method celestia:version() 2020-06-09 21:28:37 +03:00
Hleb Valoshka d9243202fa [celx] Add method font:unbind() 2020-06-09 21:28:37 +03:00
Hleb Valoshka ec41cfde60 Refactor TextureFont::render()
1. Don't update ModelView Matrix in TextureFont::render()
  2. Remove variants without offset
2020-06-01 10:35:42 +03:00
Hleb Valoshka bd7f9ebc9b Use libepoxy instead of GLEW
Unlike GLEW libepoxy supports OpenGL ES and better handles cases with
functions provided by different extensions, e.g. the same functions
provided by vendor/EXT/ARB/core.
2020-03-26 11:24:56 +03:00
pirogronian f75f86436a Use find method in lua getstar and getdso. 2020-03-13 12:43:16 +01:00
pirogronian 1ebc427f41 Transform CatEntry into AstroObject with minimal common indexing rountines. 2020-03-06 18:11:53 +01:00
Hleb Valoshka fb4bede3d1 Allow building without NLS 2020-02-15 00:20:13 +03:00
Hleb Valoshka 739f71cd1c Cleanup includes a little bit 2019-12-21 19:16:39 +03:00
Hleb Valoshka 26063bf3a6 Use shaders to draw fonts 2019-12-21 19:16:39 +03:00
Hleb Valoshka 7b592b4eda Remove copy constructor & operator= in LuaHook
Because of member of std::unique_ptr type LuaHook can't be copied
2019-12-06 10:55:14 +03:00
Hleb Valoshka 682aef8422 Initial implementation for TrueType fonts support 2019-11-20 12:16:15 +03:00
Hleb Valoshka 097d7113e2 Provide a common method to save screenshots 2019-10-19 17:47:31 +03:00
Hleb Valoshka dfd177ffc7 Implementation of the new interface for Lua scripting 2019-10-19 13:17:32 +03:00