55 Commits

Author SHA1 Message Date
yvt
70feb0870b feat(client): revamp the flashlight 2021-06-20 16:13:02 +09:00
yvt
3bda029e34 feat(client): remove the lens flare effect of the flashlight
It had caused severe banding when HDR is enabled.
2021-06-20 16:13:02 +09:00
yvt
8ac141daf4 feat(draw): support linear lights 2021-06-20 16:11:39 +09:00
yvt
b1022213f3 Merge branch 'master' into patch-modernize 2021-05-02 23:39:03 +09:00
dtomlinson-ga
4ce8546df8 Fix typo in Player::GetVelocity()
Corrected GetVelocty() to GetVelocity() everywhere it occurs.
2019-11-28 22:10:38 +09:00
yvt
d1ba2a729b
Fix to build with GCC 4.9
> error: invalid use of incomplete type ‘class spades::Bitmap’
2019-07-23 22:55:02 +09:00
yvt
b9a5d80f7b
Use Handle::New to construct T <: RefCountedObject
Unless `T::T(Args...)` is inaccessible from `Handle::New`, in which case
`Handle::Handle{new T(args...), false}` should be used.
2019-07-20 17:01:04 +09:00
yvt
b4dcec2e1c
Use make_unique to construct unique_ptr 2019-07-20 16:34:35 +09:00
yvt
60fd3191c5
Remove Handle::operator T*(), discouraging conversion to raw pointers
It was replaced by `Handle::GetPointerOrNull()`. Every use of
`GetPointerOrNull` should be reviewed. Some of them were already removed.
2019-07-20 15:47:42 +09:00
yvt
e6227b3361
Update IRenderer for null safety and safe memory management 2019-07-20 13:48:49 +09:00
yvt
5db97f7f10
clang-format 2019-07-17 00:31:22 +09:00
yvt
7c3a39e639
Modernize
- Replaced raw pointers with references or smart pointers. Nullable
  references are represented by `stmp::optional<const T&>`. (There are
  many raw pointers still remaining. They should be replaced at some
  point.)
- Added class template specializations `stmp::optional<T &>` and
  `stmp::optional<const T&>`.
- Fixed `stmp::optional`'s various behaviors
- `World::{players, playerPersistents}` are now `std::array`.
- More uses of `stmp::optional` to clarify the semantics
- Renamed `PlayerThrownGrenade` to `PlayerThrewGrenade`
- Replaced old-style `for` loops with range based ones
- Deleted `Player`'s default constructors and `operator =`
- Deleted `TCGameMode`'s default constructor and `operator =`
- Deleted `CTFGameMode`'s default constructor and `operator =`
- Replaced `static_cast` with `dynamic_cast` for down-casting
- `RefCountedObject::operator*()` no longer requires non-constness to
  return `T &`.
- Replaced the uses of `std::vector::operator[]` with `std::vector::at`
  for bounds checking.
- Made some methods of `GameMap` `const`.
- Added some null checks.
2019-07-17 00:31:00 +09:00
yvt
b10c943eed
Harden the model custom color check 2019-05-25 12:18:32 +09:00
yvt
ac6bc01617 Make the movement of the flashlight non-rigid
Like the one in Metro 2033. Should have no negative effect on gameplay.
2019-05-05 23:32:57 +09:00
yvt
157219eb45 Remove a redundant include 2019-05-05 23:30:24 +09:00
NotAFile
2ecd3ced44 detect end of map transfer with state packet
Previously, the end of map transfer was detected by a number of fallible
heuristics, including checking if the map is loadable on every non-map
packet, when a timeout had been reached, or the map size given by the
server was reached. This broke in a number of scenarios, including when
an unexpected packet was sent.

Instead, we now detect the end of the map transfer when we receive a
state packet, as intended by the protocol.
2019-05-04 20:14:42 +02:00
yvt
585cbfce1c Improve random number generation
The global RNG state is now protected from simultaneous accesses by
employing a mutex.

Performance sensitive code requiring generation of a large number of
random numbers can utilize `LocalRNG`. This is not thread-safe but
provides a much greater throughput. `LocalRNG` is seeded by the global
RNG only at construction time.
2018-09-17 23:48:38 +09:00
Davi
358800f260 Flashlight fixes: dead players and spectators may no longer toggle the flashlight, spectating other players while dead will keep your flashlight off 2018-07-15 16:07:34 -03:00
yvt
842d34c92f Display more HUD elements in the first-person spectate mode
Fixes #682.
2017-12-29 19:21:44 +09:00
yvt
660066fc2f Rewrite the camera control logic
- Fixes #664
- Fixes #520
2017-12-05 15:42:24 +09:00
David Carlier
4864f07937 Reducing some compilation warnings. 2017-11-18 21:15:07 +00:00
NotAFile
266d141e04 First person enhancements (#656)
* only switch first-person mode while spectating

closes #655

* use first person view for first-person spectating

* don't spectate specators; refactor
2017-09-17 14:15:06 +09:00
yvt
6f0955349e Add unsupported options (cg_viewWeaponX, cg_viewWeaponY, cg_viewWeaponZ)
Fixes #591.
2017-03-04 03:44:57 +09:00
yvt
8e8f2a8772 (Hopefully) fixes #577 2017-02-25 21:19:19 +09:00
yvt
2ad5074d9c Rename SetSoundAmbience to SetSoundEnvironment 2017-01-07 03:55:39 +09:00
yvt
7ceada702f Make environmental audio switchable 2017-01-07 01:38:56 +09:00
yvt
5e7050a4aa Make audio environment estimation more temporally stable 2017-01-07 01:36:45 +09:00
yvt
7a14c39911 Enhancement to weapon sound effects 2017-01-06 04:01:10 +09:00
yvt
2554eaad57 Refactor, add more checks 2017-01-05 04:11:42 +09:00
yvt
2ecbd554b4 Support Ogg Opus audio files (.opus) on macOS 2016-12-18 00:45:17 +09:00
yvt
2046afd660 Fix #487 2016-12-17 22:19:54 +09:00
Tomoaki Kawada
2eb9e35c65 Apply clang-format to all non-external source files 2016-12-03 18:23:47 +09:00
YVT
478a4460e8 Merge pull request #460 from VelocityRa/master
Use better random generator.
2016-11-23 19:36:33 +09:00
VelocityRa
30d133ce31 Use better random generator 2016-11-22 23:08:35 +02:00
Tomoaki Kawada
4d964d6595 Add more camera shake (cg_shake 2) and additional movements of view weapons 2016-11-22 01:25:22 +09:00
Tomoaki Kawada
18f3e81fd1 Convert space indentations to tabs 2016-11-20 19:13:00 +09:00
Tomoaki Kawada
5e3b41b8ed Provide more game experience options
- Fixes #448. (Setting `cg_animations` to `0` disables the ADS animation)
2016-11-20 18:13:49 +09:00
Tomoaki Kawada
6a7af96daf Refactor setting variables 2016-11-19 21:27:13 +09:00
Tomoaki Kawada
3f7fcee586 Reorganise resource files 2016-07-16 00:14:59 +09:00
yvt
f75d9083ec Merge remote-tracking branch 'origin/master' 2015-01-24 12:45:16 +09:00
yvt
7072e15b63 Mask write to configs from certain scripts 2015-01-24 12:44:57 +09:00
Tomoaki KAWADA
aff4c995ee fixed to compile 2015-01-23 18:43:53 +09:00
yvt
66627a4de2 Support for third person view and so on. 2015-01-23 18:26:00 +09:00
yvt
11a6e9d802 Update sounds 2014-03-22 01:37:14 +09:00
yvt
11ce8f027d Added user-defined constructors to Vector2, Vector3, Vector4, IntVector3, Matrix4 whilst keeping them POD by using defaulted constructors 2014-03-08 20:48:09 +09:00
yvt
ca88537a6b Created new renderer method which works like SetColor but only accepts an alpha pre-multiplied color value, deprecating the badly-behaved SetColor method 2013-12-09 01:00:09 +09:00
learn_more
1a42e828de ModeType instead of dynamic_cast for gamemodes (dynamic_cast is slowwww) 2013-12-07 16:58:39 +01:00
learn_more
7bc571f819 size_t instead of int (cannot have negative number of players :)
cleanup some formatting (more readable)
2013-11-22 23:09:16 +01:00
yvt
891252c6b8 Reduced weapon movement 2013-11-17 22:48:16 +09:00
learn_more
2a24e662cd helper function for weapon scripts (less duplicate code)
cleanup some register code
angelscript exceptions have a stacktrace now
optimize some networking code (only create packet when a packet is gonna be sent, instead of every frame
2013-11-03 17:13:49 +01:00