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

2101 commits

Author SHA1 Message Date
elsid
4ed0960856
Remove redundant IdAccessor type
Use overloaded free functions instead.
2023-02-25 13:49:22 +01:00
elsid
b5ec584be2
Replace ESM::RefId::sEmpty by default constructed RefId where possible
Static const is only required to provide a reference or a pointer when it is not
possible with default constructed temporary.
2023-02-18 01:07:15 +01:00
psi29a
d846a9fc15 Merge branch 'cs_optimize_saving' into 'master'
Fix editor saving performance

See merge request OpenMW/openmw!2741
2023-02-17 13:30:20 +00:00
elsid
e618026c69
Use ESM::RefId as index key in collections 2023-02-17 11:08:46 +01:00
elsid
b2299ef914
Optimize saving in editor 2023-02-17 11:05:25 +01:00
elsid
8383fa3547
Log time spent on document operations in editor 2023-02-17 00:23:02 +01:00
psi29a
18d488d968 Merge branch 'ref_id_class' into 'master'
Convert RefId to class

See merge request OpenMW/openmw!2739
2023-02-15 23:41:58 +00:00
elsid
996153f78d
Convert RefId to class 2023-02-15 23:20:44 +01:00
elsid
b6a2fd8fc1
Simplify InfoCollection
There was additional logic to create topic infos index by topic id to make
getTopicInfos and removeDialogueInfos functions faster. In practice it makes
loading slower.

Move infos index by topic to CSMWorld::Data and use only on loading.
2023-02-15 23:10:35 +01:00
elsid
de24cdc12c
Log content files loading time by editor 2023-02-15 21:29:13 +01:00
elsid
080700f8fe
Name all custom ESM format versions and add tests 2023-02-10 19:54:15 +01:00
Andrei Kortunov
7e2aedf637 Add an initial Qt6 support 2023-02-06 18:38:59 +04:00
psi29a
3f9cae7947 Merge branch 'dragdetails' into 'master'
[OpenMW-CS] Generate record filters based on cell content and column header

Closes #7161

See merge request OpenMW/openmw!2617
2023-02-03 09:29:36 +00:00
florent.teppe
3780033837 Reverts Cell name to a string 2023-01-21 18:39:42 +01:00
unelsson
fc64ab0f5a Promise constness 2023-01-17 02:55:03 +02:00
unelsson
6a864cd9f6 Implement basic filter generation from the dragged table cell (cell content and column header) 2023-01-16 23:47:32 +02:00
unelsson
bc1027ee95 First draft of getting the exact drag start location 2023-01-16 23:47:32 +02:00
unelsson
7f8a84f2f2 Move Response column earlier 2023-01-14 16:19:37 +02:00
Andrei Kortunov
7c8fb79745 Suppress a warnings spam when user entered an invalid regular expression 2023-01-13 12:08:42 +04:00
Andrei Kortunov
7c709167d9 Simplify regex search in the editor 2023-01-13 11:28:49 +04:00
Andrei Kortunov
307a60e87c Migrate from QRegExp to more modern QRegularExpression 2023-01-11 11:21:46 +04:00
elsid
c173348cbe
Use default initializers for ESM::RefNum members
Instead of unset function that is removed now and assignments all over the code.
2023-01-10 00:44:51 +01:00
florent.teppe
0de6b79966 Fixes issue with topic info edition.
Also future proofs reference on RefId's string.
2023-01-08 12:59:47 +01:00
florent.teppe
1b66be9c70 Fix dangling reference. 2023-01-02 19:47:12 +01:00
florent.teppe
1ef1de974d script blacklist => RefId
Applies changes from review

Fixed clang format

Clang format + review.
2022-12-27 19:16:21 +01:00
florent.teppe
2c30575b3b CellName is now a RefId, makes more sense that way. 2022-12-27 19:16:21 +01:00
florent.teppe
6ff90b34a8 Fixed an issue with RefId in CellRefs where Ids wouldn't be loaded
Fixed multiple issues from the review.
2022-12-27 19:15:58 +01:00
florent.teppe
0f3499f504 Renamed string => Id, makes more sense considering the new underlying type
Fixes unnecessary copies, and issues with case sensitive comparisons.

fixed modification that wasn't necessary

Fixed type mismatch, and unecessary copy
2022-12-27 19:15:57 +01:00
florent.teppe
30a020883e Avoids unecessary copies
Fixed issue with lowerCase

Oups fixed compialtion on openMW_test_suite
2022-12-27 19:15:57 +01:00
florent.teppe
65cdd489fb create a specific esm reader function for RefID to avoid allocation for string and then again for RefId
Fixed some types

removed useless header

applied clang format

fixed compile tests

fixed clang tidy, and closer to logic before this MR

Removed hardcoded refids

unless there is a returned value we don't use static RefIds
can use == between RefId and hardcoded string

Fix clang format

Fixed a few instances where std::string was used, when only const std::string& was needed

removed unused variable
2022-12-27 19:15:57 +01:00
fteppe
09d461a8cd fixed Topic selected event
Fix rebase
2022-12-27 19:15:56 +01:00
fteppe
62d8fe3fc2 changed a few hardcoded refIds used in mutliple places to be defined only once in a variable 2022-12-27 19:15:55 +01:00
fteppe
20da0892ef openMW_test_suite compiles and runs
Slowly moving through the open-cs errors

Good progress in openCS

Very good progress on openCS

Getting closer with openCS

OpenCS compiles and runs! Didn't have time to test it all though

ix openMW

everything compiles on windows??

Fix gcc

Fix Clang
2022-12-27 19:15:55 +01:00
psi29a
fa50890633 Merge branch 'sm-snap-to-reference' into 'master'
Open-CS: Snap to Reference

See merge request OpenMW/openmw!2484
2022-11-08 15:30:26 +00:00
Petr Mikheev
6025943fed Add missing content=builtin.omwscripts if openmw is started via openmw-cs (fixes #7056) 2022-11-05 16:30:44 +01:00
Max Henzerling
897cdc62d8 Add snap to reference 2022-11-04 15:04:42 -07:00
psi29a
6960fc9304 Merge branch 'opencs_iwyu' into 'master'
Run IWYU on the opencs

See merge request OpenMW/openmw!2481
2022-11-02 21:41:53 +00:00
Evil Eye
45cd5bdbd7 Ignore 0 attributes on dead NPCs 2022-11-01 20:14:40 +01:00
jvoisin
1a326294c0 Run IWYU on the opencs 2022-10-31 21:04:01 +01:00
jvoisin
cd29c181cf Another pass with IWYU 2022-10-10 15:16:18 +02:00
elsid
843753da14
Remove unused includes 2022-10-09 16:44:18 +02:00
jvoisin
3cbf1dc042 First pass with include-what-you-use 2022-10-09 10:39:43 +00:00
Evil Eye
e6592aa850 Add key flag on load 2022-09-30 12:16:45 +02:00
clang-format-bot
88ec8a9523
Apply clang-format 2022-09-25 18:23:43 +02:00
Andrei Kortunov
3163d9ed56 Fix topic infos creation 2022-09-25 15:17:20 +04:00
clang-format-bot
ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03:00
elsid
410a2881fe
Add comma to the last array element to prevent putting multiple elements on a single line 2022-09-14 00:36:02 +02:00
elsid
51314db2f1
Remove AI_CNDT from AI package types
AI_CNDT is a label of subrecord containing cell name. It's not AI package type.
2022-09-13 00:05:12 +02:00
elsid
52b7b66e9f
Add comma to the last array element to prevent putting multiple elements on a single line 2022-09-12 21:00:51 +02:00
elsid
f269406061
Do not wrap emit expresison with parenthesis
To avoid warnings like following after clang-format applied:

apps/launcher/utils/profilescombobox.cpp:85:9: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
    emit(signalProfileChanged(mOldProfile, currentText()));
        ^
apps/launcher/utils/profilescombobox.cpp:82:5: note: previous statement is here
    if (index == -1)
    ^
2022-09-12 21:00:51 +02:00
Project579
ca14fc00dc Added dedicated functions for conversions between QString and std::filesystem::path. 2022-09-11 14:41:21 +02:00
Project579
c226b35f1f Fix some remaining encoding errors due to std::filesystem transition. 2022-09-11 14:41:20 +02:00
Project579
a13709c510 Replace implicit convertions from std::filesystem::path to std::string with correctly converting functions. 2022-09-11 14:41:20 +02:00
Project579
4d47e8d055 openmw-cs: model: world: data: Remove dead code. 2022-09-11 14:41:20 +02:00
Project579
e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2022-09-11 14:41:15 +02:00
Project579
5446571aec Circumvent QT MOC bugs by including the filesystem header in a specific order. 2022-09-11 02:19:07 +02:00
Project579
4bb07282c9 Replace all remaining occurrences of boost::filesystem with std::filesystem. 2022-09-11 02:19:00 +02:00
Evil Eye
fb9bc5f535 Use string_view in Fallback::Map 2022-08-28 17:20:49 +02:00
Evil Eye
2222b47e3d Make Settings::Manager::getString return a reference 2022-08-28 16:38:11 +02:00
mpeco
9040209046 functor-based Qt signal-slot syntax construction set: changing visibility of certain slots for connecting on external/derived classes 2022-08-23 17:14:12 -03:00
mpeco
78700eee57 functor-based Qt signal-slot syntax construction set 2022-08-23 17:14:12 -03:00
elsid
2a79a8074a
Use forward declarations 2022-08-19 22:05:15 +02:00
elsid
b3882777ab
Cleanup opencs includes 2022-08-19 19:25:03 +02:00
elsid
bf1f4f2117
Mark private template functions defined in cpp as inline 2022-08-19 19:17:21 +02:00
Alexei Kotov
e537f2b6f3 Fix display for some package settings 2022-08-14 19:51:43 +03:00
elsid
f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2022-08-03 22:06:24 +02:00
elsid
228a0dc723
Avoid redundant lowerCase call 2022-08-03 00:19:16 +02:00
elsid
ba69146ced
Use std::string_view to avoid redundant std::string construction 2022-08-03 00:18:55 +02:00
Alexei Kotov
0d18f76271 Editor: Decouple levelled list columns (bug #6705) 2022-07-30 12:48:29 +03:00
Evil Eye
3967509cdd Use meaningful names instead of pretending we don't know what snow is 2022-07-17 19:54:59 +02:00
psi29a
0eb674ec84 Merge branch 'settings_fix' into 'master'
Refactor usage of settings storage in the launcher and editor

See merge request OpenMW/openmw!2123
2022-07-12 13:00:52 +00:00
Andrei Kortunov
4b257e496e Use static settings map for launcher and editor - the Settings::Manager has a static data anyway 2022-07-12 14:56:20 +04:00
Andrei Kortunov
a5b0ef0912 Avoid possible null dereference 2022-07-12 13:43:47 +04:00
Andrei Kortunov
42b9a6daaf Do not use an invalid iterator 2022-07-12 12:45:11 +04:00
elsid
bef15edf0b
Remove redundant ostream, istream, iostream and sstream includes
* Replace by std::to_string and operator+ where possible.
* Move the code requiring to include <sstream> from .hpp to .cpp files.
2022-07-05 01:41:28 +02:00
Andrei Kortunov
aa349f2ed9 Initialize some missing variables 2022-07-03 15:44:50 +04:00
Bret Curtis
37a440a0ee add one include back 2022-06-20 16:26:52 +02:00
jvoisin
8b9ed57348 Clean up Qt includes 2022-06-17 11:56:54 +02:00
Petr Mikheev
a70d5831c5 Lua scripts configuration in omwaddon 2022-06-05 01:36:39 +02:00
Evil Eye
db1a372e5b Replace new with make_unique in opencs 2022-05-29 13:25:17 +02:00
Michał Plichta
5ee5e8f2f7
Correct CS typo described in #6704 2022-05-24 19:24:39 +02:00
elsid
98f53eca65
Fix gcc warning: -Wuninitialized
/home/elsid/dev/openmw/apps/opencs/model/world/data.cpp: In constructor ‘CSMWorld::Data::Data(ToUTF8::FromType, bool, const Files::PathContainer&, const std::vector<std::__cxx11::basic_string<char> >&, const boost::filesystem::path&)’:
/home/elsid/dev/openmw/apps/opencs/model/world/data.cpp:69:36: warning: member ‘CSMWorld::Data::mCells’ is used uninitialized [-Wuninitialized]
   69 | : mEncoder (encoding), mPathgrids (mCells), mRefs (mCells),
      |                                    ^~~~~~
2022-05-16 22:26:19 +02:00
cody glassman
04843fed6d moddable post-processing pipeline 2022-05-15 10:03:58 -07:00
Evil Eye
a64979e25d Replace empty std::string assignments 2022-05-04 22:33:39 +02:00
Max Henzerling
af5b1b3083 Add option to open record editting subviews in new windows instead of exclusive docking. 2022-05-01 11:52:19 -07:00
psi29a
84458baa8b Merge branch 'VA_OpenMW-CS' into 'master'
OpenMW-CS: Issue #3245 Add configurable instance grid, angle, and scale snapping

Closes #3245

See merge request OpenMW/openmw!1737
2022-04-11 16:03:30 +00:00
elsid
db44f91fd5
Remove redundant include from esm3/esmreader.hpp 2022-04-10 22:16:32 +02:00
elsid
4509b05bc8
Use std::make_shared instead of new
make_shared allocates single storage for ref counter and the object.
std::shared_ptr<T>(new T) allocates 2 storages.
2022-04-08 22:50:09 +02:00
Vidi_Aquam
6d7c8f25fc Implement grid snapping and angle snapping in OpenMW-CS
Adds configurable snap settings for instance movement, rotation and scaling, used with the secondary edit button
2022-04-02 19:25:57 -05:00
Martin Otto
96e48e5492 Make settings loader differentiate between engine and editor (fixes #6658). 2022-03-04 09:44:52 +00:00
Petr Mikheev
a453e5c198 Reuse the same code to load settings in apps/openmw, apps/launcher, apps/opencs 2022-02-02 23:47:11 +01:00
elsid
45db56b382
Rework fixed string
* Avoid inheritance.
* Define equality operators out of the class definition.
* Replace toString with toStringView where it doesn't make sense to create a string.
2022-01-28 18:39:09 +01:00
Bret Curtis
74e7cfc023 remove unused includes: part1
remove unused imports: part2

revert one tidy we will keep for c++20
2022-01-23 17:30:25 +01:00
Bret Curtis
d1fb854521 move most of the files from esm to esm3, keep common code in esm; this is make space for a future with esm4
esm typo

esm typo
2022-01-23 17:04:48 +01:00
Cody Glassman
8ec0a52605 Toggable day night switch (#5928) 2022-01-11 09:34:19 +00:00
Evil Eye
52f9634624 Allow the CS to handle the repeat flag for all types 2021-11-20 11:03:08 +01:00
Evil Eye
6daefe3ddc Cast to the unsigned char expected by cctype functions 2021-11-14 11:26:18 +01:00
Evil Eye
f23bd51175 Don't check bounds when the type is unambiguously a char 2021-11-14 11:26:18 +01:00
Evil Eye
751e8cf76b Do a bounds check before calling functions defined in cctype 2021-11-14 11:26:15 +01:00
Bo Svensson
6cf74f7041
refactors ESM::Land (#3213)
With this PR we reduce coupling, simplify code, encapsulate a variable and separate actual `ESM` data from its context.
2021-11-04 16:55:32 +01:00
Evil Eye
9b565c4cf9 Remove dead code 2021-10-28 22:16:43 +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
Petr Mikheev
a8acc19988 Avoid copying std::string in MWWorld::Ptr::getTypeDescription() 2021-10-12 00:18:23 +02:00
Evil Eye
d680aa26e9 Disallow switch fallthrough 2021-10-03 21:58:10 +02:00
psi29a
782e0710af Merge branch 'OpenCS-preserve-blocked' into 'master'
OpenCS - Preserve "blocked" record flags when saving. #6288

Closes #6288

See merge request OpenMW/openmw!1052
2021-09-27 19:21:20 +00:00
Evil Eye
831055f878 Merge branch 'OpenCS-fix-modify' into 'master'
OpenCS - Re-implement the fix for Issue #6067.

See merge request OpenMW/openmw!1173
2021-09-19 19:23:30 +00:00
psi29a
18f5762a76 Merge branch 'master' into 'OpenCS-preserve-blocked'
# Conflicts:
#   CHANGELOG.md
2021-09-18 15:20:26 +00:00
Cédric Mocquillon
d4e26746a3 Use recurse subdirectory iterator to iterate over the VFS without exposing internal details 2021-09-14 18:09:54 +02:00
elsid
6b7434ca69
Pass std::string_view instead of const std::string&
* Starting with Actor::getBodyPartMesh and ending with
  Misc::StringUtils::ciEqual.
* Add tests for Misc::StringUtils::ciEqual.
2021-09-09 18:39:50 +02:00
elsid
a8c16071dc
Fix -Wreturn-local-addr warning
/home/elsid/dev/openmw/apps/opencs/model/world/actoradapter.cpp: In member function ‘const string& CSMWorld::ActorAdapter::ActorData::getPart(ESM::PartReferenceType) const’:
/home/elsid/dev/openmw/apps/opencs/model/world/actoradapter.cpp:142:20: error: returning reference to temporary [-Werror=return-local-addr]
  142 |             return "";
      |                    ^~
2021-09-04 18:04:45 +02:00
jvoisin
d4e3575f1d Don't use const for objects returned by value.
This prevents the usage of std::move semantics,
and makes clang-tidy sad.
2021-09-01 22:23:50 +02:00
cc9cii
0a5571f19e Disable editing for blocked records in both table and dialogue edit widget. 2021-08-29 15:27:59 +10:00
cc9cii
2eb210f31a Partially undo commit 71be4cdd20 so that moved references retain the original refnum. This is consistent with vanilla CS's behaviour. 2021-08-28 16:12:40 +10:00
cc9cii
b2bd97f283 A different implementation to MR 1051 to fix Issue #6067.
This MR doesn't delete the original record, but instead the original record is updated with the moved record when loading.

Issue #4752 is no longer addressed in this MR.
2021-08-28 14:09:55 +10:00
cc9cii
7264a10c07 Partially revert commit dab1a9e7fb 2021-08-28 09:49:45 +10:00
cc9cii
7227a83e60 Preserve "blocked" record flags when saving with OpenCS. This will help outputs of OpenCS to be used with vanilla Morrowind.
Sample use case: users are using the Morrowind Code Patch feature that allows modders to enable this flag to differentiate editor-made potions from player crafted potions for tooltips.
2021-08-28 09:42:54 +10:00
psi29a
66f028c4a1 Merge branch 'correctcommandimplementation' into 'master'
Don't do storage in constructors of the commands

See merge request OpenMW/openmw!1126
2021-08-27 07:30:45 +00:00
psi29a
fff35dcb03 Merge branch 'Ignore-empty-pgrd' into 'master'
Do not store empty PGRD records.  Should resolve Issue #6209.

See merge request OpenMW/openmw!1121
2021-08-26 14:29:49 +00:00
unelsson
de3497d291 Fix undo-redo crash 2021-08-22 23:42:27 +03:00
unelsson
890ce1eefb Reverse action order for redo and undo 2021-08-22 23:42:27 +03:00
unelsson
0cfabd6f3b Move mapToSource back to constructor 2021-08-22 23:42:27 +03:00
unelsson
b2fe591590 Don't do any storing in the constructor 2021-08-22 23:42:27 +03:00
unelsson
45549da0f5 For most commands, set mOld in redo, not in constructor 2021-08-22 23:42:27 +03:00
unelsson
7801f42005 Don't do mapToSource at executeModify 2021-08-20 22:32:41 +03:00
cc9cii
bd3ef506cd Empty Pathgrid record is considered as the modder's intention to delete any existing record. 2021-08-19 19:30:01 +10:00
unelsson
298db2ef76 Initialize and check pointer. 2021-08-12 22:31:37 +03:00
unelsson
f1d05a93bf Get index and model from proxy 2021-08-12 22:28:16 +03:00
psi29a
b770373491 Merge branch 'OpenCS-enforce-str-length' into 'master'
OpenCS - Disallow entry of strings longer than the lengths allowed by the file format (#3066)

See merge request OpenMW/openmw!1088
2021-08-06 21:08:09 +00:00
glassmancody.info
09e03fde2e refactor and fix wobbly shores 2021-08-04 17:49:57 -07:00
cc9cii
8aee84c46e Disallow entry of strings longer than the lengths allowed by the file format.
It is possible to allow longer strings but that will require an extension in the omwaddon format as well as changes to the reader to handle that extension.  Such changes should be a separate MR.

(applied the patch in https://gitlab.com/OpenMW/openmw/-/issues/3066)
2021-08-04 09:39:18 +10:00
psi29a
9fa7521fc5 Merge branch 'OpenCS-no-charconv' into 'master'
OpenCS - Avoid the inclusion of charconv header

See merge request OpenMW/openmw!1087
2021-08-03 23:32:40 +00:00
psi29a
9b7e14ec00 Merge branch 'OpenCS-moved-reference' into 'master'
OpenCS - Fix moved reference - Issues #3514 and #4752

See merge request OpenMW/openmw!1051

(cherry picked from commit 2bee171c7990522da33c2667f7d079fa35f4ede0)

36c30f7f Fix for Issue #3514 where moving a reference to another cell is not handled properly.
40327681 Update the changelog.
2021-08-03 23:29:05 +00:00
cc9cii
bf06898a79 Retain the use of std::string_view in the function signature. 2021-08-04 08:23:22 +10:00
cc9cii
99e691fbe3 Avoid the inclusion of <charconv> header due to Ubuntu Bionic (18.04) which as gcc version less than 8.1
Partially reverts commit fd67ebde25
2021-08-04 06:47:14 +10:00
psi29a
4b48e62b64 Merge branch 'fixandclean' into 'master'
Fix opencs build and remove some clang warnings

See merge request OpenMW/openmw!1078
2021-08-01 12:11:17 +00:00
fredzio
1391194152 Remove unneeded return statement 2021-08-01 13:14:32 +02:00
fredzio
9ba459662d Remove unneeded std::move
[19/199] Building CXX object apps/opencs/CMakeFiles/openmw-cs.dir/model/world/commands.cpp.o
../../../apps/opencs/model/world/commands.cpp:298:12: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
    mOld = std::move(model.getRecord (id).clone());
           ^
../../../apps/opencs/model/world/commands.cpp:298:12: note: remove std::move call here
    mOld = std::move(model.getRecord (id).clone());
           ^~~~~~~~~~                            ~
../../../apps/opencs/model/world/commands.cpp:333:12: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
    mOld = std::move(model.getRecord (id).clone());
           ^
../../../apps/opencs/model/world/commands.cpp:333:12: note: remove std::move call here
    mOld = std::move(model.getRecord (id).clone());
           ^~~~~~~~~~                            ~
2 warnings generated.
2021-08-01 13:14:32 +02:00
fredzio
36e33b0cf2 Add missing override 2021-08-01 13:14:32 +02:00
fredzio
bede1ea1ec Fix build 2021-08-01 13:14:32 +02:00
psi29a
15d278de55 Merge branch 'opt-out-compose' into 'master'
Make it possible to opt out of composing variables

Closes #6186

See merge request OpenMW/openmw!1076
2021-08-01 08:53:52 +00:00
cc9cii
67cad2c515 Fix CSMWorld::InfoCollection::getTopicRange() returning one too many. 2021-08-01 15:53:00 +10:00
AnyOldName3
4727ae4b3b Make it possible to opt out of composing variables 2021-08-01 02:47:10 +01:00
psi29a
141095b850 Merge branch 'OpenCS-loading-opt' into 'master'
OpenCS loading time improvements

See merge request OpenMW/openmw!1044
2021-07-31 21:27:29 +00:00
cc9cii
33dcd7585a OpenCS - Jump To Modified 2021-07-24 20:00:25 +00:00
cc9cii
3e466699c8 A better way to plug a potential memory leak in the event of an exception during push_back(). 2021-07-24 21:23:03 +10:00
cc9cii
fd67ebde25 Changes based on review comments, including:
* replace murmurhash with std::unordered_map
* plug potential leak from unique_ptr release
* replacing some sections with cleaner code
2021-07-24 09:17:48 +10:00
cc9cii
725d689e8a Call push_back() if inserting to the end of the vector. It seems MSVC may be generating different code compared to insert().
(copied the changes from commit SHA-1: 257126ed69)
2021-07-23 23:17:16 +10:00
cc9cii
44a333b6db Don't attempt to open files yet to be created. 2021-07-23 21:25:35 +10:00
cc9cii
5c504e4d22 Convert the CellRef record index lookup maps to use integer keys rather than strings.
- Morrowind load over 300,000 references, so even small inefficiencies add up to longer loading times.
- std::map is used, but should try others, std::unordered_map or even std::vector

(copied the changes from commit SHA-1: 86945d1912)
2021-07-23 19:07:56 +10:00
cc9cii
10c6304a1f Fix typo from commit cfdbd0d471. 2021-07-23 18:12:09 +10:00
cc9cii
fc2f68a465 Change the loader's top progress bar to show total number of records processed rather than the number of files.
(copied the changes from commit SHA-1: ff072441fd)
2021-07-23 17:34:27 +10:00
cc9cii
5fffcab94f Performance improvements for loading Info records.
- The order of info records with the same topic are maintained in Collection::mRecords
- The index lookup data structure are not ordered.  The topic string is hashed.  The infos for the topic are simply placed in a vector.
- The index values for appending or inserting a record takes prev/next values (if exist)
- FIXME: prev/next values are not adjusted for adding or removing records
- FIXME: undo after reordering does not reset the modified flag

(copied the changes from commit SHA-1: 06f9922822)
2021-07-23 16:05:58 +10:00
cc9cii
66bda84240 Convert RefNum index map to use find().
(copied the changes from commits 68e16b6cee and 0de223c637)

NOTE: it is unclear how this change affects commit 61a4a0807b
2021-07-23 15:30:33 +10:00
cc9cii
be45092e55 Use std::unique_ptr to store records in collections, RefidCollection and RefIdData.
(copied the changes from commit 23e7e3c165)
2021-07-23 14:21:21 +10:00
elsid
cfdbd0d471
Indicate moved cell refs explicitly
This is less error prone approach than use of MovedCellRef fields.

Also make separate functions for skipping and reading moved cell refs to avoid
passing special flags  logic and null pointers for unused arguments.
2021-07-12 18:56:42 +02:00
cc9cii
ae4ddd810f More dead code removal. 2021-07-06 14:45:45 +10:00
cc9cii
ec457a09c3 Fix Npc edit widget index out of bounds due to a removed column. 2021-07-06 13:45:58 +10:00
cc9cii
f68c81e631 Merge branch 'master' into 'OpenCS_Bug6017' 2021-07-06 03:10:46 +00:00
cc9cii
4b3de46bfa Use enums in place of magic numbers. Ensure Creature and NPC cell references are always saved as persistent. 2021-07-06 12:37:02 +10:00
elsid
7498a86abe
Remove redundant semicolons 2021-07-05 13:11:54 +02:00
cc9cii
42bcbe34de Cell references that teleport (Doors) should be placed in the "persistent" group when saving. 2021-07-04 16:18:47 +10:00
cc9cii
2d8dd9be32 Fix using incorrect id to search for record flags. Eliminate inefficient double-loop in saving cell references. 2021-06-30 10:46:51 +10:00
cc9cii
47ef98ca1b Clean up RefIdData code for better legibility. 2021-06-30 10:09:56 +10:00
cc9cii
f2a301653c Remove redundant mPersistent member from ESM::NPC and ESM::Creature, replaced by mRecordFlags. Fixed the editing of the persistence flag value. 2021-06-30 08:20:29 +10:00
cc9cii
2a76634f5f Moved persistence flag from references to the header flags of referenceables (e.g. Static, Weapon, etc). Editing widget is not fully working. 2021-06-29 23:25:26 +10:00
cc9cii
f6eab52a1b Added "Persistent" column to references table. 2021-06-29 19:45:02 +10:00
cc9cii
024ad3276b Partial fix for #6017. The persistence flag of the references are saved but it is not yet possible to modify it via OpenCS. 2021-06-29 19:20:01 +10:00
AnyOldName3
d38126ef1c Pack default CS config
*Technically* it was already being loaded as if it were packed, but it
made no difference because it's supposed to be empty.
2021-06-26 20:00:25 +01:00
Thunderforge
945f1aad20 Using override keyword in OpenMW CS
Detected by clang-tidy's modernize-use-override
2021-05-18 19:53:55 -05:00
elsid
f2188d2533
Reduce temporary allocations on ESM loading
By moving objects instead of copying when possible.
2021-05-15 18:45:21 +02:00
Bret Curtis
66a527c3de
Merge pull request #3075 from akortunov/warnfix
Fix MSVC's C4244 and C4267 warnings
2021-05-14 21:28:56 +02:00
psi29a
3944648f0b Merge branch 'opencs_remove_inclde' into 'master'
Remove some superfluous includes in the opencs

See merge request OpenMW/openmw!829
2021-05-14 13:33:06 +00:00
jvoisin
06ae26037f Remove some superfluous includes in the opencs 2021-05-14 10:57:31 +02:00
Andrei Kortunov
f9d42ed396 Fix MSVC's C4267 warnings 2021-05-12 10:34:39 +04:00
Thunderforge
339d347aea Fixing performance-faster-string-find issues
This addresses the Clang Tidy check [performance-faster-string-find](https://clang.llvm.org/extra/clang-tidy/checks/performance-faster-string-find.html).
2021-05-10 22:44:07 -05:00
Bret Curtis
befa3f587f
Merge pull request #3068 from akortunov/master
Clean up MSVC warnings
2021-04-19 09:27:17 +02:00
psi29a
3423d3f882 Merge branch 'various_warn' into 'master'
Fix various warnings found by clang

See merge request OpenMW/openmw!758
2021-04-18 20:04:20 +00:00
jvoisin
38316cdaf8 Fix various warnings found by clang
- unused alias
- inefficient use of push_back
- exceptions not inheriting from std::exception
- weird use of a comma
- value compared against itself
2021-04-17 19:06:33 +02:00
Andrei Kortunov
f308dde254 Clean up MSVC warnings 2021-04-17 12:14:50 +04:00
unelsson
06fda4c5a1 QLineEdit for setting base animation files 2021-04-16 23:12:14 +03:00
unelsson
95272e0f14 String setting to CSMPrefs, part of dehardcoding animation files 2021-04-16 23:12:14 +03:00
Andrei Kortunov
016a1d45df Remove outdated field - remnant from earlier implementation 2021-04-14 10:58:44 +04:00
glassmancody.info
582f7b52cf Merge remote-tracking branch 'upstream/master' into why_are_the_christmas_lights_still_up 2021-04-13 11:09:52 -07:00
glassmancody.info
4ba473b684 Finalize settings, torch fix 2021-04-13 11:09:49 -07:00
glassmancody.info
690995988b More formatting, OpenCS cells are unbroken 2021-04-13 11:09:35 -07:00
glassmancody.info
7370acdf54 Merge remote-tracking branch 'upstream/master' into why_are_the_christmas_lights_still_up 2021-04-13 11:09:19 -07:00
glassmancody.info
9d9074c244 Add shared UBO 2021-04-13 11:07:48 -07:00
Andrei Kortunov
124a33d8a3 Fix uninitialized variables 2021-04-10 10:58:00 +04:00
Petr Mikheev
7bbbe40abe "static const" -> "static constexpr" in headers 2021-03-21 13:57:54 +01:00
Nelsson Huotari
9f0f3eaeb2 Add collada to supported formats 2021-01-18 19:22:01 +02:00
psi29a
acfd2cfd90 Merge branch 'dialogclonefix' into 'master'
[OpenMW-CS] Fix cloning in info records

See merge request OpenMW/openmw!524
2021-01-11 14:13:53 +00:00
Nelsson Huotari
7196ad7455 Implement an override-value when cloning, use when cloning info records 2021-01-10 21:23:52 +02:00
Bret Curtis
a735bbe9a5
Merge pull request #3040 from akortunov/pvs
Fix some issues, found by PVS Studio
2021-01-10 12:58:17 +01:00
Nelsson Huotari
3045d20a97 Make sure that vector isn't empty, just in case 2021-01-10 01:25:40 +02:00
Nelsson Huotari
5f1d3e0e2f Use the Topic ID of the cloned target from topicinfos 2021-01-10 01:06:23 +02:00
Nelsson Huotari
313e895912 [OpenMW-CS] Cube and sphere instance selection 2021-01-09 21:35:07 +00:00
Andrei Kortunov
1930f8f37d Fix copy-paste error 2021-01-09 20:03:12 +04:00
Andrei Kortunov
7fc4c9f3f6 Avoid dead code 2021-01-09 13:52:01 +04:00
Andrei Kortunov
801e2d6ad0 Avoid to use uninitialized variables 2021-01-09 13:36:40 +04:00
Alexei Dobrohotov
32601e0ae4 Properly reserve body parts for skirts (bug #5731) 2020-12-11 10:39:57 +03:00
Coleman Smith
842ea9d6ed simplifying a bit
- attaching gradient camera directly to the main camera
- using Vec4ub
2020-12-10 21:36:46 +00:00
Nelsson Huotari
61a4a0807b Load master index in refId to mContentFile, keep master index also in mIndex 2020-12-09 00:10:58 +02:00
Andrei Kortunov
8084a336b5 Replace zeroes and nulls by nullptrs 2020-11-29 11:14:07 +04:00
Alexei Dobrohotov
53f91a3aa5
Merge pull request #3018 from akortunov/emplace
Use emplace_back instead of push_back
2020-11-01 01:58:56 +03:00
Nelsson Huotari
b1ea9f6a5b Strip the plugin index from refid completely 2020-10-23 20:21:34 +03:00
Nelsson Huotari
fb4250a2b7 Strip the plugin index when looking for deleted refs. 2020-10-19 15:02:10 +03:00
Andrei Kortunov
065ed5138e Use emplace_back instead of push_back 2020-10-18 10:27:35 +04:00
Andrei Kortunov
8ca3c3b123 Mark overrided methods by override keyword 2020-10-16 22:18:54 +04:00
psi29a
8f86617262 Merge branch 'master' into 'master'
Fixed passed indexes for object deletion #5384

See merge request OpenMW/openmw!196
2020-07-10 12:10:33 +00:00
Andrei Kortunov
d0fe15b095 Use meaningful names instead of mSkill1 and mSkill2 2020-06-26 11:47:59 +04:00
Andrei Kortunov
0bb9322a69 Use default constructor for ItemFlags 2020-06-23 10:01:36 +04:00
Andrei Kortunov
2b4274bca8 Use modern Qt flag declarations 2020-06-22 18:46:45 +04:00
Bret Curtis
61a5c6125d #5480: Drop Qt4 support and require Qt 5.12 or later. 2020-06-22 12:17:06 +02:00
Capostrophic
039c9a37eb Verifier: Don't check race of non-skin body parts (bug #5400)
Remove unnecessary flag field check
Remove magic numbers
2020-05-09 00:31:10 +03:00
Giovanni Bodega
8a8b4986da Fixed passed indexes for object deletion #5384 2020-05-06 16:39:32 +01:00
Bret Curtis
4ae0bd1fae Merge branch 'helplink' into 'master'
Link to readthedocs documentation from OpenCS

See merge request OpenMW/openmw!171
2020-04-18 20:54:21 +00:00
Frederic Chardon
513ac8986d Add link to opencs documentation on readthedocs, available through
context menu.
The documentation opens in default browser.

There are 3 contexts:
- global: opens the OpenMW CS User Manual main page
- when a record is selected: opens the "Tables" page
- when the filter field is selected: opens the "Record Filters" page

There is also a link to the OpenCS tutorial in the help menu.
2020-04-18 20:54:21 +00:00
Capostrophic
ad333e88fe Handle enchantment autocalc flag as a flag (bug #5363) 2020-04-11 00:03:14 +03:00
Andrei Kortunov
9712925ba3
Merge pull request #2762 from akortunov/warnfix
Avoid a hack to initialize mIndex in the editor
2020-04-06 12:32:33 +04:00
Andrei Kortunov
c7cedc4e5a Avoid a hack to initialize mIndex 2020-04-06 09:43:05 +04:00
Bret Curtis
7fda65e7bb
Merge pull request #2692 from unelsson/opencsbrushdraw
Editor: Implement brush outlines
2020-04-05 20:52:45 +02:00
elsid
ef4a7089e4
Use template specialization for writeHNT to write raw arrays
To avoid passing explicit size argument where it's possible.
2020-04-04 01:12:49 +02:00
Nelsson Huotari
da0add904b Fix and simplify brush outlines and coordinate calculations 2020-03-26 13:25:33 +02:00
Alexei Dobrohotov
baff15362a
Merge pull request #2713 from unelsson/opencsdropobjects
Editor: Implement dropping objects with keypress in instancemode
2020-03-24 03:01:07 +03:00
Capostrophic
18bfc6f2c5 Fix Gender column filtering (bug #4601) and correct filter descs 2020-03-22 22:09:38 +03:00
Nelsson Huotari
711dc59f09 Implement four different functions for dropping 2020-03-18 11:17:22 +02:00
Nelsson Huotari
f063eeb36e Drop objects with a keyboard shortcut 2020-03-18 11:17:22 +02:00
Andrei Kortunov
02444add2a Support for radial fog (feature #4708) 2020-03-17 23:09:28 +04:00
Capostrophic
4455c978df Explain the global shader define default values in editor 2020-03-04 01:00:09 +03:00
Capostrophic
6999f1fd28 Add an option to apply lighting to environment maps 2020-03-03 20:08:59 +03:00
Nelsson Huotari
198a75b8e6 Delete selected instances with a hotkey 2020-02-19 11:44:55 +02:00
Capostrophic
216a5d27c6 Avoid working with AMBI subrecord in tools unnecessarily (bug #5269) 2020-02-04 20:57:04 +03:00
capostrophic
89055f1c6c Generate WNAM upon saving terrain 2020-01-11 02:42:04 +03:00
Andrei Kortunov
3704acf857 Unify streams usage to support non-ASCII paths (bug #5239) 2020-01-03 07:10:17 +04:00
Assumeru
737aa1e4e8 Remove FactionID editing from OpenCS (#2636)
* Remove FactionID editing

* remove useless comments

* rename FactionID to Unknown
2019-12-18 20:42:54 +03:00
Alexei Dobrohotov
7328db4d6b
Fix small typo in body part record verifier 2019-10-30 17:51:36 +03:00
Bret Curtis
9f039fac87
Merge pull request #2520 from unelsson/transientlandshapeedit
[Review phase] Editor: Transient land shape editing
2019-10-25 00:26:43 +02:00
Nelsson Huotari
c957f0544c Remove unneeded brackets 2019-10-23 00:34:54 +03:00
Nelsson Huotari
deb122ffdb Add optional post-processing (smooth/rough), add/fix tooltips. 2019-10-22 21:26:55 +03:00
Nelsson Huotari
6a3070e680 Fix shape brush setting description 2019-10-22 21:26:55 +03:00
Nelsson Huotari
8acfa2600f Terrain shape editing related fixes 2019-10-22 21:26:55 +03:00
Nelsson Huotari
16138fc896 Transient land shape editing 2019-10-22 21:25:10 +03:00
Andrei Kortunov
2fc819cdae Encode ID's in all places to UTF-8 (bug #3977) 2019-10-10 20:52:32 +04:00
Nelsson Huotari
0880923189 Consistency for variable and header argument names. 2019-09-10 12:15:19 +03:00
Nelsson Huotari
3becacf6d1 Remove globals, const int& -> int, values to const ref. 2019-09-10 12:15:19 +03:00
Nelsson Huotari
39ab449431 Only allow selection of cells in view 2019-09-10 12:15:19 +03:00
capostrophic
5341ca4e22 [Regression] Avoid locale-related conversion issues in editor 2019-08-01 11:47:31 +03:00
Axel Vestin
c0f66ac70c Fixes Albemic typo in OpenMW-CS 2019-07-06 00:13:30 +02:00
Nat Meo
af1e5e01b4 Issue #5005: Instance window via Scene window 2019-07-01 23:26:05 +00:00
Alexei Dobrohotov
44a07efc27
Fix trapped soul object verifier warning 2019-05-29 02:54:19 +03:00