262 Commits

Author SHA1 Message Date
yvt
93cccdecf9
Add View::AutocompleteCommandName 2019-07-14 18:29:50 +09:00
yvt
6b415aa7d4
Redirect SPLog to the console window 2019-07-14 16:02:07 +09:00
David Carlier
6ef18bd0cd Little code changes proposal.
Modern C++ stricter with member initialisation order.
Destructor possibly throwing exception through assertions.
In debug mode, pretty important memory leak with zip archives.
2019-05-26 07:18:39 +01:00
yvt
4e9370e8b4
Fix forgetting to unlock a recursive_mutex before deleting 2019-05-26 00:55:54 +09:00
yvt
c910bd4846
Remove Mutex, replacing their uses with std::{mutex, recursive_mutex} 2019-05-25 15:00:32 +09:00
yvt
76908188ab
Fix indentation 2019-05-25 14:32:52 +09:00
yvt
5e0cb27a4d
Add VoxelModelLoader
This new loader allows additional transformation on voxel models, e.g.,
setting a new origin point and replacing the material ID of all voxels,
based on a metadata file placed next to KV6 files.
2019-05-25 14:29:14 +09:00
yvt
6a39343daa
Introduce the concept of voxel material ID 2019-05-25 13:19:48 +09:00
yvt
a17a8f7b16
Fix to build with GCC 4.9 2019-05-19 17:14:51 +09:00
yvt
97ed5d46ad
Fix several small issues
- `GameMapLoader` did not start the decoding thread.
- `StreamHandle::operator=` caused SEGV for null handles.
- `PipeReader` prematurely stopped outputting data.
2019-05-19 16:13:21 +09:00
yvt
1a2287201d
Add GameMapLoader 2019-05-19 15:51:40 +09:00
yvt
10fc7da79d
Add StreamHandle::operator bool 2019-05-19 14:53:32 +09:00
yvt
a8b50e9a69
Add CreatePipeStream 2019-05-19 14:41:54 +09:00
yvt
40037ecb34 Add RandomAccessAdaptor::Prefetch 2019-05-19 13:12:16 +09:00
yvt
1997fec9a6 Add SPADES_MARK_FUNCTION to RandomAccessAdaptor 2019-05-19 13:09:55 +09:00
yvt
c4caf4c630 Add RandomAccessAdaptor::Read 2019-05-19 13:08:38 +09:00
yvt
894d8fbec4 Add SPADES_MARK_FUNCTION to RandomAccessAdaptor 2019-05-19 13:05:32 +09:00
yvt
024c8aa7ce Fix "memcpy is not a member of std" 2019-05-19 01:08:51 +09:00
yvt
b9426fd438 Add RandomAccessAdapter
It will be used to aid the implementation of the improved map loader.
2019-05-19 00:58:32 +09:00
yvt
6426247f09 Use C++11 atomics in place of AngelScript's implementation
AngelScript's implementation uses now-deprecated `OSAtomicIncrement32`
and generates compiler warnings.
2018-12-31 21:57:11 +09:00
yvt
3cd581260a Fix a bug causing the program not to start
This bug was introduced in ac4799abafbeb1d44d1b7166913406cd3a46b560.

This bug apparently only affected MSVC since the evaluation order of function
call parameters respect to other parameters is unspecified by the C++
specification.

Fixes #785.
2018-10-31 16:16:51 +09:00
yvt
c50906d16b Fix to build with GCC 4.9 2018-10-27 18:19:38 +09:00
yvt
ea0088ddd4 Explicitly delete a reference to SDL surface when a window is closed
This issue was identified by #775. (Hopefully) fixes #779.
2018-10-13 16:09:15 +09:00
yvt
6a6e771478 Add utilities and static checks to Handle 2018-10-13 16:07:24 +09:00
yvt
5dd26e3ce0 Use SPUnreachable() in place of SPAssert(false) 2018-10-13 16:07:04 +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
49f0bbe6f4
Merge pull request #774 from yvt/patch-rng
Improve/fix random number generation
2018-10-08 14:39:38 +09:00
yvt
5e03526fe4 Fix to compile with MSVC 2017 2018-10-08 14:35:10 +09:00
yvt
888253a691 Remove an unnecessary constructor of stmp::optional 2018-10-08 01:22:29 +09:00
yvt
5376c1c0c4 Get rid of the non-standard typeof operator 2018-09-18 22:33:48 +09:00
yvt
30e49b68aa Implement thread-local random number generator 2018-09-18 22:18:54 +09:00
yvt
6982134ed7 Fix to build with GCC 4.9 2018-09-17 23:57:35 +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
5948ef1a2a Exclude unknown configs in the in-game config editor
Fixes #693.
2017-12-30 21:02:36 +09:00
yvt
4b4e8ec217 Eliminate an undefined behavior 2017-12-30 20:44:57 +09:00
yvt
f702eca1d8 Fix crash on server connection 2017-12-30 04:28:50 +09:00
yvt
36fa59fe01 Refactor MainScreenHelper
- Rename methods to follow the general naming convention
- Use glorious lambdas in place of a 😱functor😱
- Make other minor modifications
- Use a smart pointer
- clang-format
- Remove an unused variable
- Remove redundant copies
- Use atomics in place of a heavy-weight mutex
2017-12-22 22:00:52 +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
David Carlier
3c5016dc6c On OpenBSD SDL_GetBasePath is not really implemented
due to lack of kernel support of exe self-retrieval.
2017-10-14 15:56:36 +01:00
yvt
ca892698e3 Minor fixes
- Remove unnecessary `volatile`
- Replace some operations with atomic ones for soundness
- Clean up
- Avoid certain UBs
- Typo
2017-06-25 21:15:27 +09:00
yvt
8d02ce3d36 Oops 2017-03-23 15:35:04 +09:00
yvt
fbab073f03 Implement safer TLS deinitialization 2017-03-23 15:34:32 +09:00
yvt
0267df0463 Implement safer dispatch queue deletion
Fixes #604.
2017-03-22 13:24:27 +09:00
David Carlier
657f765542 Fixing few memory leaks + fixing pthread symbol missing 2017-03-04 11:18:12 +00:00
yvt
cd6ec61f80 (Hopefully) fixes the issue #368 2017-03-04 16:33:21 +09:00
yvt
aaa3bc2656 Fix #582 2017-03-04 03:32:14 +09:00
yvt
cf1404c8ae Regenerate block’s health after a certain period of time
Fixes #148
2017-02-20 03:30:10 +09:00
yvt
a6bb4ac7e2 Support the enhanced variant of Version Get/Send packet
Fixes #561.
2017-02-11 16:24:53 +09:00
yvt
7272c067a7 Automatic update check
Fixes #526.
2017-01-30 01:02:40 +09:00