Commit graph

4631 commits

Author SHA1 Message Date
heinrich5991 42934fe102 Remove statically detectable float divisions by zero
This should fix the warning in MSVS.
2017-09-16 18:34:26 +02:00
heinrich5991 9911759314 Revert "Don't divide by 0"
This reverts commit 03faa51e28.

Dividing floats by zero isn't undefined behavior and results in +inf or
-inf depending on the sign of the first operand.

	#include <math.h>
	#include <stdio.h>

	#define PRINT(x) printf("%s = %f\n", #x, x)

	int main()
	{
		PRINT(1.0 / 0.0);
		PRINT(-1.0 / 0.0);
		PRINT(atanf(1.0 / 0.0));
		PRINT(atanf(-1.0 / 0.0));
		return 0;
	}

prints

	1.0 / 0.0 = inf
	-1.0 / 0.0 = -inf
	atanf(1.0 / 0.0) = 1.570796
	atanf(-1.0 / 0.0) = -1.570796

The changed function was problematic for values like (0,1), (-1,0),
(0,-1) where it always returned an angle of 0°.
2017-09-16 18:33:10 +02:00
def 03faa51e28 Don't divide by 0 2017-09-16 12:06:07 +02:00
Dennis Felsing 43d0299a45 Merge branch 'master' into pr_ddnet_fix_msvs_warnings 2017-09-16 11:17:39 +02:00
Jupeyy fc706a820c only check gametiles for DDNet server type 2017-09-16 03:45:24 +02:00
Jupeyy 31844d3353 set max width for custom text texture upload and fixing alignments for
texture updates
2017-09-15 03:01:26 +02:00
Jupeyy 5c7c09d380 fixing most wrong code pattern 2017-09-13 20:33:58 +02:00
Jupeyy fd83d2834d dont draw layer if our view is out of the layers range 2017-09-12 23:16:01 +02:00
Jupeyy c437b5bb89 use 64 bit variable 2017-09-12 21:06:12 +02:00
Jupeyy 629bf2c5f9 Merge branch 'master' of https://github.com/ddnet/ddnet 2017-09-12 20:24:58 +02:00
Jupeyy 0caa70f0a1 support buffering of tile layers, draw them with the buffer objects and
some optimazations to border drawing
2017-09-12 20:22:18 +02:00
Jupeyy 9d2a625363 create overlay textures for entity overlays, instead of rendering glyphs 2017-09-12 20:15:37 +02:00
Jupeyy 6dc4d1e578 only allow a maximal zoom factor to make sure no bufferoverflow happens 2017-09-12 20:14:34 +02:00
Jupeyy 93138c1fba make background class inherited from maplayers and change some things in
maplayers instead, so the background class can profit from buffering
2017-09-12 20:13:53 +02:00
def 73d9ad7615 Really only download ddnet-info.json at correct time 2017-09-08 22:16:00 +02:00
def 715ac673ec Version 10.8.6 2017-09-08 22:01:51 +02:00
def c2c453bd45 Make sending name to info.ddnet.tw optional, show dialog at start and some minor fixes 2017-09-07 20:51:46 +02:00
heinrich5991 4d96090770 Fix MSVS warnings
```
warning C4291: no matching operator delete found; memory will not be freed if initialization throws an exception
warning C4305: truncation from 'double' to 'float'
warning C4805: unsafe mix of type 'bool' and type 'int' in operation
```
2017-09-06 10:54:29 +02:00
def 58d1294b3c oops 2017-09-03 23:50:27 +02:00
def d5fc3210fd Version 10.8.5 2017-09-03 23:46:58 +02:00
def 8b1470c31f Revert "Merge GAME_VERSION and GAME_RELEASE_VERSION"
This reverts commit 5cfd779c68.
2017-09-03 23:46:15 +02:00
def 4b39a39e10 Version 10.8.4 2017-09-03 19:30:29 +02:00
def 278c1ee198 Add Toggle ghost control (fixes #823) 2017-09-03 19:23:59 +02:00
def 5cfd779c68 Merge GAME_VERSION and GAME_RELEASE_VERSION 2017-09-03 18:54:43 +02:00
def caec69abc1 RequestDDNetInfo in ingame menu too 2017-09-03 18:17:21 +02:00
def 89ed22e8d8 Introduce ddnet-info.json
- Single json file containing all information for the client
- Fetched from https://info.ddnet.tw/info?name=deen
- Replaces versionsrv, news, ddnet-maps.json and ddnet-ranks.json
- Servers are sorted by most popular ones for respective player
- Always stays < 100 ms response time, compared to occasional 50 s for
  old ddnet-ranks.json
2017-09-03 17:42:04 +02:00
def f2a7f5f8dd User agent in http fetcher 2017-09-03 09:18:00 +02:00
def 0a09af4b33 str_format instead of sprintf 2017-09-03 09:01:25 +02:00
def 7b6317a5d6 buffer sizes 2017-09-03 08:53:54 +02:00
def 862e26dd08 Clean up time handling a bit 2017-09-03 08:48:21 +02:00
def e64e59a839 semaphore instead of busy waiting in CJobPool 2017-09-02 12:30:55 +02:00
Dennis Felsing f8b98c6366 Version 10.8.3 2017-09-01 08:01:45 +02:00
def f5edf53fd7 Version 10.8.2 2017-08-31 23:43:00 +02:00
def 9b214db85f Force version.ddnet.tw and update4.ddnet.tw 2017-08-31 23:28:10 +02:00
def e36d7ce9a1 Version 10.8.1 2017-08-31 22:07:43 +02:00
def 583421b42d Revert "fixed sprite rendering. Closes #834"
This reverts commit 43af1fdb5f.
2017-08-31 22:03:33 +02:00
def 97380494e6 Version 10.8 2017-08-31 19:24:17 +02:00
heinrich5991 659e1ff527 Merge pull request #853 from Redix/pr_ghost_time
Ghost and Race demo time extraction fix
2017-08-31 12:31:20 +02:00
Redix affa3faeec Only use integers for ghost and race demo handling
Ghosts still use floats internally
2017-08-31 03:22:08 +02:00
Redix cf09b6b08b Use -1 as invalid for time parsing functions 2017-08-31 01:13:26 +02:00
Redix a396e40c5e Move race helper functions to own cpp file
Fix some style issues
2017-08-31 00:17:16 +02:00
def 040fc9ca32 Implement right click and middle click on country and type filters
Right click: exclusively activate one
Middle click: reset (reenable all)
2017-08-30 22:36:39 +02:00
Redix b6a3a42aa6 Use the time parsing functions for race demo name parsing 2017-08-30 22:10:43 +02: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
def a1d2ecb6de Empty when no rank 2017-08-30 21:50:09 +02:00
Redix f1f7e4e30b Fix ghost and race recorder time parsing 2017-08-30 21:44:27 +02:00
def 16f3ddc5a7 Show if user has rank on map in browser (+filter)
UI implementation by timakro
2017-08-30 21:34:04 +02:00
Dennis Felsing 25a5eff1f8 Merge pull request #847 from heinrich5991/pr_ddnet_uncompressed_datasize
Rename `GetUncompressedDataSize` to `GetDataSize`
2017-08-30 16:34:02 +02:00
oy 43af1fdb5f fixed sprite rendering. Closes #834 2017-08-30 16:32:39 +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 ac2943a49b utf8mb4 in database for real utf8 2017-08-26 09:00:33 +02:00
def fb252c4940 Fix compilation 2017-08-25 13:27:37 +02:00
heinrich5991 1ae004ba46 Make a copy of the input only after sanitizing it
This fixes a physics bug that allowed players to set their mouse
direction to (NaN, NaN), resulting in funny effects.
2017-08-25 13:20:10 +02:00
def 0e1cc205ef Fix formatting for server chat messages with time in already 2017-08-21 20:48:11 +02:00
def 98520bb407 other kind of fix 2017-08-19 09:36:13 +02:00
def d40dd4f362 Don't try next SQL server when /times returns empty 2017-08-19 09:32:14 +02:00
def 0b5dcdc478 Disable vsync by default and warn about possible delay 2017-08-08 19:53:16 +02:00
def 5d8a0ddc1e Add time in console 2017-08-04 22:38:22 +02:00
heinrich5991 33315452c3 Merge branch 'master' into leak_fix 2017-07-31 20:42:32 +02:00
def 0a28556481 A bit nicer birthday message 2017-07-31 18:24:16 +02:00
def d9aeeae3fc Fix sql_score.cpp formatters 2017-07-30 14:23:25 +02:00
def c12082c2ef Not too many messages 2017-07-30 14:15:45 +02:00
Learath2 4622ab4cb6 Merge pull request #814 from heinrich5991/pr_ddnet_fix_cmake_mac
Fix the CMake Mac build
2017-07-30 11:38:12 +02:00
def 7a3b7c6228 oops 2017-07-29 23:13:04 +02:00
def f3d4fcf012 Print message when team starts playing to team members 2017-07-29 23:11:33 +02:00
HMH d03e91153c removed unused Dest function for layers 2017-07-28 14:43:03 +02:00
heinrich5991 6247aa0c7f Enable -Wextra and -Wformat=2
Also annotate `dbg_msg`, `str_format` and `str_timestamp_ex` so that the
compiler can determine whether the format strings are correct.

Fix the compiler warnings generated by these extra warnings -- some of
them were security issues.
2017-07-27 20:38:17 +02:00
Marcel Herd d513af6a42 Removed default bind for home key (kill)
Kill is already bound to K by default, binding it on home as well doesn't really have any purpose. (?)
Furthermore, the home key is right next to page up which is bound to toggling entities.
It is very easy to accidentally hit home instead of page up, which is highly frustrating.. therefore I suggest removing this duplicate binding.
2017-07-26 20:43:26 +02:00
def adef38a574 Revert "We want the Timestamp of a team to stay min(Timestamp) to indicate the first time this team finished the map"
This reverts commit bf0e67a34a.
2017-07-26 18:12:41 +02:00
heinrich5991 fd8bccb0f4 Fix the CMake Mac build
Fixes #805.
2017-07-26 04:30:56 +02:00
def 379f060126 Version 10.7.1 2017-07-25 19:09:05 +02:00
def a9d3f45b25 Add ui_close_window_after_changing_setting 2017-07-25 19:08:16 +02:00
def 8d621dfc00 Add kitty skins (by Ravie + fuzzy ninja by patwo.*) 2017-07-25 00:11:37 +02:00
def a9498b15cb Fat skins 2017-07-25 00:11:37 +02:00
heinrich5991 1ebb4f89a6 Reopen: Add a flag for rcon login via username (#800)
This uses an extended protocol message to signal that rcon
authentication might require a username, allowing the client to enable
the username prompt.

Add a forgotten logout on key update
2017-07-24 21:43:55 +02:00
def cf08239e58 no plenk 2017-07-24 20:58:51 +02:00
def 147005ea42 ask before overwriting demo file when slicing (fixes #806) 2017-07-24 18:33:11 +02:00
def bcec0f1bb1 ctrl-f to search, ctrl-x to exclude, ctrl-r to reason 2017-07-24 18:05:19 +02:00
Dennis Felsing 402a71527a Merge pull request #810 from H-M-H/stat_csv
use str_append for appending strings
2017-07-24 16:01:06 +02:00
HMH f2ac4a02ce use str_append for appending strings
this fixes corrupted stat csvs as str_format does not work with same
source and destination
2017-07-24 15:27:30 +02:00
def 4c98c4bdd6 typo 2017-07-23 21:34:36 +02:00
def 79d29b1e31 Fix: Finish score should always show the fastest time 2017-07-23 21:33:55 +02:00
def bf0e67a34a We want the Timestamp of a team to stay min(Timestamp) to indicate the first time this team finished the map 2017-07-23 21:20:12 +02:00
def ec885f3e25 Fix layout 2017-07-22 22:43:20 +02:00
def af5b903944 Version 10.7 2017-07-22 22:32:35 +02:00
def f09a0f640f Fix mouse sensitivity setting dialog and introduce new one for ui mouse sens (#fixes 804) 2017-07-22 22:31:14 +02:00
def e37d895399 Version 10.6.9 2017-07-22 17:35:45 +02:00
def d50b39c530 Fix controls rectangle overlapping topbar and being clickable outside of scope 2017-07-22 17:35:30 +02:00
def fd732e43bd Version 10.6.8 2017-07-22 13:55:56 +02:00
def 2d68aed009 More settings in controls menu. use listbox (fixes #802) 2017-07-22 13:41:18 +02:00
def 7428dd0637 Editor: Don't show server settings when picker is active 2017-07-22 12:18:53 +02:00
HMH 476d57c5c5 Also cleanup CEditorMap on destruction 2017-07-21 20:02:46 +02:00
def b57ffa429e Use scancodes instead of keycodes for input (fixes #796, please test) 2017-07-21 19:53:49 +02:00
def 35befec54c Clean up key binding a bit 2017-07-21 19:32:32 +02:00
def f352daf00d Allow moving mouse while spectating and typing (fixes #798) 2017-07-21 19:24:18 +02:00
HMH 7b3aba8fdc fixed memoryleak in CCollision 2017-07-21 16:02:24 +02:00
def 5785267a39 Version 10.6.7 2017-07-16 23:54:22 +02:00
def 4a13d47637 Use update4.ddnet.tw... 2017-07-16 23:54:07 +02:00