Commit Graph

2723 Commits (80f074e2bae2ee0108d47b478f98d95e046aaeec)

Author SHA1 Message Date
MrSimbax ad33e0e624 Fix 'code block placement' linter issues 2020-04-07 20:05:32 +02:00
MrSimbax f09768fb2d Fix 'undefined function' linter issue 2020-04-07 19:13:30 +02:00
Fiftytwo 9db6bb63e4 Merge branch 'dev' of https://github.com/colobot/colobot into dev 2020-04-07 19:10:32 +02:00
MrSimbax 87fec23f4b Fix 'class naming' linter issues 2020-04-07 18:59:46 +02:00
Fiftytwo e5d994b9e2 Merge branch 'dev' of https://github.com/colobot/colobot into dev 2020-04-07 14:46:43 +02:00
Fiftytwo ddab760624 Add rollert.png to OldModelManager 2020-04-07 14:35:59 +02:00
Fiftytwo 0c69dc8d30 Make Ants and Spiders able to destroy TargetBot 2020-04-05 16:05:57 +02:00
MrSimbax 621453a01c Make all relative paths use base dir 2020-04-05 13:24:45 +02:00
MrSimbax 3fbfadb0d4 Merge branch 'dev' into dev-basedir 2020-04-03 21:12:48 +02:00
MrSimbax 8f122d6603 Fix MSVC compilation (again) 2020-04-03 20:18:14 +02:00
MrSimbax d4b2f23c4a Add handling of env variables 2020-04-03 20:15:24 +02:00
Fiftytwo b5466261d4 Make buildings inherit trainer param from builder 2020-03-31 19:02:53 +02:00
Fiftytwo 0d6218bfa0 Fix trainer Builder segfault 2020-03-31 16:57:45 +02:00
suve fc2bd68876 Fix missing std includes 2020-02-09 00:36:05 +01:00
Fiftytwo 853d8eee5d Adjust HeavyTrainer rear light sprite position 2020-01-11 18:39:44 +01:00
Fiftytwo 5bf6f12ae5 Add HeavyTrainer texture recoloring 2020-01-11 17:04:40 +01:00
tomangelo 51cde3c868
Merge branch 'dev' into dev-savegame 2020-01-02 15:00:33 +01:00
tomangelo b8c4232312
Merge pull request #1262 from B-CE/i18n-fr2
Update i18n fr
2020-01-02 14:42:15 +01:00
Martin Doucha 69aba7c352 Fix OpenGL 3.3 specular lighting 2019-12-29 14:46:39 +01:00
Martin Doucha 0d30624119 Fix OpenGL 2.1 specular lighting 2019-12-29 14:46:39 +01:00
tomangelo 8648de9581
Merge pull request #1278 from pkubaj/patch-1
Fix build on ARM and PPC
2019-12-28 22:33:04 +01:00
tomangelo 587e189e97
Merge pull request #1250 from colobot/dev-compilation-fix
Fixes compilation problem
2019-12-28 20:52:36 +01:00
pkubaj 1a771b0e72
Fix build on ARM and PPC
ARM and PPC use unsigned char by default.
2019-10-18 14:00:37 +02:00
MrSimbax 61a7aa2592 Fix minor memory leak 2019-08-07 09:51:27 +02:00
MrSimbax 2d3d03cc38 Use SDL_GetBasePath() instead of physfs because it's buggy in old version 2019-08-07 09:51:27 +02:00
MrSimbax 41379ded7e Use workdir paths on dev builds 2019-08-07 09:51:27 +02:00
MrSimbax 5cefa57dd5 Use base dir instead of working dir for data files 2019-08-07 09:51:27 +02:00
DavivaD 50c3c45ef8 Show only local mods on the list 2019-07-27 17:58:12 +02:00
DavivaD 7d30a82747 Move platform-dependent code to system_*.cpp 2019-07-27 16:59:51 +02:00
DavivaD cd140f1384 Move mod loading/unloading stuff to a new class + fix some derps 2019-07-27 03:36:03 +02:00
DavivaD 190e04fdd7 Move PT_FRAGV to the end of the pyro_type.h list + Undo reordering 2019-07-26 17:33:04 +02:00
DavivaD 9c2ea5f488 Undo some changes + space fixes 2019-07-22 17:04:15 +02:00
DavivaD b8b2d32bc1 Thumper Patch 2019-07-22 01:15:11 +02:00
Fiftytwo 62620a93cd Make Wrecks destroyable; make TargetBot more fragile 2019-07-17 02:57:47 +02:00
Fiftytwo ed8dc04d94 Make TargetBot explode in water 2019-07-05 16:03:29 +02:00
B-CE 17d85eb434 Translate french comments + correct typo 2019-06-19 08:50:47 +02:00
melex750 17d0d2abb1
Fix compiling literal numbers 2019-05-12 08:33:53 -04:00
Tim Göttlicher e9a153df14 Smoother shadows on OpenGL 2.1 2019-04-28 01:27:12 +02:00
melex750 5f089f4a9b Fix and improve switch...case (#1008) 2019-04-11 05:34:00 -04:00
melex750 1058a326ad Add binary and character literals in CBOT 2019-04-11 05:14:11 -04:00
melex750 bc572aa52f Add sizeof() operator for numeric data types 2019-04-11 04:21:22 -04:00
melex750 c0cdd84e85 Add missing primitive data types in CBOT 2019-04-11 04:19:29 -04:00
melex750 250ea57e8b Fix arithmetic operations with integers (#993)
Also fixed unsigned right shift operator ">>>"
2019-04-11 04:15:27 -04:00
melex750 a66b3d0672 Refactor SaveState and RestoreState to use streams 2019-04-11 04:13:13 -04:00
fernape 44083053ce Add FreeBSD support.
Add a new PLATFORM_FREEBSD variable. We can compile like MacOS with just an
extra linker flag.
2019-03-09 19:04:00 +01:00
Tomasz Kapuściński 16a1dc7b9d Removed unnecessary dependency on libwebp which causes compilation problems with static builds. 2019-03-04 21:40:59 +01:00
MrSimbax 0eb31a1f45 Fix PORTABLE_SAVES flag not working 2019-02-23 13:12:37 +01:00
tomangelo2 a46750ede2 Fix crash when destroying unpowered PowerPlant with Titanium
Appendix to pull #1206
2019-02-18 14:43:56 +01:00
tomangelo2 0f6e1d7d4a Style fix 2019-02-18 14:43:56 +01:00
tomangelo bc3fbd21d0
Merge pull request #1231 from colobot/dev-issue-1128
Potential fix for issue #1128
2019-02-07 01:12:10 +01:00
tomangelo b50a71bde4
Merge pull request #1239 from suve/use-sizeof-in-ModelOutput-WriteOldModel
Tweak strncpy() usage in ModelOutput::WriteOldModel
2019-02-07 01:11:55 +01:00
suve 086e07168d Use sizeof() instead of magic number for strncpy in ModelOutput::WriteOldModel 2019-02-02 18:53:36 +01:00
tomangelo 02fd258697
Merge pull request #1206 from iceslab/dev
Fixes for #1203 and #1194
2019-01-29 20:31:57 +01:00
tomangelo 04b8bf6c42
Merge pull request #1235 from vkuzkokov/master
Put pitch and roll in [-180,180) range.
2019-01-29 20:31:37 +01:00
Vladislav Kuzkokov e3f53dc203 Put pitch and roll in [-180,180) range.
Reasonable values lie close to either side of 0.
2019-01-06 07:09:57 +01:00
tomangelo2 be97167994 Potential fix for issue #1128 2019-01-02 01:18:45 +01:00
tomangelo2 92d2de5325 Fixed VSync options list
Now VSync list is aligned for same height as resolution list from the bottom, as it's very hard to align them from top on different screen resolutions.
2019-01-02 00:34:34 +01:00
tomangelo 9cf89db8af
Merge pull request #1213 from ananace/fix-xdg
Fix Linux savegame path issue, closes #1212
2018-12-23 16:43:59 +01:00
Fiftytwo 723c552783 Add Heavy and Amphibious trainer bots 2018-12-23 07:04:06 +01:00
Mateusz Przybył d57c45cbb2
Merge pull request #1211 from suve/limit-game-speeds
Add a minimum & maximum game speed limit
2018-12-22 15:49:53 +01:00
Mateusz Przybył 3db153f964
Merge pull request #1202 from colobot/dev-restext
Add a note mentioned in issue #1197
2018-12-22 15:17:28 +01:00
suve 508e7529d2 Use Math::Clamp() when limiting game speed 2018-11-27 19:25:56 +01:00
Alexander Olofsson d11404a6e9
Fix Linux savegame path issue, closes #1212 2018-11-25 14:49:01 +01:00
suve 4305f8de03 Add a minimum & maximum game speed limit 2018-11-18 21:09:11 +01:00
Bartosz Cieśla 7c88a6e667 Fix for #1194 2018-10-13 10:12:41 +02:00
Bartosz Cieśla abf1a60a86 Fix for #1203 2018-10-10 19:14:23 +02:00
tomangelo 3f6e84b418
Merge pull request #1167 from badernageral/dev
Translation to Brazilian Portuguese
2018-09-08 22:03:28 +02:00
tomangelo 9aa3773752
Merge pull request #1199 from CHmSID/fix-more-warnings
Fix another GCC 8.2.0 warning
2018-09-08 22:01:01 +02:00
tomangelo a76bbe49ed
Merge pull request #1189 from colobot/dev-msvc
Add some Visual Studio specific fixes
2018-09-08 22:00:47 +02:00
tomangelo aed74321cb
Merge pull request #1115 from B-CE/dev-tabMgt
fix #274 : pasting tabs
2018-09-08 22:00:18 +02:00
tomangelo2 ee0b46a278 Add a note mentioned in issue #1197 2018-08-21 21:28:45 +02:00
tomangelo 31b309fa24
Merge pull request #1186 from colobot/dev-switch-case
Fix switch case documentation shortcut
2018-08-21 12:16:41 +02:00
tomangelo 7d46ee762a
Merge pull request #1181 from colobot/dev-vsync
Add VSync switch to Device tab
2018-08-21 12:16:03 +02:00
Jerzy B 6f0a294048 Give space for a null character in texture name 2018-08-18 09:11:46 +01:00
Jerzy B f3b30625ee Fix GCC 8 warning about sprintf overflow (#1192) 2018-08-12 07:49:45 +02:00
DavivaD e823c209fa Fix crash while loading mod and blank settings menu while paused game 2018-08-02 17:21:31 +02:00
DavivaD 1b47cf76d3 Implement Mod Manager 2018-08-02 07:38:32 +02:00
MrSimbax 7e19622b85 Allow both F11 and F12 for stats 2018-07-25 23:45:15 +02:00
MrSimbax cb701cacb8 Add a workaround for failed assertion in VS debugger
Assertion failed: ploc->_Mbcurmax == 1 || ploc->_Mbcurmax == 2

Apparently MS C/C++ library doesn't support UTF-8 locales, which causes the assertion to fail. My solution is to ignore the system locale and try to set the classic one.

LibreOffice seems to have this problem fixed in less simple way: https://gerrit.libreoffice.org/#/c/54110/
2018-07-25 21:44:31 +02:00
MrSimbax 32d3d1eb92 Change key for debug menu to F10 and for stats to F11
F12 is used by Visual Studio debugger to trigger a breakpoint and apparently it cannot be changed:

"The F12 key is reserved for use by the debugger at all times, so it should not be registered as a hot key. Even when you are not debugging an application, F12 is reserved in case a kernel-mode debugger or a just-in-time debugger is resident."
Source: https://msdn.microsoft.com/en-us/library/windows/desktop/ms646309.aspx?f=255&MSPPError=-2147217396
2018-07-25 21:38:47 +02:00
MrSimbax f93fd61c26 Rename OFFICIAL_BUILD to OFFICIAL_COLOBOT_BUILD
In order to avoid conflict with OFFICIAL_BUILD variable inside ntverp.h. It caused compilation error "invalid integer expression"

https://github.com/tpn/winsdk-10/blob/master/Include/10.0.10240.0/shared/ntverp.h#L134
2018-07-25 21:34:39 +02:00
tomangelo 5080cb46b1
Merge pull request #1031 from tomangelo2/dev
Added fonts configurability by a separate file
2018-07-25 19:51:55 +02:00
tomangelo2 3383532752 Changed font_config to font_loader
Apparently linter doesn't like files with `config` in its name
2018-07-25 00:44:06 +02:00
tomangelo2 d84be03a83 Removed non-existing font from code
Forgot to check build on clean data directory
2018-07-23 14:10:27 +02:00
tomangelo2 df46bcfe2d Fix another linter warning 2018-07-23 14:03:59 +02:00
tomangelo2 14b6f7cafa Fixed some linter warnings in font_config files 2018-07-23 12:46:47 +02:00
tomangelo d90592f7b6
Merge pull request #1162 from AbigailBuccaneer/gl-cleanup
Clean up and improve CGLxxDevice code
2018-07-23 12:15:08 +02:00
tomangelo 5041aa377d
Merge pull request #1156 from AbigailBuccaneer/redundant-shadowmap-renderbuffer
Don't create a color renderbuffer for shadow map
2018-07-23 12:14:45 +02:00
tomangelo2 fb00898035 Fix switch case documentation shortcut
Also some polishing of loops help texts
2018-07-21 00:09:37 +02:00
Fiftytwo 3f04654cd3 Make ruins destroyable 2018-07-13 13:16:30 +02:00
Fiftytwo 5b2b632de3 Add TargetBot research; make it fully operational 2018-07-13 00:03:20 +02:00
Fiftytwo 5b2f3111b6 Add trainer=1 SpaceShip 2018-07-12 20:54:58 +02:00
Fiftytwo 146581e44c Add trainer=1 AutoLab 2018-07-12 20:35:50 +02:00
Fiftytwo 02eb4623b9 Add trainer=1 ResearchCenter 2018-07-12 20:17:09 +02:00
Fiftytwo d0e29d4875 Add trainer=1 BotFactory 2018-07-12 19:55:31 +02:00
tomangelo2 4bfada2ad6 Better handling of VSync errors 2018-07-05 21:18:14 +02:00
tomangelo2 608d59f07b Moved VSync setting from Experimental to Setup 2018-07-05 20:56:38 +02:00
tomangelo2 359abf9a82 Add VSync switch to Device tab 2018-07-05 19:43:56 +02:00
Mateusz Przybył abb7d54ef5 Add support for VS CMake/vcpkg compilation (#1174)
* Add support for VS CMake/vcpkg compilation

* Fix system_windows.cpp compilation

* Add optimization and hidden console to MSVC release builds
2018-06-04 09:17:51 +02:00
José Robson Mariano Alves 0c16d9a272 Translation to Brazilian Portuguese 2018-05-16 10:22:57 -03:00
krzys-h 073191d1ea Small CPathManager refactoring 2018-05-16 13:28:06 +02:00
José Robson Mariano Alves dbd1f601da Translation to Brazilian Portuguese 2018-05-15 18:31:41 -03:00
José Robson Mariano Alves 2b933264fc Translation to Brazilian Portuguese 2018-05-15 16:07:03 -03:00
krzys-h f538b4f477 What did I say about commiting in a hurry 2018-05-10 11:32:33 +02:00
krzys-h 12cf57409c Support more buttonX.png files in other places than just buttons 2018-05-10 11:24:59 +02:00
krzys-h 05bc65a90b Add support for more buttonsX.png textures (for modders) 2018-05-10 11:12:45 +02:00
krzys-h 8095dc14f7 Add support for custom button= for View cameras 2018-05-10 11:12:22 +02:00
krzys-h ed397d2b0f Make sure aliens hatched from eggs are not selectable by default, closes #1054 2018-05-09 23:25:52 +02:00
krzys-h 319d8e6854 Fix delete() not returning sometimes, closes #1067 2018-05-09 23:12:26 +02:00
AbigailBuccaneer e481905a25 Do less state setting in gl14 and gl21 2018-05-09 21:03:08 +01:00
AbigailBuccaneer c9a8a242a0 Remove CGL14Device's support for display lists
Closes #1153.
2018-05-09 21:03:08 +01:00
AbigailBuccaneer f8ebc6ec21 Remove code for drawing dynamic vertex formats
It's unused, and it's a bad idea - it's important for authoring tools
and for performance that vertex formats are well-defined instead of
dynamically created.
2018-05-09 21:03:08 +01:00
AbigailBuccaneer 94b30c00a0 Remove code duplication in CGLxxDevice 2018-05-09 21:03:08 +01:00
krzys-h 10fc47476b Fix code style 2018-05-09 18:34:27 +02:00
krzys-h 85772376fa Merge ScoreboardSortType with main Scoreboard command 2018-05-09 18:33:27 +02:00
krzys-h 1ed3f4b215 Add EndMissionTeams immediateWin=true; make the teams on win screen sorted 2018-05-09 18:28:25 +02:00
AbigailBuccaneer c027b54add Don't create a color renderbuffer for shadow map
When rendering the shadow map offscreen using framebuffer objects, it's
not necessary to create a color renderbuffer. Currently
FramebufferParams only lets you choose between a renderbuffer and a
texture for both color and depth attachments. This changes that, and now
you can ask for a texture, a renderbuffer, or nothing.

This improves performance. On my computer, with an 8192x8192 shadow map,
this improves overall frame time by 8.0%.
2018-05-09 17:25:52 +01:00
krzys-h abe489e294 Add EndMissionTimeout 2018-05-09 17:47:21 +02:00
krzys-h a3def6d683 Disallow firendly fire in ScoreboardKillRule 2018-05-08 23:57:13 +02:00
krzys-h 0baf9f8077 Don't commit code in a hurry like that... 2018-05-08 23:47:50 +02:00
krzys-h f03c3dbc10 Implement ScoreboardObjectRule 2018-05-08 23:44:23 +02:00
krzys-h dd40c4d4ee Make magnifyDamage=0 for fragile objects actually work
This fixes a bug in 36d2cf14b8
2018-05-08 19:54:25 +02:00
krzys-h db72a36315 Fix code style 2018-05-08 19:44:24 +02:00
Fiftytwo caf58c8ab8 Merge branch 'dev' of https://github.com/colobot/colobot into dev 2018-05-07 21:48:48 +02:00
krzys_h 5283865a5c
Merge pull request #1136 from colobot/dev-cbot-optimizations
Some CBot code optimizations
2018-05-07 20:53:52 +02:00
krzys_h 182c4c5cbf
Merge pull request #1154 from AbigailBuccaneer/shadow-shimmering
Fix shadow shimmering
2018-05-07 20:53:28 +02:00
krzys_h a54f65f71b
Merge pull request #1152 from AbigailBuccaneer/consistent-shadow-antialiasing
Improve shadow quality and performance in gl33
2018-05-07 20:53:21 +02:00
krzys_h 50ed675acd
Merge pull request #1150 from AbigailBuccaneer/debug-rendering
Add generic debug rendering functions
2018-05-07 20:53:12 +02:00
krzys_h f146d2885b
Merge pull request #1149 from AbigailBuccaneer/tighter-visibility-checking
Improve object visibility culling with tighter bounding spheres
2018-05-07 20:53:00 +02:00
krzys_h 44f2684c70
Merge pull request #1148 from AbigailBuccaneer/text-batching
Improve text rendering performance
2018-05-07 20:52:50 +02:00
krzys-h 6e273e7e33 Declare CBotVar::m_token as const 2018-05-07 20:51:44 +02:00
krzys_h 05fe7431c4
Merge pull request #1143 from AbigailBuccaneer/fix/1087-positional-sounds
Fix global sounds being positioned at camera
2018-05-07 20:43:03 +02:00
krzys_h b36d40a509
Merge pull request #1151 from melex750/dev-savegame
Fix saving/loading "NewScript" programs for factory bots
2018-05-07 20:42:51 +02:00
krzys_h b9e2edce6c
Merge pull request #1146 from colobot/dev-scene-camera
Implement viewpoint feature
2018-05-07 20:42:18 +02:00
krzys_h 35640b8e3f
Merge branch 'dev' into dev-scoreboard-sort 2018-05-07 20:41:40 +02:00
krzys-h 36d2cf14b8 Make magnifyDamage influence fragile objects 2018-05-07 20:31:36 +02:00
krzys-h 1d09ee9b3c Fix transportable object damage rules
This makes the rules match the original Colobot like they were supposed to
2018-05-07 20:31:36 +02:00
krzys-h 6ccf32ec68 fixup! Fix code style in #1150 2018-05-07 20:28:31 +02:00
AbigailBuccaneer abeb7fceb2 Fix shadow shimmering
Shadow shimmering is a visual artefact where the outlines of shadow
mapped objects don't stay stable when the camera is moved or rotated.
The reason is that as the shadow map's origin moves, the objects
rendered to the shadow map have temporal aliasing around their edges.

The solution is to only move the shadow map in texel-sized increments.
Because the shadow map's projection is orthographic, moving the shadow
map origin in texel increments ensures that objects that aren't moving
don't show any temporal aliasing, as the position of the samples of the
object in worldspace stay the same.
2018-05-04 10:56:37 +01:00
AbigailBuccaneer 0d6fffd91f Improve shadow quality and performance in gl33
If CONFIG_QUALITY_SHADOWS is defined (which it always is) then the
fragment shader code that samples the shadow map will take five samples
in a cross shape around the point to be sampled, to apply antialiasing.

Currently, the offset of these samples is hardcoded to 0.00025× the
shadow map resolution. This is very inconsistent: if the shadow map
resolution is 128×128, then these samples are 0.032 texels apart, which
is a waste of four texture samples, and essentially means that no
antialiasing is applied. If the shadow map resolution is 8192×8192, then
these samples are 2.048 texels apart, which causes visual artefacts
around shadow edges, instead of giving smoother shadows.

The correct thing to do is to always sample exactly one texel away from
the original position. This is easy in GLSL 3.30, as it includes a
textureOffset function which offsets a texture fetch by an exact number
of texels. This is faster than manually calculating an offset ourselves,
it fixes visual artefacts at high resolutions, and it properly applies
antialiasing at low resolutions.
2018-05-02 16:30:45 +01:00
krzys-h 38a34829af Fix code style in #1150 2018-05-01 21:27:49 +02:00
melex750 a918fcabb4 Fix save/load NewScript programs for factory bots
Fixes #797
2018-04-30 13:43:03 -04:00
AbigailBuccaneer 6f6cfb136a Batch draw calls from CText to improve performance
This significantly speeds up text rendering. On my computer, looking at
the program editor with a full screen of text, this commit takes the
framerate from under 30 to 60 (hitting vsync).

Performance could be further improved in the gl33 renderer by using
instancing or glPrimitiveRestartIndex instead of glMultiDrawArrays, but
that would be a more invasive change.

All of the interface rendering could use a unified quad batching system,
instead of it being limited to CText, but that would require some
refactoring in CText as it currently draws using a different coordinate
space to the rest of the interface.

Fixes #1104.
2018-04-30 10:18:51 +01:00
AbigailBuccaneer c445d7d9a9 Add generic debug rendering functions
Currently the engine can draw debug spheres to show crash sphere
positions. This extends this to draw arbitrary spheres and cuboids,
transformed arbitrarily. With these in place it's now very quick and
easy to create a debug visualisation - for example, it's a one-line code
change to render the bounding box or sphere of every EngineObject.
2018-04-29 23:41:53 +01:00
AbigailBuccaneer 282a793a13 Improve object vis with tighter bounding spheres
This commit improves rendering performance by doing a better job of
checking whether an object is visible via its bounding sphere or not.

The engine maintains a bounding box for each EngineBaseObject that's
exactly large enough to fit every vertex. From this, it computes a
bounding sphere, and only draws objects if the sphere is within the view
frustum. Previously, the bounding sphere was always centered on the
EngineBaseObject's origin, even for models where the bounding box center
is significantly offset from the origin. Now, the bounding sphere is
always the tightest sphere which fits the bounding box.
2018-04-29 19:35:02 +01:00
AbigailBuccaneer c49c815ea5 Set uniforms less often during text rendering
We now call SetWindowCoordinates and SetInterfaceCoordinates once per
string, rather than once or twice per character.
2018-04-27 10:43:26 +01:00
krzys_h db90fcd2ef
Merge pull request #1118 from nextghost/dev
Czech translation
2018-04-24 14:17:23 +02:00
krzys_h 64ab5e3308
Merge pull request #1053 from colobot/dev-a-thing
added a thing
2018-04-24 14:13:42 +02:00
krzys_h 8b86a1f222
Merge pull request #1142 from AbigailBuccaneer/Wmissing-declarations
Compile with -Wmissing-declarations
2018-04-24 14:12:43 +02:00
krzys_h 6289ea91b1
Merge pull request #1140 from AbigailBuccaneer/Wsuggest-override
Compile with -Wsuggest-override under GCC
2018-04-24 14:12:31 +02:00
krzys_h 289b6577d5
Merge pull request #1139 from AbigailBuccaneer/clang-7
Fix building under clang-7
2018-04-24 14:12:15 +02:00
AbigailBuccaneer 4bca2b2243 Fix global sounds being positioned at camera
Certain sounds - such as those coming from the UI - aren't supposed to
sound as if they're coming from a given position. This is currently
accomplished by positioning the OpenAL source at the camera position.
This works, but if the camera position drastically moves during the
sound being played then it's possible to hear the sound fade out.

This pull request makes camera movement no longer affect global sounds,
by specifying their position as being (0, 0, 0) relative to the listener
position.

The easiest way to test this is to start a mission, press E to grab when
there's nothing in front of you, and scroll the mouse wheel quickly.
Pressing E will show the nothing-to-grab message which plays a beep
sound, and scrolling will quickly move the camera. Prior to this pull
request, the sound will fade, after this pull request it won't.

Fixes #1087.
2018-04-24 11:43:11 +01:00
tomangelo2 5e8be5f6bc Better align of viewpoint UI 2018-04-23 08:12:33 +02:00
AbigailBuccaneer ea64edaa0b Compile with -Wmissing-declarations
-Wmissing-declarations enforces that every function (except for static
functions) must be declared separately before it's defined. This
essentially enforces that every function must be either static, or
declared in a header elsewhere.

This helps the optimizer, as it can do a better job of inlining if it
knows that a function won't be used outside of a given file. It also
helps -Wunused-function (which is enabled by -Wall) find more unused
functions.

Note that Clang spells this option -Wmissing-prototypes, which
confusingly is the name of a related but different warning option under
GCC.
2018-04-21 16:49:27 +01:00
AbigailBuccaneer 4119e669d1 Remove central tracking of SystemTimeStamp
SystemTimeStamp used to be an opaque class, as it was provided by
`system_{linux/other/windows}.h`. Because of this, code dealt in
SystemTimeStamp pointers, and getting the current timestamp required a
memory allocation. Now SystemTimeStamp is just a
`std::chrono::time_point`, we can make the code cleaner and faster by
just directly keeping SystemTimeStamp instead of pointers around.
2018-04-20 09:57:10 +01:00
AbigailBuccaneer 285350464f Remove platform-specific handling of times
Now all platforms use std::chrono::high_resolution_clock and
std::this_thread::sleep_for instead of platform-specific timestamp and
sleep methods.
2018-04-20 09:56:57 +01:00
AbigailBuccaneer 2a003a27b1 Use C++11 threads, mutexes and condition variables 2018-04-20 09:56:57 +01:00
krzys-h e964d3e48c Fix colobot-lint warnings 2018-04-20 02:21:12 +02:00
krzys-h 1c2bdc9cab Update license headers 2018-04-20 02:08:50 +02:00
krzys-h 9f1bd2176f Jenkinsfile: Run colobot-lint 2018-04-20 02:08:50 +02:00
AbigailBuccaneer 6978c28ee0 Compile with -Wsuggest-override under GCC
Clang by default compiles with -Winconsistent-missing-override, which
warns when a class declares virtual functions that override those in the
base class, and some but not all of them are explicitly declared
`override`.

GCC doesn't support this option, but has a stronger version,
-Wsuggest-override. In combination with -Werror, this means that any
virtual function that overrides another *must* be explicitly declared as
`override`.

This commit enables -Wsuggest-override where available. This means that
GCC users can't break the Clang build with inconsistent overrides (see
 #1113 and #1114) and consequently that any build that passes the pull
request CI build on Jenkins won't break because of inconsistent
overrides.
2018-04-19 19:58:44 +01:00
AbigailBuccaneer 5cec29f4e6 Fix building under clang-7
Currently the build fails because of -Wdelete-non-virtual-dtor warnings.
This catches when an object is destructed, has a non-virtual destructor,
and is an abstract base class or a non-final class with virtual
functions. The warning happens inside unique_ptr<T>::~unique_ptr.

The warning is to prevent somebody writing code like this:

    class MySceneEndCondition : public CSceneEndCondition {
        ~MySceneEndCondition() { /* some complex logic */ }
    };
    // this won't call MySceneEndCondition's destructor, potentially
    // leading to leaks or segfaults:
    std::unique_ptr<CSceneEndCondition> p{new MySceneEndCondition()};
2018-04-19 10:19:05 +01:00
tomangelo2 2f71cce9c9 Fix camera behaviour when switching to viewpoint 2018-04-15 00:06:04 +02:00
tomangelo2 b04d8d205b Added viewpoints feature
This allows you to set fixed viewpoints in specific location, without attaching to any object, enabling you to track the game from any location.
Proper camera handling will be implemented in next commits.
2018-04-11 21:24:20 +02:00
tomangelo2 ad6dd00275 Change new functions return type and switch to enum class
As suggested by @krzys_h
2018-04-08 23:43:22 +02:00
krzys-h 477dc0cae7 Some CBot code optimizations 2018-04-06 15:02:06 +02:00
B-CE da1b7e8c2d Fixes #274 : pasting tabs 2018-03-12 12:58:43 +01:00
B-CE 0e6d22a549 Fix clang compilation, fixes #1113 2018-03-12 12:42:22 +01:00
tomangelo2 d371338920 Fix scoreboard sorting parameters 2018-03-11 17:00:17 +01:00
tomangelo2 1b79e8409f Add switch to determine sort type
You can set it in scene file with ScoreboardSortType SortBy="Name" or "Points"
2018-03-07 21:25:35 +01:00
tomangelo2 ff0f22ef44 Sort scoreboard
First, the team with more points, then which team scored points faster
2018-03-07 15:46:30 +01:00
Martin Doucha 81b4d0e28b Add Czech translation 2018-02-24 20:39:29 +01:00
tomangelo2 5e606336ca Fixed TrackedTrainer tracks allignement 2018-02-12 15:11:14 +01:00
tomangelo2 f51f457023 Narrowed TrackedTrainer tracks
TrackedTrainers now have same width as other bots
2018-02-10 20:58:14 +01:00
Fiftytwo bd0c6d4344 Add PracticeBot helpfile 2017-12-22 17:02:37 +01:00
Fiftytwo a15b3e4dd4 Add Trainer icons 2017-12-22 16:51:25 +01:00
Fiftytwo 0fddd79501 Add PracticeBot alias detection in search() and detect() 2017-12-21 14:44:43 +01:00
Fiftytwo ca0ff013d4 Update Trainer bots 2017-12-21 01:49:56 +01:00
Fiftytwo 94aa76e7a1 Add auto object detection for takeoff, destroy, camerafocus 2017-11-30 20:41:44 +01:00
Fiftytwo e01a6bd0ef Add Builder documentation 2017-11-30 08:00:17 +01:00
Fiftytwo 7eb1df4119 Add aim recalibration during falling 2017-11-29 13:24:05 +01:00
Fiftytwo db23c6eecf Change Builder default camera type 2017-11-25 14:35:45 +01:00
Fiftytwo 5f8b7a8149 Update BotFactory interface 2017-11-25 12:30:16 +01:00
Fiftytwo e8b93f6cda Add Builder interface 2017-11-25 03:09:47 +01:00
Fiftytwo 614dc5e591 Builder research 2017-11-23 00:11:29 +01:00
krzys-h 7f6c0cd31e added a thing 2017-11-22 18:29:09 +01:00
Fiftytwo 03c7d2e7ee WingedBuilder full implementation; new aiming method, better particle alignment 2017-11-22 02:05:36 +01:00
Fiftytwo d06116eb49 Attached proper particles to the neutron gun 2017-11-21 19:09:38 +01:00
Fiftytwo b72e802ff7 Neutron gun now aims 2017-11-17 19:57:08 +01:00
Mateusz Przybył 46bef8fd92
Add button4.png drawing (builder icons) 2017-11-17 18:59:14 +01:00
Fiftytwo 0b36bdf37f Quick fix for 9a33551 since I broke sth 2017-11-17 12:00:49 +01:00
Fiftytwo 9a33551a03 Reverted factory() to its original design; reworked syntax of other object.functions() accordingly; improved compatibility with CeeBot4 SCHOOL 2017-11-17 11:32:50 +01:00
Fiftytwo b04d8ca99d Clean up redundant files 2017-11-16 20:32:10 +01:00
Fiftytwo a024866fd3 Builder bots base implementation 2017-11-16 18:43:45 +01:00
tomangelo2 f01e2b7e01 Moved fonts maps from header file to source file 2017-11-07 19:29:51 +01:00
krzys-h 5f5e5234fc Fix CEdit background margins, closes #1029
This mismatch happened after changes in 08d87fa975
2017-11-04 11:56:15 +01:00
krzys_h d3b969fb4d
Merge pull request #992 from DavivaD/dev-dmgalarm-st2
Damage Alarm Implementation (2th Stage)
2017-11-04 11:27:14 +01:00
krzys_h 17d47e9b63
Merge pull request #1040 from melex750/dev
Saved game bug fix
2017-11-04 11:24:09 +01:00
krzys-h 387b7b5396 Fix non-scoreboard code battles, closes #1023 2017-11-04 11:23:17 +01:00
tomangelo2 0179e4c786 Cleaned unused values from CFontConfig 2017-10-28 22:24:11 +02:00