43 Commits

Author SHA1 Message Date
yvt
6e262ea6ec
Add stmp::make_unique
This template function is a polyfill of `std::make_unique`, which is
unavailable in GCC 4.9 (should we even be supporting this old thing?).
2019-07-20 16:17:10 +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
9735d5855e
Change the return type of GetLocalClientPlayer 2019-07-17 11:05:21 +09:00
yvt
980b484c32
Instantly wrap Corpse with std::unique_ptr after construction
Note: IIRC `make_unique` isn't supported by some of the targeted
compilers.
2019-07-17 10:49:33 +09:00
yvt
f742420187
Replace raw pointers in CorpseUpdateDispatch with references 2019-07-17 10:46:32 +09:00
yvt
3916a39713
Replace raw pointers in Corpse::Corpse with references 2019-07-17 10:43:25 +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
2fddc13024 Eliminate compiler warnings
- Possible misuse of comma operators
- `std::move` prevents copy elision
2018-12-31 21:34:30 +09:00
Jipok
d25cf1bb91
Show shotgun tracers 2018-12-09 21:09:28 +05:00
yvt
cfb972f944 Improve code quality
- Overriding methods are clearly indicated with `override` keywords
- Remove redundant `virtual` keywords from destructors of subclasses
- Introduce `SPUnsupported()`, replacing most uses of
  `SPNotImplemented()`, which now serves as a dynamic "TODO" marker
2018-10-13 14:43:49 +09: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
yvt
660066fc2f Rewrite the camera control logic
- Fixes #664
- Fixes #520
2017-12-05 15:42:24 +09:00
yvt
8c38843485 Do not display block placement cursor when unable to place blocks
Fixes #660.
2017-12-05 12:46:34 +09:00
YVT
e93ea55e3f Adjust the gain of hit feedback sound (#659)
Fixes #652.

The sound gain is now constant and does not change regardless of the
distance. This imitates the behavior often seen in other first-person
shooters.

Switching from "Play" to "PlayLocal" only affects the way the gain is
computed since "HeadshotFeedback.opus" is a stereo sound file and there-
fore not spatialized by any known audio backends.

This also introduces a config variable named "cg_hitFeedbackSoundGain"
that allows users to adjust the volume of the hit feedback sound.
2017-09-17 14:15:20 +09:00
Teodor
0cb053c15d Add a headshot bang sound like in classic (#648)
* Add satisfying headshot bangs like in classic

* add whack sound

* Update Client_Update.cpp

* Add files via upload

* Moved to Resources/Sounds/Feedback

* Play only if inflicted by LocalPlayer

Also lowered volume

* Update AUTHORS

* Update Credits.inc
2017-09-05 18:27:05 +09:00
yvt
64d7362228 Update kill feed message in the chat log file 2017-02-11 20:24:05 +09:00
yvt
f52f840256 Add translator comments 2017-02-11 16:38:24 +09:00
yvt
812a30b9e2 Fix #539
This is a quick fix; the spectator system might need to be refactored or reworked
2017-02-10 00:01:21 +09:00
yvt
93ed881449 Redesign HUDs 2017-01-09 22:56:55 +09:00
yvt
8349b4c9d8 Tracers on MapView
Fixes #139.
2017-01-09 05:00:05 +09:00
yvt
97247057b2 Fix #242 2017-01-04 23:27:50 +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
6a7af96daf Refactor setting variables 2016-11-19 21:27:13 +09:00
Chameleonhider
83b061fedf Makes local kills on killfeed black
Turns icons of local kills (both for kill and death) black. Black colour
stands out the most. Useful after having disabled center messages.
2016-02-10 20:02:43 +02:00
Chameleonhider
e0d2f0b762 Configure-able center message
Center message takes up too much space on smaller screens (e.g. mine is
800x600), especially on killstreaks or intense CTF servers. So, you can
either disable all center messages ("0"), enable all default ones ("1")
or disable your kill center messages("2").

To make killfeed easier to read it is advised to make local kill icons
be black (stands out the most).
2016-02-10 19:34:09 +02:00
yvt
359619aa65 Fix ghost bullets #365 2015-06-14 04:05:51 +09:00
yvt
420d4154ae Fixed #215 (I’ve been thinking this can be thought as a feature, but newbie might get confused) 2014-03-25 20:41:09 +09:00
yvt
c3ee0fb0ca bug fix: running footstep is no longer played in the water 2014-03-22 21:41:16 +09:00
yvt
11a6e9d802 Update sounds 2014-03-22 01:37:14 +09:00
yvt
fee4b486b6 #168 2014-03-13 01:44:58 +09:00
yvt
25b8a2f53d More wade SFXs 2014-03-12 04:04:07 +09:00
yvt
b3491e1a2b Water bullet impact 2014-03-12 03:38:45 +09:00
yvt
1df0115860 update text 2014-03-12 00:12:11 +09:00
yvt
ce2fe9ff27 Vibration on spade hit 2014-03-11 03:54:01 +09:00
yvt
a553cb1ea4 Capturing sky color 2014-03-11 03:46:14 +09:00
yvt
cf8d4f3cb0 Alerts 2014-03-11 03:42:04 +09:00
yvt
2599d14900 Refactor 2014-03-09 21:43:38 +09:00