Commit Graph
617 Commits
Author SHA1 Message Date
MihailRis e014931e1e fix: selection update latency 2024-08-03 22:36:18 +03:00
Vyacheslav IvanovandMihailRis 5e70837d3f fix: optimization: PVS-Studio warning V815
The 'empty()' method is more efficient for checking if a string is empty compared to comparing it with an empty string literal.

The default constructor 'std::wstring()' is more efficient for creating an empty string compared to using a string literal.

The 'clear()' method is more efficient for clearing a std::wstring compared to assigning it an empty string literal.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-03 17:50:58 +03:00
Vyacheslav IvanovandMihailRis 26ff0f133a fix: optimization: PVS-Studio warning V821
Creating variables in a more localized scope can enhance performance and make the code easier to understand.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-03 17:50:04 +03:00
Vyacheslav IvanovandMihailRis 3fa7fac4df fix: optimization: PVS-Studio warning V830
Replaced 'std::optional::value()' with '*' operator to improve performance.

Using 'std::optional::value()' involves additional overhead compared to using the '*' or '->' operators. This change ensures more efficient access to the underlying value of the optional when you are certain that it contains a value.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-03 17:47:15 +03:00
Vyacheslav IvanovandMihailRis 8c5e5559ec fix: optimization: PVS-Studio warning V831
Replaced 'at()' method with 'operator[]' to improve performance.

The 'at()' method performs bounds checking, which can introduce overhead. Using 'operator[]' bypasses this check and can improve performance when you are certain that the index is within bounds.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-03 17:46:29 +03:00
Vyacheslav IvanovandMihailRis 97a0bb5776 fix: optimization: PVS-Studio warning V835
Passing cheap-to-copy arguments by reference can sometimes lead to decreased performance. This change ensures that the argument is passed by value, which is more efficient in cases where the argument is inexpensive to copy.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-03 17:46:13 +03:00
Vyacheslav IvanovandMihailRis aecd0f5db9 fix: optimization: PVS-Studio warning V832
It's better to use '= default;' syntax instead of empty constructor and destructor body.
Using '= default;' can help the compiler generate more optimal code.

Reported by: PVS-Studio

Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-03 17:44:10 +03:00
Vyacheslav IvanovandMihailRis c858913a2f fix: optimization: PVS-Studio warning V807
Created references to avoid using repeated expressions, improving performance across multiple instances.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-03 17:43:12 +03:00
MihailRisandGitHub ba046a52c0 Revert "fix: optimization: Various PVS-Studio warnings" 2024-08-02 14:51:44 +03:00
Vyacheslav Ivanov c4cc71623d fix: optimization: PVS-Studio warning V807
Created references to avoid using repeated expressions, improving performance across multiple instances.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-02 06:07:50 +03:00
Vyacheslav Ivanov 2c1103307f fix: optimization: PVS-Studio warning V813
Passing large objects by const reference avoids unnecessary copying and enhances efficiency.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-02 05:35:55 +03:00
Vyacheslav Ivanov 5b325ac2bc fix: optimization: PVS-Studio warning V815
The 'empty()' method is more efficient for checking if a string is empty compared to comparing it with an empty string literal.

The default constructor 'std::wstring()' is more efficient for creating an empty string compared to using a string literal.

The 'clear()' method is more efficient for clearing a std::wstring compared to assigning it an empty string literal.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-02 05:35:55 +03:00
Vyacheslav Ivanov 6b3146f98a fix: optimization: PVS-Studio warning V821
Creating variables in a more localized scope can enhance performance and make the code easier to understand.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-02 05:35:53 +03:00
Vyacheslav Ivanov e9a5f18bc3 fix: optimization: PVS-Studio warning V830
Replaced 'std::optional::value()' with '*' operator to improve performance.

Using 'std::optional::value()' involves additional overhead compared to using the '*' or '->' operators. This change ensures more efficient access to the underlying value of the optional when you are certain that it contains a value.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-02 02:38:54 +03:00
Vyacheslav Ivanov f3f872c7a3 fix: optimization: PVS-Studio warning V831
Replaced 'at()' method with 'operator[]' to improve performance.

The 'at()' method performs bounds checking, which can introduce overhead. Using 'operator[]' bypasses this check and can improve performance when you are certain that the index is within bounds.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-02 02:38:54 +03:00
Vyacheslav Ivanov 1bdc9cf759 fix: optimization: PVS-Studio warning V835
Passing cheap-to-copy arguments by reference can sometimes lead to decreased performance. This change ensures that the argument is passed by value, which is more efficient in cases where the argument is inexpensive to copy.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-02 02:38:54 +03:00
Vyacheslav Ivanov 5dd7a15c09 fix: optimization: PVS-Studio warning V832
It's better to use '= default;' syntax instead of empty constructor and destructor body.
Using '= default;' can help the compiler generate more optimal code.

Reported by: PVS-Studio

Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-02 01:57:43 +03:00
MihailRis f8907f7db1 add on_update, on_render to docs & change entities tps to 20 2024-08-01 16:04:27 +03:00
MihailRis eefaafd1e7 update block.compose_state, block.decompose_state semantics 2024-07-31 14:56:42 +03:00
MihailRis 3a1ae57bbf fix: mat4.decompose (-Wmaybe-uninitialized) 2024-07-31 14:45:09 +03:00
MihailRis 10fa828bd7 update component 'ARGS' variable default value 2024-07-30 19:52:04 +03:00
MihailRis 753fb6bf3b add vec2.angle(...) 2024-07-29 16:54:57 +03:00
MihailRis d6696b54cb add 'normal' argument to on_use_on_block event 2024-07-29 15:23:04 +03:00
MihailRis f46e4a7989 add trackbar 'sub-consumer' for value label refresh when 'change-on-release' 2024-07-28 22:15:18 +03:00
MihailRis f485ba5e54 fix: invalid block segment was not removed on hover 2024-07-27 14:46:52 +03:00
MihailRis adafc94fa1 add block.compose_state(...), block.decompose_state(...) 2024-07-27 13:23:35 +03:00
MihailRis 64ccf2a532 fix: thrid-person camera xray 2024-07-26 13:40:13 +03:00
MihailRis 0a8de441b4 fix hud.* functions cause fatal error if incorrect arguments passes 2024-07-25 00:03:13 +03:00
MihailRis 0de4061253 refactor EngineController.cpp 2024-07-24 17:44:43 +03:00
MihailRis 18d473b673 improve parsing error alert 2024-07-24 17:11:43 +03:00
MihailRis fe1ac69b57 improve lua errors handling (traceback) & lua stack leaks fixes 2024-07-24 16:19:14 +03:00
MihailRis 2ec6c8b540 update component lua short name 2024-07-24 15:17:30 +03:00
MihailRis b23f7e996f fix skeleton:index(...) 2024-07-23 22:48:26 +03:00
MihailRis f9df873382 update assets errors handling & add 'atlases' to preload 2024-07-23 19:27:46 +03:00
MihailRis c3b6025e20 fix missing include 2024-07-22 19:38:23 +03:00
MihailRis 058daf6117 add camera:look_at optional interpolation parameter 2024-07-22 19:32:05 +03:00
MihailRis e0cb57a10a add quat Lua library 2024-07-22 19:05:27 +03:00
MihailRis b5e7b63a9d refactor lua libraries 2024-07-22 18:14:54 +03:00
MihailRis 012e81d4c9 add doc/**/cameras.md & update cameras library 2024-07-22 16:50:03 +03:00
MihailRis 2fe25f5dd5 fix: lua errors in standard libs initialization are nonthrowing 2024-07-22 15:53:05 +03:00
MihailRis b5d7634601 fix player.get_camera 2024-07-22 14:19:09 +03:00
MihailRis 34ab3eb41c add player.get_camera(playerid) 2024-07-22 14:16:28 +03:00
MihailRis 52c39d25d0 add skeleton:get_color(), skeleton:set_color(...) 2024-07-20 21:15:04 +03:00
MihailRis eedce588b1 move class Clock to a separate unit 2024-07-19 20:49:04 +03:00
MihailRis fbced2504e fix msvc build 2024-07-19 10:32:00 +03:00
MihailRis 02c9c4ced3 add mat4.from_quat(...) & update mat4.decompose(...) 2024-07-19 07:48:42 +03:00
MihailRis 3549c1f326 update entity methods set 2024-07-18 12:08:43 +03:00
MihailRis d285ffb2f7 update entities library semantics 2024-07-18 11:54:37 +03:00
MihailRis c9257ec127 add block.place(...), block.destruct(...) 2024-07-18 08:41:16 +03:00
MihailRis 5a3f28f2b5 add entities.name(...) and entity:get_name(...) 2024-07-17 20:15:45 +03:00