1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 20:29:57 +00:00
Commit graph

5393 commits

Author SHA1 Message Date
elsid
8e71c246bf
Remove redundant BulletShape getters 2021-10-30 03:44:08 +02:00
elsid
fc9a405dc5
Make BulletShape::makeInstance free function 2021-10-30 03:44:08 +02:00
elsid
b905dd17c3
Use unique_ptr to store btCollisionShape in BulletShape 2021-10-30 03:44:07 +02:00
elsid
80e3623d9a
Avoid dynamic cast in duplicateCollisionShape 2021-10-30 03:43:48 +02:00
elsid
ca8584f6f6
Move functions independent from BulletShape into anonymous namespace 2021-10-30 03:43:38 +02:00
elsid
29a772c33f
Rename Resource::BulletShape::CollisionBox fields according to styleguide 2021-10-29 21:05:58 +02:00
psi29a
b189282ba1 Merge branch 'compile_no_evil' into 'master'
Remove dead code

See merge request OpenMW/openmw!1327
2021-10-29 12:51:20 +00:00
psi29a
34b63bf142 Merge branch 'omwscripts' into 'master'
Change format of "*.omwscripts" files

See merge request OpenMW/openmw!1271
2021-10-29 12:49:49 +00:00
Evil Eye
9b565c4cf9 Remove dead code 2021-10-28 22:16:43 +02:00
psi29a
b3f84df43c Merge branch 'sky_shaders' into 'master'
Sky shaders

See merge request OpenMW/openmw!1057
2021-10-27 20:25:40 +00:00
Petr Mikheev
47c89567fb Load LuaScriptsCfg from both *.omwscripts and *.omwaddon files. 2021-10-26 21:52:42 +02:00
Petr Mikheev
4ec7f0625e Store Lua timers in std::map rather than in sol::table. 2021-10-26 21:32:48 +02:00
Petr Mikheev
9adc190209 Redesign LuaUtil::ScriptsContainer to work with ScriptsConfiguration 2021-10-26 21:32:48 +02:00
Petr Mikheev
33d71be81f Add LuaUtil::ScriptsConfiguration 2021-10-26 21:32:02 +02:00
Petr Mikheev
6aab246879 Add ESM records that are needed to store Lua scripts configuration;
Use ptr.getType() (i.e. esm record names) instead of typeid(ptr.getClass()) in apps/openmw/mwlua.
2021-10-26 21:32:02 +02:00
psi29a
3006c496fc Merge branch 'morrowland_scripting' into 'master'
Morrowland scripting

Closes #6363

See merge request OpenMW/openmw!1318
2021-10-26 10:07:45 +00:00
psi29a
2765bcee5e Merge branch 'serialization' into 'master'
Add helpers for binary serialization

See merge request OpenMW/openmw!1319
2021-10-26 08:25:17 +00:00
glassmancody.info
07e32c0fa6 remove object shader path 2021-10-25 10:23:16 -07:00
Bret Curtis
3d0da9b9b2
Merge pull request #3191 from akortunov/warnfix
Fix some MSVC warnings
2021-10-25 15:17:05 +02:00
Bret Curtis
ac02753da7
Merge pull request #3190 from akortunov/master
Fix showscenegraph warnings
2021-10-25 12:59:36 +02:00
Bo Svensson
1ff8318a52
refactors premultiplied alpha (#3189)
With this PR we refactor a `premultiplied alpha` user string set by `characterpreview.cpp` into a more flexible mechanism allowing us to assign any state to GUI textures. We can consider these changes more future proof than the previous approach.
2021-10-25 09:28:32 +02:00
Bo Svensson
7f9beac3a7
refactors a case insensitive map (#3184)
This PR aims to spark the retirement of a questionable pattern I have found all over our code base. I will illustrate how this pattern encourages code duplication, lacks type safety, requires documentation and can be prone to bugs.
```
std::map<std::string, Object> mMap; // Stored in all lowercase for a case-insensitive lookup

std::string lowerKey = Misc::StringUtils::lowerCase(key);
mMap.emplace(lowerKey, object);

std::string lowerKey = Misc::StringUtils::lowerCase(key);
mMap.find(lowerKey);

mMap.find(key); // Not found. Oops!
```
An alternative approach produces no such issues.
```
std::unordered_map<std::string, Object, Misc::StringUtils::CiHash, Misc::StringUtils::CiEqual> mMap;

mMap.emplace(key, object);

mMap.find(key);
```
Of course, such an alternative will work for a `map` as well, but an `unordered_map` is generally preferable over a `map` with these changes because we have moved `lowerCase` into the comparison operator. 

In this PR I have refactored `Animation::mNodeMap` accordingly. I have reviewed and adapted all direct and indirect usage of `Animation::mNodeMap` to ensure we do not change behaviour with this PR.
2021-10-25 09:18:26 +02:00
Evil Eye
fef902617a Parse integer format arguments as variable names 2021-10-24 17:23:15 +02:00
Andrei Kortunov
0f3c0cb0a0 Fix argument types mismatch 2021-10-24 18:45:46 +04:00
Andrei Kortunov
107a9ecb17 Fix variables hiding 2021-10-24 18:45:04 +04:00
elsid
a58f1a94e3
Add helpers for binary serialization
To construct serializer from given entities:
* Data source/destination - any value that has to be serialized/deserialized,
  usually already existing type.
* Format - functional object to define high level serialization logic to
  define specific format and data schema. Like order of fields, allocation.
* Visitor - functional object to define low level serialization logic to
  operator on given data part.
  * BinaryWriter - copies given value into provided buffer.
  * BinaryReader - copies value into given destination from provided buffer.
  * SizeAccumulator - calculates required buffer size for given data.
2021-10-24 14:20:44 +02:00
Andrei Kortunov
566380c0d6 Fix showscenegraph warnings 2021-10-24 12:37:49 +04:00
glassmancody.info
1e40d27318 introduce sky shaders 2021-10-23 17:53:38 -07:00
Bo Svensson
41318a585f
fixes enable and disable commands (#3186)
This PR fixes a recent regression concerning enable and disable commands with object paging. In addition, we add a necessary comment to avoid such issues in the future.
2021-10-23 12:40:26 +02:00
Evil Eye
31aa19574b Make PositionCell take additional junk arguments 2021-10-23 11:47:42 +02:00
Evil Eye
dfb6bdf77e Allow integer variable names 2021-10-23 11:47:35 +02:00
Bo Svensson
c9c8d02332
fixes a crash (#3183)
This PR fixes a crash caused by the improperly ensured lifetime of RigGeometry::mSourceGeometry. mSourceGeometry was not adequate to ensure mSourceGeometry would outlive mGeometry because we extend mGeometrys lifetime beyond this lifetime by passing mGeometry to the draw traversal instead of this.
In addition,

We add important comments.
We detect and prevent generally unsafe operations in high level code.
We add a sprinkling of const to help clarify intentions.
2021-10-23 10:31:46 +02:00
Fanael Linithien
07d505563e Remove non-existent file from CMakeLists 2021-10-23 01:38:32 +02:00
psi29a
1ffa02b2fd Merge branch 'fix_windows_tests' into 'master'
Fix tests on windows

See merge request OpenMW/openmw!1313
2021-10-22 12:35:10 +00:00
psi29a
ed811176bc Merge branch 'fix_esm_loader' into 'master'
Fix logic expression for not found value in EsmLoader::getModel

See merge request OpenMW/openmw!1308
2021-10-22 12:33:39 +00:00
elsid
b5f0057ac9
Fix tests on windows 2021-10-21 19:48:31 +02:00
Bo Svensson
a854a6e04a
removes UnrefQueue (#3181)
Currently, we use an `UnrefQueue` which supposedly aims to transfer destruction costs to another thread. The implications of this unusual pattern can not be well understood because some allocators might free resources more efficiently if they are freed by the same thread that allocated them. In addition, `UnrefQueue` complicates the validation of thread safety in our engine. Lastly, our current usage of `UnrefQueue` triggers `ref()`, `unref()` atomic operations as objects are passed into the queue. These operations could be more expensive than the actual destruction.

With this PR we thus remove `UnrefQueue`. We can expect these changes to have a minor impact at most because we free most resources elsewhere in `ResourceSystem::updateCache`.
2021-10-20 23:02:15 +02:00
elsid
a3b6bc7263
Fix logic expression for not found value 2021-10-20 17:48:10 +02:00
elsid
06ea47f74b
Fix crash in DetourNavigator::fixupCorridor
Handle situation when resulting path does not fit into destination vector.
2021-10-19 22:54:46 +02:00
elsid
e5413c0664
Add functions to compress/decompress vector of bytes 2021-10-18 20:46:22 +02:00
elsid
bb26ba30b6
Add progress reporter type
To log/report progress of long duration operations using given time period.
2021-10-18 01:26:10 +02:00
psi29a
d8d16a52e1 Merge branch 'esm_loader' into 'master'
Add ESM data loader

See merge request OpenMW/openmw!1301
2021-10-17 19:21:32 +00:00
elsid
046b5f83ee
Add ESM data loader
A component to load ESM content files with limited support for record types and
selection which of them to load. Supported record types are:
ACTI, CELL, CONT, DOOR, GMST, LAND, STAT.
2021-10-17 19:55:29 +02:00
elsid
18d3102148
Do not use union to access FIXED_STRING<4> as int
https://en.cppreference.com/w/cpp/language/union:
> It's undefined behavior to read from the member of the union that wasn't most recently written.
2021-10-17 17:16:21 +02:00
psi29a
62dfbb33d9 Merge branch 'fix_find_path_crash' into 'master'
Fix crash in finding path over navmesh (#6338)

Closes #6338

See merge request OpenMW/openmw!1296
2021-10-17 12:15:14 +00:00
Bo Svensson
01605433cb
quadtreeworld.cpp (#3174)
Currently, we disable a paging root node that we only need in exterior cells by setting its node mask to 0 when transitioning into an interior cell. Node masks are not ideal for this usage case because Node::getBound is unaware of masks. With this PR we just detach the unused node from the scene graph. _shadowedScene->getBound() in the MWShadowTechnique should return a much better value in interior cells with these changes.
2021-10-16 21:48:13 +02:00
elsid
c88367b6a6
Add sqlite3 helpers 2021-10-16 17:43:08 +02:00
elsid
f6d1689bb9
Avoid redundant polygon path reallocations
Use separate variable to store size and make all operations in-place.
2021-10-14 23:48:14 +02:00
elsid
79665cea66
Avoid access to the path vector element out of range
polygonPath.front() in some cases might reference to a first element of empty
vector. Copy the value into a local variable to be able to access later.
2021-10-14 23:46:50 +02:00
Bo Svensson
db3d938ee9
cleans up BSAFile (#3177)
We currently build a large map of a BSAFile's contents unused by Open MW. We already map archive contents in VFS. With this PR we remove the map from BSAFile and reimplement its only current use in BSATool.
2021-10-14 14:46:44 +02:00