262 Commits

Author SHA1 Message Date
David Carlier
40b128abcc solaris based systems port.
V-Sync operation unsupported by the driver and pretty rudimentary grep.
mostly linkage fixes otherwise.
2022-02-13 08:56:24 +00:00
yvt
d7d467e709
Merge pull request #996 from devnexen/dflybsd_port
DragonFly BSD identification
2022-02-12 08:34:14 -08:00
David Carlier
d51217e5e1 dragonflybsd identification. 2022-02-12 16:23:23 +00:00
David Carlier
9c992c6e7d checking xsave/oxsave and AVX with xgetbv instruction 2022-02-01 20:05:13 +00:00
David Carlier
454d3e2ec7 cpu AVX check: check (OS)XSAVE as well. 2022-01-13 19:49:21 +00:00
yvt
fdba89bc14 doc(core): VoxelModel::GetOrigin is a misnomer 2021-08-15 00:54:09 +09:00
yvt
a35dab4e61 fix(core): handle the cases where start is inside correctly in OBB3::RayCast 2021-06-20 16:11:29 +09:00
yvt
690520040e feat(core): implement Line3::{Project, GetDistanceTo} 2021-06-20 16:11:26 +09:00
yvt
a70ed62a63 fix(core): OBB3::RayCast now uses a consistent origin for hitPos for all cases 2021-06-20 16:11:24 +09:00
yvt
b1022213f3 Merge branch 'master' into patch-modernize 2021-05-02 23:39:03 +09:00
yvt
e4e38d85c0 fix(core): remove the exception specification of IStream::~IStream
The exception specification isn't really useful.

Fixes build failure on Windows + MSVC.
2021-04-10 12:09:01 +09:00
yvt
4d078e7376
Merge pull request #924 from yvt/patch-vcpkg
Adopt vcpkg and streamline the build process
2020-12-18 22:15:55 +09:00
David Carlier
191124ddb7 Haiku support. 2020-07-28 19:03:50 +00:00
yvt
8a98e3d186 Fix the incorrect arrangement of preprocessor directives 2020-06-08 13:02:52 +09:00
David Carlier
eb6d59c946 Little fix proposal for i386 arch.
needs to preserv ebx for the i386 architecture with PIC builds.
2020-06-06 13:50:07 +01:00
David Carlier
393865b750 Recognises NetBSD too 2020-04-05 13:54:53 +01:00
yvt
bd1ea7feb5
Get vcpkg-based build working on macOS
Use the following command:

    cmake -G Ninja .. -D CMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake
2020-02-16 17:34:46 +09:00
yvt
3b15a205ff Replace Deque with std::deque
Profiling indicated that a little time (< 10% of `ApplyBlockActions`'s
total execution time) is spent on `Deque` when a large chunk of block
is being removed. Thus even *if* this commit slows down things, the
performance impact would be insignificant.
2019-07-24 19:11:36 +09:00
yvt
403b0a5e7f
Make Function::Function constexpr to allow static initialization
`Function` is constructed for every `SPADES_MARK_FUNCTION`, so this
drastically reduces the number of constructor calls at startup.
2019-07-23 22:46:37 +09:00
yvt
f841c94db7
Change the return type of CreatePipeStream to use unique_ptr 2019-07-23 22:28:56 +09:00
yvt
da7e61b25c
Change std::regex static local variables to global
Removes the runtime cost caused by lazy initialization.
2019-07-23 22:25:12 +09:00
yvt
4e566cc671
Update CP437
- Replace `std::map` with `std::unordered_map`
- clang-format
- Delete `CP437`'s default copy constructor instead of hiding it
- Move the internal declarations to an anonymous namespace
2019-07-23 22:20:19 +09:00
yvt
701105f916
Change the return type of file opening functions to std::unique_ptr<_>
This also fixes a memory leak in `MainScreenHelper::SaveFavorites`.
2019-07-23 22:14:10 +09:00
yvt
5fe8b0fe18 Remove StreamHandle
It was functionally identical to `std::shared_ptr<IStream>`.
2019-07-23 21:57:40 +09:00
yvt
a2257a6fb7
Change the return type of VoxelModeLoader::Load to Handle<_> 2019-07-23 21:42:21 +09:00
yvt
eabb77fcce
Update VoxelModel
- Use `unique_ptr` instead of manually memory management
- All of its methods now perform bounds checking in release builds. The
  exception is `*Unchecked` methods.
- Use an anonymous namespace for local definitions in `VoxelModel.cpp`
- `VoxelModel::LoadKV6` methods now returns `Handle<_>` and accepts
  `IStream &`.
- Delete the copy constructor and assignment operator
- Remove debug code
2019-07-23 21:39:56 +09:00
yvt
af2aa09eba
Delete Semaphore(const Semaphore &), etc. 2019-07-23 20:01:01 +09:00
yvt
90cbdee54a
Remove the deprecated exception specifications (func() throw(Type)) 2019-07-23 19:52:34 +09:00
yvt
b48c5f489f
Use range-based for loops 2019-07-23 19:36:08 +09:00
yvt
a2eff8fda5
Update Bitmap
- Added doc comments to all of its methods.
- `Bitmap::Load` methods now returns `Handle<Bitmap>`.
- `Bitmap::Load(IStream *)` now accepts `IStream &`.
- `Bitmap::{GetPixel, SetPixel}` now perform bounds checking in release
  builds.
2019-07-23 19:31:24 +09:00
yvt
92a4b2466f
Rename DirectoryFileSystem::{physicalPath → PathToPhysical} 2019-07-20 17:19:34 +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
830db57c01
Require rvalue for Handle::Unmanage 2019-07-20 16:38:21 +09:00
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
6517338dab
Delete RefCountedObject's copy constructor 2019-07-20 14:18:48 +09:00
yvt
e6227b3361
Update IRenderer for null safety and safe memory management 2019-07-20 13:48:49 +09:00
yvt
464b88a23b
Fix optional::operator= 2019-07-20 13:42:34 +09:00
yvt
9e770cc040
Update the rules for RefCountedObject 2019-07-20 13:25:35 +09:00
yvt
a44a900c62
Fix Handle::Handle(T&) 2019-07-20 12:36:11 +09:00
yvt
8cdb086bb1
Add implicit casts between Handle<T> and stmp::optional<T &> 2019-07-20 12:26:44 +09:00
yvt
9038c7e135
Update the rules for RefCountedObject 2019-07-20 12:25:58 +09:00
yvt
fae85af23d
Make stmp::optional::operator= behave more like std::optional
This means the inner type's `operator=` is used whenever possible,
instead of using `T::T(const T&)` or `T::T(T&&)` all the time.
2019-07-18 16:12:44 +09:00
yvt
5f7dde6a96
Update and clarify the rules for RefCountedObject 2019-07-18 15:54:40 +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
3c90eedfb8 Add Handle::operator== 2019-07-16 01:18:26 +09:00
yvt
07cdbf9d1d
Add some functions related to stmp::optional 2019-07-16 01:18:09 +09:00
yvt
008c687e83
Raise the buffer size limit of BoundedLogBuffer 2019-07-14 23:22:20 +09:00
yvt
e4efc8b5fc
Autocomplete config variables 2019-07-14 19:15:30 +09:00