Commit graph

101 commits

Author SHA1 Message Date
Robert Müller de2744cb2a Use ReadFile to read opus sounds in editor 2022-06-16 10:19:37 +02:00
ChillerDragon 3667061b68 Use nullptr in generated and editor
-Wzero-as-null-pointer-constant
2022-06-13 18:28:13 +02:00
Chairn 01edaec628 Format vector variables names (fixes #5209) 2022-06-11 21:38:49 +02:00
Robert Müller 7474ca201f Remove dead code 2022-05-31 19:32:07 +02:00
Robert Müller 91d2ba1865 Organize game-client includes 2022-05-29 21:24:43 +02:00
Robert Müller 0c69495522 Use std::vector instead of array in editor 2022-05-27 16:36:39 +02:00
Robert Müller 9b2f0fe3c4 Remove unused includes of base/tl/array.h and sorted_array.h 2022-05-26 23:42:06 +02:00
def 8134f9fa55 Enable -Wshadow=local
> Warn when a local variable shadows another local variable or parameter.

Found one actual bug in graphics_threaded.cpp

Should reduce confusion in the future when reading source code
2022-03-20 13:24:34 +01:00
Wohoo 2017464282 Livefreeze implementation with CHARACTERFLAG_NO_MOVEMENTS flag.
Freeze and Unfreeze tiles added to switch layer too.
2022-01-07 16:53:40 +01:00
def 7d57b80646 Revert "Use temporary file when saving editor file (fixes #4476)"
Doesn't work on Windows, not so easy to overwrite a file already open in
editor. Not sure how our old approach works, but apparently it did
better than the new one. As reported by texnonik on Discord

This reverts commit e2084e1e9d.
2021-12-21 23:31:08 +01:00
def e2084e1e9d Use temporary file when saving editor file (fixes #4476) 2021-12-20 10:54:46 +01:00
def e5bcac3ca2 std::max -> maximum 2021-03-07 11:14:37 +01:00
def 6f2c82c0d4 SUBSTRACT -> SUBTRACT 2021-02-01 14:55:26 +01:00
heinrich5991 e805e42a94 Alternative alternative fix for malloc of size 0
Has a short diff to the original code before a4f13ed4a8.
Supersedes #3353. Thanks for the idea, @timakro.
2020-12-08 12:29:10 +01:00
def 165857a5a8 Fix variable names manually 2020-11-02 22:40:40 +01:00
def b1f0fd8969 Enable modernize-loop-convert clang-tidy check
and run clang-format afterwards

https://clang.llvm.org/extra/clang-tidy/checks/modernize-loop-convert.html
2020-11-02 22:40:24 +01:00
Patiga 14539a8046 Remove option to make map sounds external
Right now it is impossible to have a working external sound. External
sounds render unusable the moment the map is saved and given to another
player. For the mapper it seems like everything is working since the
mapper has the sound file. For anyone else it simply won't work. Since
1. there is no use for it and 2. it adds unnecessary complexity and
confusion, I propose removing it entirely.
2020-10-17 17:45:56 +02:00
def a4f13ed4a8 Fix clang-analyzer-optin.portability.UnixAPI
and mark some false positives

/media/ddnet/src/engine/client/backend_sdl.cpp:329:30: warning: Call to 'malloc' has an allocation size of 0 bytes [clang-analyzer-optin.portability.UnixAPI]
2020-10-14 15:45:43 +02:00
Patiga a252097e9a Fix comments 2020-10-13 09:53:33 +02:00
Patiga 06e90505b1 Use the same value as vanilla 2020-10-13 09:50:03 +02:00
bors[bot] 4a30ef1e9a
Merge #3020
3020: Fix all Multiplication type alerts by CodeQL r=heinrich5991 a=def-

> Multiplication result converted to larger type

> A multiplication result that is converted to a larger type can be a
> sign that the result can overflow the type converted from.

Example: https://github.com/ddnet/ddnet/security/code-scanning/17?query=ref%3Arefs%2Fheads%2Fmaster

Co-authored-by: def <dennis@felsin9.de>
2020-10-07 00:56:19 +00:00
bors[bot] 79b5852e17
Merge #3021
3021: only load + save auto mappers for tile layers, not physics layers r=def- a=Patiga

If I'm not mistaken, loading a map without auto mappers, then saving would've caused uninitialized values to be written to the auto mappers of physics layers.

Co-authored-by: patiga <dev@patiga.eu>
2020-10-06 07:37:26 +00:00
patiga 95fadea794 Fix style properly 2020-10-05 20:09:19 +02:00
patiga 09a9ca9699 Conform to style 2020-10-05 19:59:48 +02:00
patiga d123d928b4 only load + save auto mappers for tile layers, not physics layers 2020-10-05 19:44:26 +02:00
def 62dc12aacb Fix all Multiplication type alerts by CodeQL
> Multiplication result converted to larger type

> A multiplication result that is converted to a larger type can be a
> sign that the result can overflow the type converted from.

Example: https://github.com/ddnet/ddnet/security/code-scanning/17?query=ref%3Arefs%2Fheads%2Fmaster
2020-10-05 19:03:54 +02:00
patiga fc9e1bc325 initialize physics layer pointer, layer item version 2020-10-02 17:45:28 +02:00
def 3be8a592e5 Run clang-format
Purely automatic change. In case of conflict with this change, apply the
other change and rerun the formatting to restore it:

$ python scripts/fix_style.py
2020-09-26 21:50:15 +02:00
Jupeyy 84cad658d6 Add new renderer(as streamed vertices) for editor 2020-09-23 16:45:32 +02:00
def ddb88c6f3b Editor: Select game layer by default
Since it's the most important layer
2020-09-21 19:36:28 +02:00
def a67a8e36aa clang-format: fix style 2020-09-14 16:00:51 +02:00
Vlad be90f3f48b Replaced tile names. 2020-09-13 23:00:49 +03:00
Andrii ab79036873 Set camera position on LoadCurrentMap 2020-05-21 00:44:52 +02:00
patiga 4bbd019423 fix whitespaces 2020-05-18 00:33:35 +02:00
patiga 359257f73a write automapper version, was not initialized 2020-05-17 23:28:10 +02:00
def b480492ded Don't count freshly loaded map as modified (fixes #2178)
The reason is that we increased the sensitivity of the modified flag to
include adding layers and groups, and simply loading the map already
adds those, so every loaded map was considered modified.
2020-05-16 08:17:50 +02:00
Magnus Auvinen 6a6a5f00c9 more typesafty in the graphics. introduced the IGraphics::CTextureHandle
Edited by @ChillerDragon to fit in ddnet
(cherry picked from commit cb95e8dfe8)
2019-11-22 18:08:37 +01:00
Dennis Felsing 40591c2f8b Remove save group/layer button (fixes #1475) 2019-03-11 22:58:18 +01:00
Dennis Felsing 045533cef7
Merge pull request #1321 from bojidar-bg/x-add-auto-automapper
Add option to automatically run the automapper
2018-11-15 09:30:22 +01:00
Ryozuki 674d3f00e0 add support for blue teleport gun 2018-11-03 10:26:20 +01:00
Ryozuki ddf2e6af36 add tele-activator to the switch layer 2018-11-03 10:26:19 +01:00
Bojidar Marinov 823e4ee0f3
Save automapper config as external-typed mapitem 2018-10-09 13:17:05 +03:00
heinrich5991 f8277267a0 Remove mem_alloc and mem_free, use standard C functions instead
Replace `mem_free` by `free`, and `mem_alloc` by `malloc` or `calloc`
(the latter one being used to allocate a zeroed array of elements,
sometimes, this makes a call to `mem_zero` superfluous).

This results in having to remove `mem_stats` which previously recorded
the number of allocations and their size that the Teeworlds code did
directly.

Remove OOM handling in `src/game/client/components/binds.cpp`.

Remove needless copying in the CSV code in
`src/game/client/components/statboard.cpp`.
2018-04-09 11:56:39 +02:00
yangfl 1620fc9b0f Fix typo 2018-02-07 16:10:40 +08:00
Dennis Felsing eb2634ab0a Merge pull request #852 from heinrich5991/pr_ddnet_fix_extractname
Add testing; fix, rename and test the `CEditor::ExtractName` function
2017-08-30 22:09:17 +02:00
heinrich5991 22be1be389 Fix and rename the CEditor::ExtractName function
Fixes #846.
2017-08-30 13:59:42 +02:00
heinrich5991 2682480f8a Rename GetUncompressedDataSize to GetDataSize
Also rename the old `GetDataSize` to `GetFileDataSize`. `GetDataSize`
now returns the actual data size, not the data size before
decompression.
2017-08-30 08:36:17 +02:00
sctt 0849fa6024 fixing map_resave and adding map_replace_image
Update datafile.h

Update datafile.cpp

Update datafile.cpp

Update map_resave.cpp

Update datafile.h

Update map_resave.cpp

Update datafile.h

Update datafile.cpp

Update config_store.cpp

Update config_retrieve.cpp

Update io.cpp

Update gamecontext.cpp

Update config_store.cpp

Update CMakeLists.txt

Create map_replace_image.cpp

Update map_replace_image.cpp

fixing bug with height and witdth
2017-08-29 16:21:16 +02:00
def 4b4f9992d4 Fix disappearing switches in editor 2017-07-15 18:11:01 +02:00
def 73c61e4169 Let's not save maps that are ok already 2017-06-11 20:18:28 +02:00