Commit graph

148 commits

Author SHA1 Message Date
Robert Müller 89f126cf8d Remove obsolete ignore_convention comment 2022-02-16 20:54:11 +01:00
Dennis Felsing 18d9997348 Fix clang-format 2022-02-15 00:32:04 +01:00
Dennis Felsing dbfc62d2c0 Add modernize-deprecated-headers 2022-02-15 00:22:52 +01:00
Dennis Felsing 68e4eb21d5 Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
def 94272f82c7 Add more readability checks 2022-01-22 17:45:25 +01:00
heinrich5991 cdbf8ff2d2 Skip the UTF-8 BOM on all read text files
Fixes #4462.
2021-12-17 22:07:01 +01:00
Robert Müller f20443b694 fix command line arguments with unicode on windows
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-12-06 19:48:25 +01:00
def 2b50a1e712 Fix map_extract
Reported by cheeser0613
2021-11-13 21:07:03 +01:00
def ef5e2ecd93 Support unicode filenames on windows with pnglite (fixes #4301) 2021-11-05 18:02:34 +01:00
ChillerDragon 3eb3dcd48b Make use of IO_MAX_PATH_LENGTH
Inspired by
0a7d0fee7c
2021-09-13 12:14:50 +02:00
Jupeyy a663799188 uint64 -> uint64_t, int64 -> int64_t 2021-06-24 17:19:17 +02:00
Patiga ec53b8742e Fix duplicate uuid index in maps edited by tools 2021-05-03 12:02:18 +02:00
Patiga 9730e80e08 Fix duplication of ITEMTYPE_EX (uuid index) items
Credits to heinrich5991 for his feeling that the UUID index duplication
could originate in this file.
2021-05-02 17:22:15 +02:00
jupeyy 259629db9f Map optimizer 2020-11-21 12:10:20 +01:00
Jupeyy c989cd67f9 Check skin/sprite images for correctness 2020-11-18 07:59:15 +01:00
def 7a9a67c5d7 Enable most clang-tidy misc-* checks 2020-11-05 12:03:14 +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
Dennis Felsing 333218e8c2
Merge pull request #3200 from Patiga/pr-remove-duplicate-function
Use IntsToStr function from gamecore.h
2020-10-27 13:18:59 +01:00
Patiga 1253215018 Fix style 2020-10-27 12:35:55 +01:00
Patiga cce91746da Use IntsToStr function from gamecore.h 2020-10-27 12:15:11 +01:00
bors[bot] a050370055
Merge #3197
3197: 0.7 map converter - Stop embedding rgb images r=heinrich5991 a=Patiga

DDNet doesn't CMapItemTypeImage version 2, meaning it doesn't have
support yet for having rgb images in maps. Currently, trying that would result in
invalid map files.

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Patiga <dev@patiga.eu>
2020-10-27 09:44:16 +00:00
Patiga 090b0942fb Stop embedding rgb images
DDNet doesn't CMapItemTypeImage version 2, meaning it doesn't have
support yet for having rgb images in maps. Currently, trying that would result in
invalid map files.
2020-10-26 17:08:52 +01:00
Dennis Felsing e55eecc88b Fix map_convert_07
Broken in 5c1b8cd221 (diff-17a71d0838a3f107d2baf573a0885c3b7727266b432a13836525737e83a81a58)

Thanks to Jupstar for noticing
2020-10-26 15:11:54 +01:00
def 87b06d307f Fix clang-analyzer-core.UndefinedBinaryOperatorResult
/media/ddnet/src/game/client/animstate.cpp:54:27: warning: The left operand of '*' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
        pSeq->m_X += pAdded->m_X * Amount;
                                 ^
2020-10-14 15:45:47 +02:00
def 5c1b8cd221 Fix clang-analyzer-deadcode.DeadStores
/media/ddnet/src/game/client/components/statboard.cpp:288:3: warning: Value stored to 'tw' is never read [clang-analyzer-deadcode.DeadStores]
2020-10-14 15:45:47 +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
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
def b0a3de60b2 Handle PNG read errors (fixes #2959)
and print a more telling error message

I'll check all our existing maps for failures now:

$ find . -iname '*.map' | while read i; do echo $i; map_extract $i > /dev/null; find . -iname '*.png' | while read j; do dilate $j; rm -- $j; done; done

For skins Soreu and the skin DB team is already taking care.
2020-09-30 18:23:52 +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
def 0bac9f0de8 Manual preparation for cleaner clang-format
Also include what you use explicitly
2020-09-26 21:41:01 +02:00
Jupeyy 0ec7f1e1dc Fix dilate threshold & automatically apply dilate on embedded textures in the editor 2020-09-21 19:17:38 +02:00
Jupeyy a1eb5dc114 Max images(for editor, clamp for client and warning for mapconvert) (fixes #2148) 2020-09-19 21:22:21 +02:00
def f9ec8c5696 map_convert_07: Check for width/height 0
as suggested by Jupeyy
2020-09-14 18:03:23 +02:00
Andrii bea30a879d
Apply suggestions from code review
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-09-13 00:40:22 +03:00
Andrii 3835395591 allow to use config_retrieve on whole directory 2020-09-12 23:48:01 +03:00
bors[bot] 51483c2ff1
Merge #2789 #2797
2789: Refresh server browser immediately when updated ddnet info arrived r=heinrich5991 a=def-

At the moment it only happens the next time you press refresh.

Before we had it so that it always reloaded once the ddnet info arrived,
causing a quick flickering and lots of packets having to be resent every
time someone pressed refresh, even if nothing changed.

The new approach combines the advantages of both without the
disadvantages. An even nicer way would be to compare the json objects,
so that news and version updates don't matter, but our json library
doesn't seem to support that.

2797: dilate: Don't crash if file doesn't exist r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-09-10 22:24:06 +00:00
def 80b7ceb3d7 dilate: Don't crash if file doesn't exist 2020-09-10 23:25:33 +02:00
def c839dc96d9 Remove tools we don't need anymore
Following Jupeyys new renderer
2020-09-10 23:15:28 +02:00
def 5d239bce80 Also check for divisibility by 16 of height (fixes #2687) 2020-08-31 14:01:34 +02:00
def 53c43536d5 map_convert_07: Support drag'n'drop 2020-08-16 23:21:00 +02:00
bors[bot] de328c1360
Merge #2301
2301: map_convert_07: Check image width for divisibility by 16 r=heinrich5991 a=def-

As noticed on Sunny Land.

> [5:31 PM] redix: in theory it should be enough if width and height are divisible by 16

Now running this over our maps and fixing them manually.

Co-authored-by: def <dennis@felsin9.de>
2020-06-23 23:30:34 +00:00
def ca094df46b map_extract: Only access map info if it exists
Noticed on map Paranormal
2020-06-21 00:57:14 +02:00
def 66917c4b24 map_convert_07: Check image dimensions for divisibility by 16 2020-06-20 23:32:08 +02:00
Learath 9a4b1f3615 Fix fake_server 2020-06-19 20:28:55 +03:00
def b0406e335b Remove debugging help 2019-12-29 13:35:19 +01:00
def 6da92b4b9c Fix map_convert_07 tool 2019-12-29 12:43:41 +01:00
def 8639c902ae map_convert_07: use regular paths 2019-12-08 23:14:56 +01:00
def 28aabc5b91 Add map_convert_07 tool
Fixes https://github.com/ddnet/ddnet7/issues/20
2019-12-08 22:44:25 +01:00
def faa3cc195d UTF8 nocase compare & use for chat TAB completion
- As suggested by Arseniy Zarche
- Also updated confusables to Unicode 12
2019-01-09 08:31:03 +01:00