Commit Graph

60 Commits (84f8a6848a8b05502d7618ca7af8cca74f2c3bae)

Author SHA1 Message Date
Project579 e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2 years ago
AnyOldName3 4e8e2e1c60 Eliminate &thing[0] pattern 2 years ago
psi29a 4ff7f8ddfb Merge branch 'string_viewing' into 'master'
Use string_view in yet more places

See merge request OpenMW/openmw!2348
2 years ago
Andrei Kortunov 3037f190be Implement per-font resolution 2 years ago
Andrei Kortunov 3178868cc3 Improve built-in default fonts 2 years ago
Evil Eye fb9bc5f535 Use string_view in Fallback::Map 2 years ago
Andrei Kortunov 9e1ab590f1 Cleanup fonts loading 2 years ago
Andrei Kortunov c3d3f3140b Allow to change font settings in the launcher 2 years ago
elsid f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2 years ago
Andrei Kortunov a787625c65 Remove code which became redundant due to changes in way how we load bitmap fonts 2 years ago
elsid 5f800279ac
Remove unused Gui::FontLoader::mTextures 2 years ago
Andrei Kortunov 845a812ebf Drop fonts export - users are supposed to use TrueType fonts or mods with legacy format 2 years ago
Andrei Kortunov 5bc5c1bb0c Use our fonts as a fallback 2 years ago
Andrei Kortunov 1f864e3127 Do not override monospace font 2 years ago
Andrei Kortunov 6f6b5ba04b Some refactoring 2 years ago
Andrei Kortunov db686b25c2 Use fallback data from openmw.cfg to setup fonts 2 years ago
Andrei Kortunov 8513bc9620 Fix build error on MSVC 2 years ago
Andrei Kortunov 8fc3635c2c Use case-insensitive font keys, remove debug code 2 years ago
Andrei Kortunov c47a48e25d Inject layout files to VFS 2 years ago
Andrei Kortunov 2630bc21dd Allow to override MyGUI layout 2 years ago
Andrei Kortunov 4ddba5142e Introduce font mappings 2 years ago
Andrei Kortunov dd04bfccfb Load fonts 2 years ago
jvoisin 0cc304e659 Clean up MyGUI includes
This should improve incremental compilation.
3 years ago
jvoisin 6feb92a9bf Remove boost::filesystem from a couple of files 3 years ago
elsid 94c1d0cced
Use unique_ptr to store istream 3 years ago
elsid 071ab3f650
Fix out of bounds access for std::string_view 3 years ago
elsid c75e938c46
Return string_view from Utf8Encoder functions
To avoid redundant std::string constructions.
3 years ago
Alexei Dobrohotov 7a0c13fcf8 Make better use of std::clamp 3 years ago
Cédric Mocquillon 6817282097 Move getFileExtension to common header and use instead of repeating same code 3 years ago
Cédric Mocquillon c2df0949e2 Change normalizeFilename signature 3 years ago
Cédric Mocquillon d4e26746a3 Use recurse subdirectory iterator to iterate over the VFS without exposing internal details 3 years ago
jvoisin 5c02e4dddc Delete an outdated/irrelevant comment 4 years ago
jvoisin 5470b3168b Use a switch-case instead of a map, on elsid@' advice
elsid@ said:

> From my measurements static map + exceptions is slower than original code
when loading polish morrowind localization by 25% with GCC 10.2.0. Switch-based
solution is about 25x times faster than the original and static map with find
only is ~20x faster.
4 years ago
jvoisin 770f91de77 Clean the fontloader's hack for polish font up
- The map can be static and const
- The map can be initialized inline
- No need to do a `find` + `[]` instead of `at`
4 years ago
jvoisin aec3c74fa5 Sprinkle some [[noreturn]] where possible 4 years ago
Andrei Kortunov 33b8233887 Validate GUI scaling and place it to the launcher 4 years ago
Andrei Kortunov 903b89a0ff Add bound for UI scale factor, as it specified in docs 4 years ago
Gleb Mazovetskiy 1e113710ef Clean-up FontLoader::loadFontFromXml fix
Follow-up to !559
4 years ago
Gleb Mazovetskiy bd7d5a8f92 Fix memory leak in FontLoader::loadFontFromXml
Tried building with -DCMAKE_CXX_FLAGS='-fsanitize=address -fsanitize-recover=address'
and this was one of the reported leaks.
4 years ago
Andrei Kortunov 6357bc3dad Catch MyGUI exceptions in the FontLoader destructor 5 years ago
Andrei Kortunov 396afe79f1 Move font loading to the FontLoader 5 years ago
Andrei Kortunov 3032b177a1 Remove redundant includes 6 years ago
Andrei Kortunov 7a986f38da Support for user-defined TrueType fonts 6 years ago
Andrei Kortunov c9c0230d2a Scale journal fonts separately from common ones 6 years ago
Andrei Kortunov c2c24a76a4 Handle MyGUI exceptions inside destructors 6 years ago
Andrei Kortunov 1452684d9e Use new logging system for components 6 years ago
tri4ng1e d310d36ea3
[Fix] Some PVS-Studio and cppcheck fixes 7 years ago
tri4ng1e d4d1703bcf
Some PVS-Studio and cppcheck fixes
cppcheck:
[apps/esmtool/record.cpp:697]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/esmtool/record.cpp:1126]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/esmtool/record.cpp:1138]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/niftest/niftest.cpp:36]: (performance) Function parameter 'filename' should be passed by reference.
[apps/niftest/niftest.cpp:41]: (performance) Function parameter 'filename' should be passed by reference.
[apps/opencs/model/prefs/boolsetting.cpp:25]: (warning) Possible leak in public function. The pointer 'mWidget' is not deallocated before it is allocated.
[apps/opencs/model/prefs/shortcuteventhandler.cpp:52]: (warning) Return value of std::remove() ignored. Elements remain in container.
[apps/openmw/mwstate/quicksavemanager.cpp:5]: (performance) Variable 'mSaveName' is assigned in constructor body. Consider performing initialization in initialization list.

PVS-Studio:
apps/opencs/model/filter/parser.cpp  582  warn  V560 A part of conditional expression is always true: allowPredefined.
apps/opencs/view/world/referencecreator.cpp  67  warn  V547 Expression '!errors.empty()' is always false.
apps/opencs/view/world/referencecreator.cpp  74  warn  V547 Expression '!errors.empty()' is always false.
apps/opencs/view/doc/loader.cpp  170  warn  V560 A part of conditional expression is always true: !completed.
apps/opencs/view/doc/loader.cpp  170  warn  V560 A part of conditional expression is always true: !error.empty().
apps/opencs/model/tools/pathgridcheck.cpp  32  err  V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 32, 34.
apps/opencs/model/world/refidadapterimp.cpp  1376  err  V547 Expression 'subColIndex < 3' is always true.

apps/openmw/mwgui/widgets.hpp  318  warn  V703 It is odd that the 'mEnableRepeat' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:318, MyGUI_ScrollBar.h:179.
apps/openmw/mwgui/widgets.hpp  319  warn  V703 It is odd that the 'mRepeatTriggerTime' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:319, MyGUI_ScrollBar.h:180.
apps/openmw/mwgui/widgets.hpp  320  warn  V703 It is odd that the 'mRepeatStepTime' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:320, MyGUI_ScrollBar.h:181
apps/openmw/mwmechanics/actors.cpp  1425  warn  V547 Expression '!detected' is always true.
apps/openmw/mwmechanics/character.cpp  2155  err  V547 Expression 'mode == 0' is always true.
apps/openmw/mwmechanics/character.cpp  1192  warn  V592 The expression was enclosed by parentheses twice: ((expression)). One pair of parentheses is unnecessary or misprint is present.
apps/openmw/mwmechanics/character.cpp  521  warn  V560 A part of conditional expression is always true: (idle == mIdleState).
apps/openmw/mwmechanics/pathfinding.cpp  317  err  V547 Expression 'mPath.size() >= 2' is always true.
apps/openmw/mwscript/interpretercontext.cpp  409  warn  V560 A part of conditional expression is always false: rank > 9.
apps/openmw/mwgui/windowbase.cpp  28  warn  V560 A part of conditional expression is always true: !visible.
apps/openmw/mwgui/journalwindow.cpp  561  warn  V547 Expression '!mAllQuests' is always false.
apps/openmw/mwgui/referenceinterface.cpp  18  warn  V571 Recurring check. The '!mPtr.isEmpty()' condition was already verified in line 16.
apps/openmw/mwworld/scene.cpp  463  warn  V547 Expression 'adjustPlayerPos' is always true.
apps/openmw/mwworld/worldimp.cpp  409  err  V766 An item with the same key '"sCompanionShare"' has already been added.
apps/openmw/mwworld/cellstore.cpp  691  warn  V519 The 'state.mWaterLevel' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 689, 691.
apps/openmw/mwworld/weather.cpp  1125  warn  V519 The 'mResult.mParticleEffect' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1123, 1125.
apps/openmw/mwworld/weather.cpp  1137  warn  V519 The 'mResult.mParticleEffect' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1135, 1137.

apps/wizard/unshield/unshieldworker.cpp  475  warn  V728 An excessive check can be simplified. The '(A && B) || (!A && !B)' expression is equivalent to the 'bool(A) == bool(B)' expression.
apps/wizard/installationpage.cpp  163  warn  V735 Possibly an incorrect HTML. The "</p" closing tag was encountered, while the "</span" tag was expected.

components/fontloader/fontloader.cpp  427  err  V547 Expression 'i == 1' is always true.
components/nifosg/nifloader.cpp  282  warn  V519 The 'created' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 278, 282.
components/esm/loadregn.cpp  119  err  V586 The 'clear' function is called twice for deallocation of the same resource. Check lines: 112, 119.
components/esm/cellref.cpp  178  warn  V581 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 175, 178.
components/esmterrain/storage.cpp  235  warn  V560 A part of conditional expression is always true: colStart == 0.
components/esmterrain/storage.cpp  237  warn  V560 A part of conditional expression is always true: rowStart == 0.
7 years ago
Capostrophic 1aa3ed0c18 Font loader fallback character reorganization (fixes #1987) 7 years ago
scrawl 4322e76cb6 Fix shadowing warnings 8 years ago