Commit Graph
377 Commits
Author SHA1 Message Date
InfiniteCoder d5dc68dd38 Root includes 2024-08-04 10:24:11 +03:00
MihailRis 47db626145 refactor: PVS-Studio warnings fixes 2024-08-04 01:30:52 +03:00
MihailRis 245b39be62 refactor: PVS-Studio warnings fixes 2024-08-04 01:12:42 +03:00
Vyacheslav Ivanov e4f8625e2a fix: fix narrowing conversion double to float by using std math funcs
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-03 23:13:35 +03:00
Vyacheslav Ivanov ab28b4df70 fix: PVS-Studio V550
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-03 23:00:10 +03:00
Vyacheslav Ivanov 3621e7ce1b fix: PVS-Studio V522 mark false
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-03 23:00:10 +03:00
Vyacheslav Ivanov 4efa574eec fix: PVS-Studio V508 mark false
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-03 21:05:19 +03:00
Vyacheslav Ivanov 2cd6837da9 fix: optimization: PVS-Studio warning V836
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-03 20:03:34 +03:00
Vyacheslav IvanovandMihailRis 2e7c0a109d fix: optimization: PVS-Studio warning V810
Cached the result of 'glm::vec3(size * 0.63f)' in a temporary variable to avoid multiple identical function calls and improve performance.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-03 17:52:15 +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 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 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
MihailRis 78e274dec4 fix frustum culling for entities 2024-08-03 17:41:03 +03:00
Vyacheslav IvanovandMihailRis e399e95930 fix: render: Fix WorldRenderer::renderBlockSelection
Block selection clears before new selection be drawn
Added a call to LineBatch::flush() to ensure that all buffered data is correctly uploaded to the GPU and rendered. The missing flush() was causing rendering artifacts, such as flickering of block outlines, which has now been resolved by ensuring that all accumulated data is processed and rendered properly.
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-02 15:13:22 +03:00
MihailRisandGitHub ba046a52c0 Revert "fix: optimization: Various PVS-Studio warnings" 2024-08-02 14:51:44 +03:00
Vyacheslav Ivanov 3a78746185 fix: render: Fix WorldRenderer::renderBlockSelection
Block selection clears before new selection be drawn
Added a call to LineBatch::flush() to ensure that all buffered data is correctly uploaded to the GPU and rendered. The missing flush() was causing rendering artifacts, such as flickering of block outlines, which has now been resolved by ensuring that all accumulated data is processed and rendered properly.
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-02 07:46:13 +03:00
Vyacheslav Ivanov 3d21b7ba6a fix: optimization: PVS-Studio warning V810
Cached the result of 'glm::vec3(size * 0.63f)' in a temporary variable to avoid multiple identical function calls and improve performance.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-02 05:41:47 +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 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 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
Vyacheslav Ivanov 73e721513c fix: optimization: PVS-Studio warning V836
Expression's value is copied at variable declaration.
The variable is never modified. Consider declaring it as a reference.

Changed variables to be a reference to avoid unnecessary copy.

Reported by: PVS-Studio

Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
2024-08-01 23:40:28 +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 f46e4a7989 add trackbar 'sub-consumer' for value label refresh when 'change-on-release' 2024-07-28 22:15:18 +03:00
MihailRis 8ca12127db add 'change-on-release' trackbar property & fix mouseRelease event timing 2024-07-28 12:38:31 +03:00
MihailRis 3fee1072b7 fix 'block' model lights with AO turned-off 2024-07-27 22:59:06 +03:00
MihailRis 71e20ff805 add block 'ambient-occlusion' property 2024-07-27 18:37:18 +03:00
MihailRis 18d473b673 improve parsing error alert 2024-07-24 17:11:43 +03:00
MihailRis 3590bd14cd update DrawContext 2024-07-21 16:06:40 +03:00
MihailRis cf12338a32 add skeleton debug view 2024-07-21 14:52:16 +03:00
MihailRis 0c4cdeaa87 add entities renderer tint support 2024-07-20 19:35:43 +03:00
MihailRis fba0bca0dc optimize ModelBatch 2024-07-20 17:59:15 +03:00
MihailRis 2c1adcedbd fix u_timer behaviour when paused 2024-07-18 13:50:57 +03:00
MihailRis 4aa76e35b7 add on_hud_render event 2024-07-12 09:17:53 +03:00
MihailRis 690b8f4807 fix: on_render called while paused 2024-07-08 22:56:22 +03:00
MihailRis 5522cfc231 add "Show Hitboxes" to the debug panel 2024-07-06 05:36:16 +03:00
MihailRis 1c4e13dc67 add block.get_textures 2024-07-03 05:15:15 +03:00
MihailRis 8302bfe98e fix msvc build 2024-07-03 04:11:57 +03:00
MihailRis 39d850a48c add modeltree:set_texture 2024-07-03 03:33:39 +03:00
MihailRis a72a37ccf7 Merge branch 'main' into entities 2024-07-01 06:21:00 +03:00
MihailRis fab124a2e2 remove unnecessary 'new' operators 2024-07-01 06:00:33 +03:00
MihailRis 1f257d2db2 Merge branch 'main' into entities 2024-06-30 22:34:51 +03:00
MihailRis 71c754b039 fix Image for non-existing textures in atlas 2024-06-30 22:25:31 +03:00
MihailRis 316233816f Merge branch 'main' into entities 2024-06-30 22:16:14 +03:00
MihailRis 2dffdf757c add <image ...> atlases support 2024-06-30 22:05:12 +03:00
MihailRis c0dca31e98 memory refactor Texture and ImageData 2024-06-30 21:24:46 +03:00
MihailRis 5769be8ec8 add triggers 2024-06-30 16:25:08 +03:00
MihailRis ee9f1639e9 refactor Content 2024-06-25 22:37:53 +03:00