69 Commits

Author SHA1 Message Date
yvt
4aef2bbef8 Play hit sounds only once per attack
Fixes #925.
2020-12-17 00:59:09 +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
7b3d6bf28d
Change the return type of HotTrackedPlayer 2019-07-17 11:11:52 +09:00
yvt
9735d5855e
Change the return type of GetLocalClientPlayer 2019-07-17 11:05:21 +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
a9561991c3
Add savemap console command 2019-07-14 22:29:15 +09:00
yvt
d6f5370581
Add the console window (WIP) 2019-07-14 01:38:28 +09:00
yvt
b02ad53109 Add View::RunFrameLate
`IRenderer::{FrameDone, Flip}` are now called in `RunFrameLate` instead.
This makes it possible to create a `View` wrapping another `View` to
insert a new 2D drawing pass, which is necessary to render the system
console.
2019-07-14 00:29:36 +09:00
yvt
cf2ecb4342
Apply temporal smoothing on the progress bar 2019-05-19 17:20:50 +09: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
30e49b68aa Implement thread-local random number generator 2018-09-18 22:18:54 +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
NotAFile
4ea1e50ae0 Add Counter for world updates per Second (#707)
* Add Counter for world updates per Second

This work was just done for personal testing and is probably not up to the
required code standards. Nonetheless, I have decided to send a PR as it is very
useful information and a good starting point.

* add MarkWorldUpdate method
2018-01-06 19:38:14 +09:00
yvt
336d476e8d Attempt to enable follow cam when no one's there no longer leaves you in an invalid state 2017-12-29 20:34:31 +09:00
yvt
2f5a21be1e Prevent a dead player from being first-person spectated
Fixes #679.
2017-12-29 20:15:23 +09:00
yvt
4bd819adcd Fix spectator display and keyboard input
- Fixes #681 (Pressing space while in free-camera mode does not move up).
- Fixes #678 (Have seconday fire cycle through the player list backwards
  in sepctator mode).
- "Stop following a player" is bound to "R" (reload) by default.
- Add help messages displayed on the screen.
2017-12-29 20:06:49 +09:00
yvt
842d34c92f Display more HUD elements in the first-person spectate mode
Fixes #682.
2017-12-29 19:21:44 +09:00
yvt
ff2b6587a1 Display MapView in the free floating camera spectating mode
Fixes #682 partially.
2017-12-29 19:06:45 +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
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
a853a58631 Remove corpses after respawn on a certain game mode
Fixes #145.
2017-09-03 16:56:01 +09:00
yvt
a7b9909b2e Refactoring 2017-01-05 03:03:39 +09:00
yvt
d505bfae91 Expose “FontManager” to the scripting environment 2016-12-16 05:05:23 +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
L0L022
8dc0a1de1b Add mumble support 2016-08-03 17:08:45 +02:00
Bridger Maskrey
70f15430cd Server Disconnect Screen
Sources/Client/Client.cpp:
  + Added call to Client::DrawDisconnectScreen() in client destructor

Sources/Client/Client.h:
  + Added new prototype Client::DrawDisconnectScreen()

Sources/Client/Client_Draw.cpp:
  + Added function declaration for Client::DrawDisconnectScreen()
  * New Localization Introduced: "Client":"Disconnecting..."

Resources/de/openspades.po:
  + Added rudimentary German translation for "Client":"Disconnecting..."

Resources/ja/openspades.po:
  + Added rudimentary Japanese translation for "Client":"Disconnecting..."

Resources/ko/openspades.po:
  + Added rudimentary Korean translation for "Client":"Disconnecting..."

Resources/pl_PL/pl_PL:
  + Added rudimentary Polish translation for "Client":"Disconnecting..."

Resources/pot/openspades.pot:
  + Added translation entry for "Client":"Disconnecting..."

Resources/ru/openspades.po:
  + Added rudimentary Russian translation for "Client":"Disconnecting..."
2016-01-09 21:42:44 -05:00
yvt
40f8be07c0 Realistic camera focal control mode
Set `cg_manualFocus` to `1` to use it. By default, mouse wheel adjusts the focal length, and pressing mouse wheel button enables auto-focus.
2015-06-20 17:10:26 +09:00
Way, No
a637e177e3 added first person view 2014-12-17 01:17:03 +10:00
yvt
817ce53c23 Statistics (fix #202) 2014-03-31 23:09:47 +09:00
yvt
fee4b486b6 #168 2014-03-13 01:44:58 +09:00
yvt
b3491e1a2b Water bullet impact 2014-03-12 03:38:45 +09:00
yvt
a57213d5d3 Merge remote-tracking branch 'origin/master' 2014-03-11 04:09:07 +09:00
yvt
cf8d4f3cb0 Alerts 2014-03-11 03:42:04 +09:00
Marco Schlumpp
bd875188f4 Fixed compilation with GCC/clang on Linux.
They don't like it, when an unique_ptr contains an incomplete type.
2014-03-09 19:13:21 +01:00
yvt
2599d14900 Refactor 2014-03-09 21:43:38 +09:00
yvt
49944fab9a Fixed #155 2014-03-08 00:23:26 +09:00
yvt
ee2a90acf3 absolute mouse input support 2014-02-01 21:55:30 +09:00
yvt
cac296a21d Hit indicator 2013-12-16 23:27:14 +09:00
yvt
ab9ebacaef Merge branch 'master' of https://github.com/yvt/openspades 2013-12-09 17:36:35 +09:00
yvt
87aedb702c Moved to SDL 2.0 + IME support 2013-12-09 17:36:05 +09:00
yvt
132b379862 Fixed a problem that reloading sometimes fails on 0.76 server 2013-12-09 03:27:06 +09:00
yvt
81c33addb3 Scripted chat window 2013-12-02 19:42:38 +09:00
yvt
df4e32a684 In-game menu 2013-11-27 16:30:54 +09:00
yvt
a83039ec16 Added main screen (not implemented) 2013-11-22 22:50:14 +09:00
yvt
d6088eeac2 Saving map 2013-11-22 19:34:20 +09:00