Commit Graph

3763 Commits (670cedd9670726df11a4b414596dad1da9f6319f)

Author SHA1 Message Date
Tomasz Kapuściński bd2ad39f6a Refactored Math::IntPoint in CText 2021-12-23 22:47:15 +01:00
Tomasz Kapuściński 48d2b4a618 Refactored Math::IntPoint in core graphics classes 2021-12-23 22:35:28 +01:00
Tomasz Kapuściński cd6ea1a4c5 Changed Math::IntPoint into alias to glm::ivec2 2021-12-23 22:09:58 +01:00
MrSimbax 4ecfb47f07 Fix MSVC errors 2021-12-21 18:01:42 +01:00
MrSimbax d3dd99c384 Refactor fonts reloading
* Remove hardcoded default font name.
  This means the `fonts/fonts.ini` file is now mandatory
  and must contain definition of all 9 font types.
  Old mods relying on an incomplete `fonts.ini` file might break.
  A separate PR creating the required `fonts/fonts.ini` file
  should be merged before this pull request.
* Simplify `CFontLoader`.
    * Return `std::optional` instead of returning a default.
    * Remove the now unnecessary `std::map`s.
    * Remove the now unnecessary `GetFontType` method.
* Improve Gfx::FontType.
    * Provide `ToString` function for the enum, which is now
      used for logs and by `CFontLoader`.
    * Provide `ToBoldFontType` and `ToItalicFontType` functions.
    * Replace hex literals with binary literals for readability.
* Move font caching related code to a new private class `FontsCache`.
    * Add neccessary changes because of changes made in `CFontLoader`.
    * Add minor code improvements like renames and formatting.
    * Split the code into smaller functions for readability.
    * Simplify the `CText` class.
* Apply the rule of 5 to the `CachedFont` structure.
2021-12-21 00:50:36 +01:00
Evgeny Pestov 69ea470a26 CEdit::MoveChar never moves cursor between bytes of one UTF-8 symbol 2021-12-17 00:54:44 +07:00
Evgeny Pestov 65da4c42c4 CEdit::DeleteOne expands selection to delete integer number of UTF-8 symbols 2021-12-17 00:54:38 +07:00
Evgeny Pestov cd059bd511 Show questions instead of crushing in case of UTF-8 errors 2021-12-17 00:54:30 +07:00
Mateusz Przybył 53053b901f
Merge pull request #1483 from colobot/dev-cbot-io-tests-refactor
Refactor CBotUT.TestSaveStateIoFunctions
2021-12-15 18:00:34 +01:00
Mateusz Przybył 17f68efb81
Merge pull request #1481 from colobot/dev-minor-fixes
Some minor technical fixes
2021-12-15 17:59:54 +01:00
Tomasz Kapuściński 98ad26da3d Changed glm::identity to explicit construction 2021-12-15 00:20:56 +01:00
Tomasz Kapuściński 36ac6d9956 Another fix 2021-12-15 00:09:47 +01:00
Tomasz Kapuściński 1eb17b2fa1 Added includes to fix compilation errors for older versions of glm 2021-12-14 23:56:24 +01:00
Tomasz Kapuściński 33744de372 Add target alias for older versions of glm 2021-12-14 23:42:14 +01:00
Tomasz Kapuściński d651b36eb2 Corrected includes 2021-12-14 23:09:20 +01:00
Tomasz Kapuściński 7e0db31cc1 Merge branch 'dev' into dev-graphics-overhaul 2021-12-14 22:27:43 +01:00
Tomasz Kapuściński c389156499 Added commands for controling triplanar mapping 2021-12-14 21:58:23 +01:00
Tomasz Kapuściński 0207669d61 Added optional triplanar mapping mode for the secondary texture 2021-12-14 21:54:19 +01:00
Tomasz Kapuściński b158318e83 Possibly a fix for most transparency issues 2021-12-14 21:51:29 +01:00
Tomasz Kapuściński 11bfcc6d53 Fix resetting bound textures 2021-12-14 21:50:26 +01:00
Evgeny Pestov 9269a55e8b Fixed input of long UTF-8 symbols in editor (#1423) 2021-12-14 23:06:37 +07:00
Tomasz Kapuściński 2583f6fe36 Removed UIRenderer's DrawPrimitive() via CDevice 2021-12-12 21:17:39 +01:00
MrSimbax 193d105a3f Refactor CBotUT.TestSaveStateIoFunctions
Split the test into several parametrised tests for each data type.

Add more tests with different values.

Fix the ReadBinary() function in order to fix the ReadDouble() function
for negative values (the sign bit was being lost).
2021-12-09 20:44:31 +01:00
MrSimbax ea7837b4c6 Remove usage of a CMake 3.17 feature
We currently use CMake 3.16 for compatibility with Ubuntu 18.04 LTS.

The `NAME_MISMATCHED` argument which turns off a CMake warning
when using `FIND_PACKAGE_HANDLE_STANDARD_ARGS`, is not available
in CMake 3.16 and can prevent a successful build.

See
https://github.com/colobot/colobot/pull/1478#issuecomment-986204233
2021-12-08 19:35:30 +01:00
MrSimbax f9c275919e Fix CMake warning about empty GoogleTest version
The warning appeared when GoogleTest is used as a submodule.
2021-12-08 19:25:36 +01:00
MrSimbax 38b9b9be4c Update data, gtest and add options to .gitmodules
Update the `data` and `lib/googletest` submodules.

`git submodule update --remote` command should now
update the data submodule by rebasing on the remote branch named
the same as the current branch.

Changes in the `lib/googletest` submodule should now be ignored
in `git status`.
2021-12-08 19:15:16 +01:00
MrSimbax 9fd935770a Fix CBotUT.TestSaveStateIOFunctions
Fail occurred due to wrong read of min double.
`unsigned long` has been changed in Write/ReadDouble functions to
`uint64_t`.
`unsigned int` has been changed in Write/ReadFloat functions to
`uint32_t`.

According to the standard
`int` is at least 16-bit so it might be too small for 32-bit `float`,
`long` is at least 32-bit so it might be too small for 64-bit `double`,
and `long long` is at least 64-bit.
2021-12-05 16:51:51 +01:00
Tomasz Kapuściński d1489a1fb1 Removed ShadeModel 2021-12-05 13:01:12 +01:00
Tomasz Kapuściński 0568fcdb81 Refactored FillMode to enum class 2021-12-05 12:53:31 +01:00
Tomasz Kapuściński 39c837d323 Refactored PrimitiveType to enum class 2021-12-05 12:26:34 +01:00
tomangelo 3aa7c3c2e0
Stop handling compilation warnings as errors (#1477)
* Stop handling compilation warnings as errors

* Restore mistakenly removed flag
2021-12-05 11:51:28 +01:00
Tomasz Kapuściński 7a555e19c4 Fix in convert_model tool 2021-12-04 16:04:53 +01:00
Tomasz Kapuściński 26c0d85c66 Updated cache key 2021-12-04 16:02:17 +01:00
Tomasz Kapuściński 613efd7599 Added missing glm library to CI 2021-12-04 15:31:16 +01:00
Mateusz Przybył ae179d9005
Merge pull request #1440 from melex750/dev-insect-from-egg
Fix saving/loading programs for insects from AlienEgg
2021-12-04 10:04:49 +01:00
Mateusz Przybył 96fece4e6d
Merge pull request #1464 from nipsufn/master
fix SatCom content offset on screens with high resolution / small font size
2021-12-04 10:01:53 +01:00
Tomasz Kapuściński 9139239f9f Merge branch 'dev' into dev-graphics-overhaul
# Conflicts:
#	src/app/app.cpp
#	src/graphics/opengl/gl14device.cpp
#	src/graphics/opengl/gl14device.h
#	src/graphics/opengl/gl21device.cpp
#	src/graphics/opengl/gl21device.h
2021-12-01 17:27:54 +01:00
Tomasz Kapuściński 57502d2f54 Added object renderer (WIP)
Rewritten shadow rendering logic
Split some shaders into smaller parts
Shadow renderer now has its own framebuffer object
2021-12-01 17:05:20 +01:00
Tomasz Kapuściński ce71f25901 Removed unused shader files 2021-10-25 21:42:19 +02:00
Tomasz Kapuściński fea6b87139 Added fog to terrain renderer and renamed variables 2021-10-17 16:27:29 +02:00
Tomasz Kapuściński 4157604458 Added shadow renderer and removed rendering modes 2021-10-17 16:05:20 +02:00
nipsufn 117c72ba72 fix SatCom content offset on high resolution / small font size 2021-09-29 15:26:19 +02:00
Tomasz Kapuściński 79d4cd9060 Updated TerrainRenderer
* Engine will now use it to render terrain
* Added directional light source
* Added dynamic shadows
* Moved visibility computation to CEngine
* Removed uniform buffers
2021-09-19 20:08:31 +02:00
Mateusz Przybył 1438438937
Merge pull request #1462 from colobot/dev-update-license
Update license headers
2021-09-11 16:10:44 +02:00
MrSimbax 80f074e2ba Update license headers 2021-09-11 15:53:59 +02:00
MrSimbax 171bba1bcd Rewrite the update license script
The old script duplicated license headers for me, instead of
updating them.
2021-09-11 15:53:50 +02:00
Mateusz Przybył 95579bbf1d
Merge pull request #1461 from colobot/AbigailBuccaneer-platform-independent
Merge PR#1141 "Use C++11 threading and timing constructs"
2021-09-11 14:23:09 +02:00
MrSimbax c9dca4cebd Rename SystemDialogType::ERROR to ERROR_MSG
Unfortunately, the ERROR name collides with
a preprocessor definition in windows.h
2021-09-11 13:40:22 +02:00
MrSimbax 6aa83c93ac Update data submodule 2021-09-11 13:29:03 +02:00
MrSimbax a69b88e09a Move time related functions out of CSystemUtils
GetCurrentTimeStamp() has not been moved because of
CApplication unit tests.
2021-09-11 13:26:38 +02:00