Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2020-04-07 00:00:00Z and 2020-04-08 00:00:00Z
Avatar
๏ Toxic-EÇ 2020-04-07 03:41:09Z
@Aoe
05:13
f06796e Version 13.0 - def- d1a5b45 Merge pull request #2109 from def-/pr-13.0 - def-
Avatar
d50b59b Add trafilaw to credits - def-
05:29
5b6f54d ddnet-release.sh: Update MacOSX SDK 10.11 -> 10.15 - def-
Avatar
@noby well highdpi effectively multiplies the resolution maybe the computer is genuinely having trouble getting out all the pixels
06:26
Does it atleast look sharper?
06:27
@deen ^^ did you forget to ship sth?
06:33
I would take a look but I dont have anything with windows on it
Avatar
DDNet 13.0 error message .
06:39
Title: entry point not found Text: entry point to procedure Crypt... not found in dll library.
Avatar
@filodex fixed, sorry about that
Avatar
How did that happen? Missing libcurl.dll or sth?
Avatar
yes, forgot to update libcurl.dll
Avatar
Wow, so fast, Thanks!
06:55
When building with -DVIDEORECORDER=ON option, the following warning is issued by CMake: `` CMake Warning (dev) at /usr/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272 (message): The package name passed to find_package_handle_standard_args (FFMPEG) does not match the name of the calling package (FFmpeg). This can lead to problems in calling code that expects find_package result variables (e.g., _FOUND`) to follow a certain pattern. Call Stack (most rece...
Avatar
@deen I am also getting the same error popup after updating to 13.0 I have redownloaded 13.0 twice from the webpage, but still the same thing.
Avatar
ok, that's too bad
07:08
I hoped that was the fix 😄
Avatar
Well, its not like its rushed or anything, I can just redownload 12.9.2 again while waiting. I was also hoping its just the libcurl.dll
Avatar
It's weird that it works for me in Wine
Avatar
Could be win10 version or a recent update?
07:15
to windows I mean
Avatar
Well that function is deprecated but 12.9.2 works, so it can't be removed yet
07:33
I don't think microsoft does macOS like compatibility hooks checking which version a program is linked on
07:34
@deen how do we get curl for windows? just a download or do we compile that aswell?
Avatar
compile myself
07:34
but I guess this has nothing to do with curl
07:34
we use CryptAcquireContext in system.c
07:35
My guess would be a mingw change and I might now have to statically link in advapi32.a
Avatar
can you even statically link that? it's part of winapi
Avatar
not sure, but the error message seems to say that we're missing that symbol in DDNet.exe, right?
07:40
@deen does mingw come with dumpbin?
07:41
I think it has something similar, maybe you can check with that whether it links with advapi to begin with
07:45
maybe we are missing a linker flag for it? -ladvapi is something we could try (not sure why it worked in the past in that case though)
07:46
@noby can you profile that btw? Instruments is a pretty decent profiler, it'd be nice to see where the CPU is spending much more time
Avatar
So maybe it's not our fault but SDL2 is doing something wrong
07:50
in 12.9.2 I see CryptAcquireContextA only imported from ADVAPI32.dll
07:50
but in 13.0 it's also imported from SDL2.dll
Avatar
yeah, or it's also possible that the cpu is actually used more for the extra pixels, the fan curve on macbooks are VERY steep
07:50
oh you mean that 😄
07:51
huh, SDL2.dll is exporting CryptAcquireContextA?
Avatar
we could also disable hidpi mode somehow maybe?
Avatar
@deen can you dumpbin sdl2.dll aswell, see if it exports that?
07:52
it's also possible that minGW is just tripping balls
07:53
it's a bit annoying that I can't repro in wine
07:55
somehow I can't check exported symbols, only imported ones
Avatar
well if sdl2.dll doesn't even export the symbol it's a problem in mingw
07:55
eh, that's a setback :/
07:57
maybe you can't objdump libraries not created by mingw
Avatar
ah, winedump works, CryptAcquireContextA is not exported in SDL2.dll
Avatar
I wonder why mingws linker thinks it does
Avatar
i dont get double export when i compile with mingw
07:59
using objdump
Avatar
but are you also cross compiling @Deleted User
Avatar
yes
Avatar
what version? maybe I upgraded mingw recently and got a weird update
Avatar
debian bullseye
08:00
need to lookup the verison
Avatar
I verified with winedump and CryütAcquireContextA & CryptGenRandom are imported from SDL2.dll indeed
Avatar
we really should finish up that docker container to compile all this
Avatar
9.3.0-8+22
Avatar
my bet is that we are running into a linking bug, because the thunks have the same locations
08:00
so basically the import table for SDL2 and ADVAPI32 overlap
08:01
I guess I should try downgrading mingw and opening a bug
Avatar
hopefully a downgrade takes care of it
Avatar
@deen are you not using https://github.com/ddnet/ddnet-scripts/blob/master/ddnet-release.sh to create the binary?
The magic scripts that make DDNet run. Contribute to ddnet/ddnet-scripts development by creating an account on GitHub.
Avatar
ok
08:27
bcs i build another projects wich adds more aggressive compiler optimizations and i get the double symbol there too
08:28
but when i use that script i dont xd
Avatar
hm, weird...
Avatar
ok not reltaed to that, but still strange
08:33
are you stripping after the script?
08:33
or doesn't the script
08:33
i think the script does
Avatar
oh yeah its in the cmake txt 😄
Avatar
ok, do you think that might be the problem?
Avatar
i don't think so, but our linker build differently appearently
08:37
so maybe ur right with linker bug, but i also get the double symbol in another project
Avatar
and the other project still works fine?
08:37
I also don't get why it works fine in wine, but no on real windows
Avatar
i tested it around a week ago and it worked then
08:37
but i can also just go into windows and check
Avatar
well it is quite possible that wine is doing some magic to hook that call to CryptAcquireContextA which fixes the issue
Avatar
well i get the error in the other project indeed, but not if not stripped
Avatar
then I'll just try not stripping
Avatar
and i use -s and hide debug symbols in the other project
08:45
u can build and and send it to me @deen
08:45
i can test it
Avatar
how much fat does stripping trim anyway?
Avatar
alot
Avatar
ok, the non-stripped one still has CryptAcquireContextA imported from SDL2, but not overlapped now
08:47
this leads me to believe that the overlap is an intentional optimization by strip
Avatar
oh looks like i have another cmake warning to look into CMake Warning (dev) at /usr/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272 (message): The package name passed to `find_package_handle_standard_args` (FFMPEG) does not match the name of the calling package (FFmpeg). This can lead to problems in calling code that expects `find_package` result variables (e.g., `_FOUND`) to follow a certain pattern. Call Stack (most recent call first): cmake/FindFFmpeg.cmake:82 (find_package_handle_standard_args) CMakeLists.txt:332 (find_package) This warning is for project developers. Use -Wno-dev to suppress it.
08:48
also this
08:48
Can't set BUILD_RPATH in CMake before 3.8, pass -Wl,-rpath,'$ORIGIN' manually if you wish to emulate this. Or just install a newer version of CMake...
08:48
and i have cmake 3.17 xD
Avatar
i fixed that already
08:48
i see
Avatar
only the FFMPEG
08:49
hmm i dont get it now
08:50
(i got that stuff when compiling the aur package)
08:51
btw i found a cool thing, if you use make typing just "make -j" without specifying any core number uses the max number of cores
Avatar
ok, wihtout strip it crashes for me in wine too when loading dlls
08:51
@Ryozuki no it does not 😄
Avatar
well i used a non stripped and it didnt crash
Avatar
that builds with maximum parallelization, so it will run as many processes as possible
Avatar
(compiled by me)
Avatar
If you have a small project it's usually fine, but on a large process this will kill your system and go OOM
08:51
large project*
08:51
xd
Avatar
@deen are u using mingw posix?
Avatar
i saw a project suggesting it in the readme xD
Avatar
I'm using mingw-w64
Avatar
ok i think i have posix default, dunno if the runtime can make a difference
08:53
atleast regarding the crash
08:53
the other thing is regarding stripping 😄
Avatar
why does it even think SDL2 exports that symbol, maybe it's a malformed import table
Avatar
well it creates the same export address
08:55
and in my project its not sdl
08:55
its some weird strip bug
08:55
i wonder if -s flag for mingw uses the linux internal strip
Avatar
When -DANTIBOT=ON is enabled, the following message is issued by CMake even in version 3.17: -- Can't set BUILD_RPATH in CMake before 3.8, pass -Wl,-rpath,'$ORIGIN' manually...
08:57
tee_thinking
Avatar
well @deen said it crashes without the strip too
Avatar
but thats something different
08:59
for me it works when i compile it
Avatar
does it have the double import?
Avatar
btw strip -s DDNet.exe does not remove symbols stripped debugging information removed for me, strangly enough
09:00
but the script uses the linux command doesnt it?
09:03
@deen does it crash for u in debug mode?
Avatar
binutils source is a little too huge to dissect for this bug 😛
Avatar
might also be an SDL2 bug, I'll try downgrading SDL2 later
Avatar
well as i said i dont have sdl in the other project
09:15
still get the error
Avatar
@Deleted User if you are here can you link verbosely?
Avatar
what does that mean?
Avatar
pass --verbose to ld
Avatar
mh ok
Avatar
it should output the linker script which I wanted to take a look at
09:49
dunno if that was passed to ld
09:49
i just added it to cmake linker flags
Avatar
doesn't seem it made it's way to LD
Avatar
mhh
Avatar
it made it to gcc though
09:51
how did you add to linker flags btw?
Avatar
ok i pass it to release maybe it gets overwritten
09:52
looks better now xd
09:52
09:53
but looks same to me
09:53
but it only is verbose when its linking
09:53
so that is mingws linker output
Avatar
that's gccs --verbose output
09:54
not ld's
Avatar
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --verbose")
09:54
what am i doing wrong then
Avatar
hm, maybe try -Wl,--verbose
09:56
yeah thats verbose xd
Avatar
let's see if there is any glaring issue 😛
09:56
fixing an actual binutils bug is a little beyond me
Avatar
but i can just tell to clearify: i use another project and have the acquire error there too(it uses -s flag which just strips too). i don't get any error when i use either my exe or deens exe without stripping
09:58
but deens crashes, mine does not
Avatar
can you dump that exe see if it still has the double import
Avatar
it does not, but it also does not strip correctly when i use strip -s DDNet.exe, i'll try with -s gimme a minute
Avatar
it does not double it
10:02
but in my other project it does xD
10:03
its just random
Avatar
are you stripping with binutils strip btw?
10:03
fd86c90 Fix ffmpeg package name (fixes #2115) - def- 0f49107 Merge #2116 - bors[bot]
Avatar
from mingw?
Avatar
it should be included in mingw yeah
Avatar
well i used linux internal command and -s
10:04
i dunno if i have a mingwstrip
10:04
but according to cmakelist.txt it also just does strip -s
Avatar
there is one in bintools and mingw does come with the entire bintools
10:05
what is the cross compiler called?
10:06
try /usr/bin/x86_64-w64-mingw32-strip
Avatar
well i use mingw64
10:08
ok used the mingw strip and it stripped, but no double symbol
10:08
but that doesnt mean its working
10:08
i'll try it in windows now, if it doesnt work, it might be related to windows
Avatar
The PE executable format is extremely finicky from what I can see from that linker script and the dozens of workarounds in ld's source
10:10
it is entirely possible that stripping with a different version of binutils or one that might be missing the mingw plugin could cause issues
Avatar
yeah for me all versions work: no strip strip with linux strip strip with mingw strip
10:12
and in my other project it does not
10:12
doing nothing else xd
Avatar
I guess it is indeed a mingw/binutils issue, the best we can do is create an issue about it
Avatar
well the question is does mingw -s use mingw strip or linux strip
Avatar
mingw -s?
Avatar
compiler flag
Avatar
you can pass -s to the compiler too?
Avatar
yes
10:14
bcs in the other project it uses -s, maybe deens strip does what mingw's -s does too
10:14
or its random
10:14
xD
10:15
maybe deen should use mingw's strip
10:15
but deens version without stripping worked, except it crashes
Avatar
he can try but I doubt that's the issue, even without stripping it was broken
Avatar
but not bcs no ddl entry was missing
Avatar
why must microsoft make everything so hard for everyone?
Avatar
maybe they had a bug or changed it, and mingws wrapper call breaks it currently or smth
10:16
like there is no fall back
10:17
but its too strange that the symbol is double tho
10:17
its pure random
10:18
i also don't find any issue regarding this, but the fact that 2 completly different projects have the same error
10:18
makes me wonder nobody reportet it
Avatar
It'd be nice if we could all agree on an executable format, ELF is nice and it can even be extended
10:19
@Deleted User It probably triggers in pretty specific circumstances
10:20
I saw one more person ask about it on stackoverflow but no one could reply
Avatar
well atleast u found smth xd
Avatar
I've a go binary(lets call A) using two dll's (B and C) via cgo. Both dll's are written with c++ and doesn't depend to any windows libraries so no explicit linking was done for any winapi dlls. cgo
10:21
This guy seems to have very meh english and doesn't describe the issue well, but there it is advapi functions ending up in different/wrong dlls
10:26
I don't even know if we can write a minimal testcase for this while reporting tbh
Avatar
well anyway the other project doesnt work at all without or with strip. so you really just have to report its not reproducable
10:28
well except you use the excat versions of deens arch linux and the current ddnet github maybe
Avatar
okay I give up, PE is just too complex for my mortal eyes
10:42
also I ran out of music
10:56
cac164c Don't emit the CMake rpath warning for CMake >= 3.14 - heinrich5991 0c51c0d Merge #2117 - bors[bot]
Avatar
its probably about this http://mingw.org/wiki/MixingCompilers i tried changing the linkers to mingw-ld without success
Avatar
so I should build SDL2 myself?
Avatar
well i dunno
11:04
test it out i have 0 plan xD
Avatar
to me this sounds like an unrelated issue
Avatar
but i remember i build the libs for my project too a longer time ago, so maybe thats it
11:06
i'll try it out for my project and give u feedback
11:09
@deen it indeed worked now
11:09
so yes
11:09
u need to build sdl for mingw yourself XD
11:10
will probs work
11:10
ah, sdl2 also provides development libs for mingw
11:11
i always used the VS ones I think?
Avatar
yeah i think ddnet uses vs ones
Avatar
that's the other problem, if I provide mingw ones, then maybe we get other problems when someone builds in visual studio
11:12
so we need both?
Avatar
probably the best way
11:12
@heinrich5991 does adding set(CMAKE_LINKER x86_64-w64-mingw32-ld) set(CMAKE_AR x86_64-w64-mingw32-gcc-ar) set(CMAKE_RANLIB x86_64-w64-mingw32-gcc-ranlib) to the mingw toolchain makes sense?
Avatar
Although Microsoft documents this function as internal, it is unofficially unlikely to go away. The Chrome project, MinGW, Firefox and Rust all rely on this syscall directly. https://docs.microsof...
Avatar
I don't know. I can try
11:30
/usr/lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld: CMakeFiles/DDNet.dir/objects.a(system.c.obj):system.c:(.text+0x579e): undefined reference to `RtlGenRandom' /usr/lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld: CMakeFiles/DDNet.dir/objects.a(system.c.obj):system.c:(.text+0x5878): undefined reference to `RtlGenRandom' /usr/lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld: CMakeFiles/DDNet.dir/objects.a(system.c.obj):system.c:(.text+0x58e2): undefined reference to `RtlGenRandom'
Avatar
interesting. I don't get the error locally 😦
11:35
@deen can you try again? I pushed another version
Avatar
@heinrich5991 works for me in wine
11:41
sent exe to Jupstar for windows verification
Avatar
in the struct CSwitchTile from mapitems.h class CSwitchTile { public: unsigned char m_Number; unsigned char m_Type; unsigned char m_Flags; unsigned char m_Delay; }; where can i find what m_Flags contains?
Avatar
search how its used
Avatar
didnt find anything in reasonable time
11:54
so i figured someone here might either know it or find it a lot faster
Avatar
it looks like they're the normal tile flags
11:57
i.e. rotation, mirroring
Avatar
so for Jupstar it crashes, not sure why
Avatar
dc9b334 Add SDL2 mingw libs, straight from libsdl.org - def-
12:25
[ddnet/ddnet-libs] New branch created: pr-sdl2-mingw
Avatar
@heinrich5991 any hint for how to best use these paths?
Avatar
@deen add them to the set_extra_dirs_lib function
12:48
in CMakeLists.txt
12:52
if(TARGET_BITS AND TARGET_OS) set(DIR "ddnet-libs/${NAME}/${TARGET_OS}/lib${TARGET_BITS}") if(TARGET_OS STREQUAL "windows") if(MSVC) list(APPEND DIR "ddnet-libs/${TARGET_OS}/lib${TARGET_BITS}/vc") else() list(APPEND DIR "ddnet-libs/${TARGET_OS}/lib${TARGET_BITS}/mingw") endif() endif() [...] endif() (edited)
12:52
@deen ^
Avatar
btw, the libsdl.org sdl2.dll for mingw also didn't fix the issue, so now I'm building my own
12:53
thanks
Avatar
fbe1a16 Add SDL2 mingw libs, straight from libsdl.org - def-
13:11
efe97ac Add SDL2 to lib build instructions - def-
Avatar
@deen do you understand this error? W: The repository 'https://dl.yarnpkg.com/debian stable Release' does not have a Release file. E: Failed to fetch https://dl.yarnpkg.com/debian/dists/stable/main/binary-amd64/Packages 503 No healthy IP available for the backend
13:18
doesn't seem to be related to the change
Avatar
yeah, can't reach dl.yarnpkg.com
13:22
infrastructure problem i guess
13:24
Hm, why do I still need SDL2.lib when I build my own SDL2.dll
Avatar
windows dynamic linking works like this: you build a library that you statically link that takes care of dynamically linking the actual dll
13:25
(as far as I understand it; I read a bit about it, but I haven't looked into it in that much detail)
Avatar
so how do i get the .lib file?
13:25
building SDL2 didn't create it
Avatar
hm, it should
Avatar
and the official SDL2 mingw version also doesn't contain a .lib file
Avatar
hm ok
Avatar
it does
Avatar
\x86_64-w64-mingw32\lib\
Avatar
currently don't have time to investigate, and I'm probably not being helpful, I'll just leave for now
Avatar
libSDL2.dll.a
13:27
it probs static links the shared api for the shared library
13:28
(ok its not a .lib file like for vs) but its a normal static lib u have to link against
Avatar
make[3]: *** No rule to make target 'ddnet-libs/sdl/windows/lib64/SDL2.lib', needed by 'DDNet.exe'. Stop.
Avatar
b0d8341 Add SDL2 mingw libs, straight from libsdl.org - def-
Avatar
ok, works now
Avatar
1d5ca07 Add self-compiled SDL2 mingw libs - def-
Avatar
had to remove CMakeCache.txt
13:39
finally, runs fine in wine
13:39
please test on Windows if client starts fine: https://ddnet.tw/DDNet-13.0-win64.zip
Avatar
beeac36 Add self-compiled SDL2 mingw libs - def-
Avatar
@deen works for me 😄
13:42
was it with self compiled libs now?=
Avatar
ok
Avatar
thanks for the hint @Deleted User
Avatar
well i looked thorugh SDL and only saw that for WinRT it compiles cpp code too
13:43
dunno if that is enabled by default
Avatar
Will release in the evening, see you
Avatar
or mingw isnt downward compatible to all types of c dlls
13:43
cya
Avatar
could we have the freeze stars for other tees in /showothers also be transparent and maybe hammer / hook sounds could also be less volume?
Avatar
Just a small fix to let the client not try to get high fps, when it "thinks" it didn't render for a long time. (is still affected by the SDL check "if window has input" at the cl_refresh_rate calculation, so not a 100% fix).
Avatar
888223a Change last render logic, when inactive - Jupeyy 65673ab Merge #2119 - bors[bot]
Avatar
hello
16:09
i have problem
16:09
whern i try to convert my demos to .mp4 my ddnet crash (edited)
16:10
16:10
Avatar
relevant part: [2020-04-07 18:00:38][datafile]: loading data index=15 size=13883 uncompressed=262144 [2020-04-07 18:00:38][demo_render]: ppp.demo.mp4 [NULL @ 0x55978136e520] Requested output format 'mp4' is not a suitable output format [2020-04-07 18:00:38][video_recorder]: Failed to create formatcontext for recoding video. [2020-04-07 18:00:39][datafile]: loading data index=16 size=88 uncompressed=152 [...] [2020-04-07 18:00:40][datafile]: loading data index=25 size=620 uncompressed=2888 [2020-04-07 18:01:00][video_recorder]: called Erreur de segmentation (core dumped)
Avatar
and ?
Avatar
sorry, wasn't directed at you
16:12
just in case someone wanted to take a quick look without downloading the log
16:12
I don't know about the video recorder tbh
Avatar
ah ok
16:13
np
16:13
:3
Avatar
cd9611a Add self-compiled SDL2 mingw libs - def-
Avatar
ChillerDragon 2020-04-07 16:45:31Z
lmao just wasted some hours of life the create a bash script that generates bash code using sed to prepare sed statements
Avatar
it s for me ?
justatest 1
Avatar
🤦🏻‍♂️
Avatar
ChillerDragon 2020-04-07 16:47:27Z
@Deleted User nah its for my vim config 😄
16:47
ur free to use it as well 😄
Avatar
@deen does replacing "${EXTRA_CURL_LIBDIR}/libcurl.dll" with "${CURL_LIBRARY}" in cmake/FindCurl.cmake help?
Avatar
@heinrich5991 yes, that worked, but now it doesn't find SDL2. Maybe I should just get rid of the VS version
Avatar
@deen do the same to the line with SDL2.dll in cmake/FindSDL2.cmake
Avatar
6e0706c Add self-compiled SDL2 mingw libs - def-
Avatar
sorry, couldn't follow what happened today
19:55
@deen does it work if we compile our own SDL?
Avatar
25 AM] Learath2: @onby well highdpi effectively multiplies the resolution maybe the computer is genuinely having trouble getting out all the pixels [1:26 AM] Learath2: Does it atleast look sharper? it changes the way the font looks i guess
20:04
but the change isnt worth making the fans spin and it would be cool if it could be disabled in newer versions
Avatar
if it's just the font we are probably doing sth wrong about highdpi anyway
Avatar
Maybe the rest of the texture is not high-res enough, so you don't see a difference. The text renderer automatically uses a bigger font size if resolution goes up
Avatar
you can look for the rounded corners on rectangles, those should look better
Avatar
but highdpi will definitely increase gpu load, so the fans start spinning
Avatar
high dpi cant be turned off on new ddnet it seems?
Avatar
@Learath2 maybe we can give an option to disable hidpi?
20:13
pls
Avatar
definitely, we should also steal some of the highdpi code from 0.7 we are doing some things wrong, but 0.7 has most of it right
20:15
(atleast for macOS
20:15
)
Avatar
nonononono
20:18
no
20:18
0.7 is ass
20:18
it makes my fans spin so hard
20:19
and it doesnt even let me change the resolution atall
Avatar
it has an option to turn off highdpi
Avatar
does it come at the expense of those two things^
Avatar
try gfx_highdpi 0 in 0.7
Avatar
ohhhhh wow
20:20
20:20
etf
Avatar
etf?
20:21
cus its cutting off
20:21
half of the ui
Avatar
Trafalgar Law 2020-04-07 20:24:47Z
the fuck
Avatar
looks like the clipping is broken
Avatar
Trafalgar Law 2020-04-07 20:24:50Z
Thats looks not good
0️⃣ 1
7️⃣ 1
saddo 1
Avatar
open an issue in tw repo
Avatar
i kindof gave up on that
20:25
after the resolution bug has been a "known bug" for like a year
20:25
and noones tried to fix it
20:25
i literally cant see what i type in the chat lol
Avatar
I know what's brokebn
20:26
wait I'm not sure anymore, I patched SDL so much to get 0.7 working
20:26
@noby is your resolution set to the desktop resolution?
20:26
i want windowed 1024x768 like i have on ddnet
Avatar
put it to desktop resolution so we can test it
20:27
oh here are my settings
20:27
uuh
20:27
that will make me lag even more but ok
Avatar
or you can patch the source to allow arbitrary resolution
20:27
but don't toggle fullscreen
Avatar
backend_sdl.cpp L703, put 702 703 704 in a block
Avatar
what the hell
20:29
it changes my resolution back to 1280x800
20:29
no matter what i do
20:29
even if i change it in settings.cfg
Avatar
those are the lines that forces it
20:29
20:30
put it in a block like this and it'll stop forcing the resolution
Avatar
@Learath2 yes, compiling our own SDL fixed it
Avatar
@deen guess cross-compiling with mingw is different from compiling with mingw on windows
20:31
interesting
Avatar
b387894 Add self-compiled SDL2 mingw libs - def-
Avatar
@noby is that with highdpi off?
Avatar
you can turn it on and off right?
Avatar
idk if it needs restart but yes
Avatar
it shouldn't break anything
20:32
great
20:32
does it change gpu/cpu usage?
Avatar
yes i get noticeably better fps in 0.7 with it turned off aha
20:33
but it clips the ui
20:34
that is another thing that suggests that ddnet needs the option to turn off high dpi support
Avatar
on windows there's a built-in way to disable hidpi, didn't know mac osx doesn't have one
Avatar
oh cmon, @noby why didn't you say it broke clipping
Avatar
yessssss thank u xd
20:38
uh
20:39
because i just found out about it two seconds ago?
20:39
i hadnt thought to try gfx_highdpi 0
Avatar
until u suggested it
Avatar
I think there's a way to get the logical vs physical resolution
Avatar
i dont have that problem on 06
Avatar
which is probably what we need here
Avatar
The resolution you get from GL_Drawablesize is the resolution we should be rendering in
20:40
we already do that
20:40
@noby is that 0.7 master btw?
20:40
i can try
20:41
its on my test client based on 0.7.3.1
Avatar
can you try master instead, just so I don't try to hunt down a bug that no longer exists
20:41
#if defined(CONF_PLATFORM_MACOSX) // Todo SDL: remove this when fixed (game freezes when losing focus in fullscreen) { SdlFlags |= SDL_WINDOW_FULLSCREEN_DESKTOP; // always use "fake" fullscreen *pWindowWidth = *pDesktopWidth; *pWindowHeight = *pDesktopHeight; }
20:41
just that?
Avatar
yeah, that should get you windowed gfx at any resolution
Avatar
btw are you on catalina?
20:43
The clipping issue happens when m_ScreenWidth and m_ScreenHeight in the graphics backend don't match the actual resolution
20:43
yes same issue on master
Avatar
@noby are you on macOS Catalina?
Avatar
@Learath2 should I merge the hidpi change and my sdl2 and try to release a new one? Or do you still need to fix the clipping thing?
Avatar
@deen nah, clipping thing is not an issue in ddnet
Avatar
"Use Highdpi" → "Use high DPI"
Avatar
@noby can you add a debug print before and after SDL_GL_GetDrawableSize and print the resolution?
Avatar
SDL_GL_GetDrawableSize(m_pWindow, pScreenWidth, pScreenHeight); // drawable size may differ in high dpi mode
20:45
OK
Avatar
*pScreenWidth and *pScreenHeight that is
Avatar
there are like 4 resolutions right there so it can get a little confusing which one to print 😛
Avatar
0 -1 -1 1 2560 1600
20:46
lol
20:46
SDL_GetWindowSize(m_pWindow, pWindowWidth, pWindowHeight); printf("0 %d %d\n", *pScreenWidth, *pScreenHeight); SDL_GL_GetDrawableSize(m_pWindow, pScreenWidth, pScreenHeight); // drawable size may differ in high dpi mode printf("1 %d %d\n", *pScreenWidth, *pScreenHeight);
Avatar
is that with gfx_highdpi 1 or 0?
Avatar
try with 1 too please
Avatar
Trafalgar Law 2020-04-07 20:47:16Z
gfx_highdbi for ddnet?
Avatar
[2020-04-07 15:47:10][client]: starting... 0 -1 -1 1 2560 1600 [2020-04-07 15:47:11][sdl]: SDL version 2.0.8 (dll = 2.0.8) [2020-04-07 15:47:11][render]: opengl max texture sizes: 16384, 2048(3D)
20:47
mm
20:47
highdpi fixes the clipping
20:47
but causes fan spinning
20:47
the "better font but horrible cpu usage" seems to be the same problem for ddnet high dpi and also 0.7
Avatar
ooh, i bet this is some macOS issue again
Avatar
see how you set gfx_highdpi and the drawable resolution doesn't change?
20:48
that's not supposed to happen
20:48
i see
Avatar
[2020-04-07 23:49:03][DEBUG]: 1920 1200 when I set gfx_highdpi 0
Avatar
do u have high dpi screen? do u have osx
Avatar
[2020-04-07 23:49:43][DEBUG]: 3840 2400 when I set gfx_highdpi 1
Avatar
macOS catalina on a macbook pro, with a high dpi screen
20:50
so it works for u?
Avatar
yeah it works fine for me, but I'm wondering whether it's my patched up SDL
20:50
nope, doesn't seem to be
20:51
b387894 Add self-compiled SDL2 mingw libs - def- 17e699a Merge pull request #4 from ddnet/pr-sdl2-mingw - def-
Avatar
@deen you can merge highdpi if you want, but I'm not certain how it behaves on windows
Avatar
the default is what we have right now, so I guess it's ok even if it doesn't work great
Avatar
@noby I have an idea, can you try sth for me?
20:53
git cherry-pick 013682a6
Avatar
on master
20:55
well i'm not sure if that commit will resolve though, so you might need to add my repo as a remote
Avatar
yeah on 0.7
Avatar
nobody1s-MacBook-Pro:teeworlds-master nobody1$ git cherry-pick 013682a6 fatal: Not a git repository (or any of the parent directories): .git ..xd
20:56
i suppose i should clone it
Avatar
no no
Avatar
well its not a git repo
20:56
i just downloaded zip
Avatar
388d792 Add an option for highdpi - Learath2 9bb20ae Merge #2120 - bors[bot]
Avatar
nobody1s-MacBook-Pro:teeworlds nobody1$ git cherry-pick 013682a6 fatal: bad revision '013682a6'
20:56
o
Avatar
A retro multiplayer shooter. Contribute to Learath2/teeworlds development by creating an account on GitHub.
Avatar
git remote add l2 https://github.com/Learath2/teeworlds.git
20:57
git fetch l2
20:57
that should fetch my commits, then you can cherry-pick
Avatar
nobody1s-MacBook-Pro:teeworlds nobody1$ git cherry-pick 013682a6 error: could not apply 013682a68... Implement runtime resizing hint: after resolving the conflicts, mark the corrected paths hint: with 'git add <paths>' or 'git rm <paths>' hint: and commit the result with 'git commit' nobody1s-MacBook-Pro:teeworlds nobody1$
Avatar
conflicts??
Avatar
  • [new branch] fngspoof -> l2/fngspoof what is this o_o
Avatar
huh no idea, I wonder what I was doing with that branch
20:58
lol
20:58
yeah idk why conflicts
20:58
A retro multiplayer shooter. Contribute to teeworlds/teeworlds development by creating an account on GitHub.
20:59
then did the commands u otld me
Avatar
@noby well do a git status
Avatar
nobody1s-MacBook-Pro:teeworlds nobody1$ git status On branch master Your branch is up to date with 'origin/master'. You are currently cherry-picking commit 013682a68. (fix conflicts and run "git cherry-pick --continue") (use "git cherry-pick --abort" to cancel the cherry-pick operation) Changes to be committed: modified: src/engine/client/graphics_threaded.cpp modified: src/engine/client/input.cpp modified: src/engine/graphics.h modified: src/game/client/components/menus_scrollregion.cpp modified: src/game/client/components/menus_settings.cpp Unmerged paths: (use "git add <file>..." to mark resolution) both modified: src/engine/client/backend_sdl.cpp both modified: src/engine/client/backend_sdl.h both modified: src/engine/client/graphics_threaded.h
Avatar
yeah no, do a git cherry-pick --abort
21:00
do i have to manually fix the sdl include paths again
Avatar
then do a git checkout 013682a68 instead
Avatar
src/engine/client/input.cpp:3:10: fatal error: 'SDL.h' file not found #include "SDL.h" ^~~ 1 error generated.
21:00
heh
21:00
looks like i do
Avatar
is that after you aborted the cherry pick and checked out that commit?
Avatar
after abort, before checkout
21:01
i typed bam
21:01
and
21:01
im not surprised, i always have to fix this manally
Avatar
I wonder what's wrong with your installation of SDL
Avatar
by changing "SDL.h" to <SDL2/SDL.h>
21:01
a646f75 Provide MinGW SDL2 - def- 2f77e1f Version 13.0.1 - def- 6dd7078 Merge pull request #2118 from def-/pr-mingw-sdl2 - def-
Avatar
I think cmake should handle that better noby
21:02
i use abm
Avatar
Avatar
ill try cmake
Avatar
well it works with bam too for me, but your computer is weird 😛
Avatar
that runtime resizing patch should allow AppKit to resize the window to the correct size
Avatar
sounds good
21:03
im compiling rn
Avatar
if that doesn't work either, then idk why that surface is larger then it reports
21:03
oh can you also add a dbg_msg?
Avatar
lol it worked wit cmake wtf
21:03
where
Avatar
SDL_WINDOWEVENT_SIZE_CHANGED
21:04
uh
Avatar
right below there, just add a dbg_msg("DEBUG", "o/");
Avatar
what was i supposed to test again
Avatar
well that clipping issue happens when the client is using the wrong resolution, but opengl reports a smaller drawable resolution
21:05
so I was thinking maybe that window is resized by AppKit after launch when it knows we can do highdpi
Avatar
the debug msgs never comes up
Avatar
can you try one last thing? then I need to go sleep anyway 😛
Avatar
i tried case SDL_WINDOWEVENT: dbg_msg("DEBUG", "asdfasdf"); and that msg came up
21:06
but not the one u said
21:06
ok
Avatar
oh I wonder what event we get
21:07
can you print Event.window.event before we try the other thing?
Avatar
[2020-04-07 16:07:18][client]: WARNING: netversion hash differs EVENT 4 EVENT 1 EVENT 3 EVENT 10 EVENT 12 [2020-04-07 16:07:18][engine/mastersrv]: saving addresses [2020-04-07 16:07:18][datafile]: loading data index=6 size=76 uncompressed=152 [2020-04-07 16:07:18][datafile]: loading data index=7 size=57 uncompressed=152 [2020-04-07 16:07:18][datafile]: loading data index=8 size=76 uncompressed=152 [2020-04-07 16:07:18][datafile]: loading data index=9 size=4831 uncompressed=31768 EVENT 11 EVENT 13
21:07
on launch
21:07
on clicking the "play" button: EVENT 12 EVENT 10 [2020-04-07 16:07:27][pFont]: memory usage: 3145728 [2020-04-07 16:07:27][pFont]: memory usage: 4194304 EVENT 11 EVENT 13
21:08
on joining a server: EVENT 12 EVENT 10 EVENT 11 EVENT 13 EVENT 12 EVENT 10 [2020-04-07 16:07:40][client]: disconnecting. reason='unknown' ... [2020-04-07 16:07:41][client/network]: loading done EVENT 11 EVENT 13 [2020-04-0
Avatar
that's for windowevent only right?
Avatar
case SDL_WINDOWEVENT: printf("EVENT %d\n", Event.window.event); ye
Avatar
okay, this will be horrible for performance but lets see if it helps
21:09
instead of that printf put Graphics()->UpdateScreenSize(); there
Avatar
windowevent?
21:10
on any window event, just update the screensize
Avatar
printf or just update
Avatar
don't printf, just that graphics command
21:11
fanspinny but clipping goes awy
21:11
:o
Avatar
Who would have guessed a race condition in macOS SDL
21:12
can you check which version of SDL it's running with?
21:12
it should be output in the console
Avatar
[2020-04-07 16:07:17][sdl]: SDL version 2.0.8 (dll = 2.0.8)
Avatar
I'd ask you to test with a newer version, but the pain of doing library work on macOS is not something I'd wish on anyone
Avatar
shouldnt it ultimately work no matter what version someone has
Avatar
well no, if SDL itself has bugs
21:14
there are many macOS bugs in SDL
Avatar
I wonder when SDL_GL_GetDrawable starts returning the correct size
21:15
if we knew at which point the resolution is correct, we could make it work for all versions
Avatar
how to test
Avatar
@noby what is in client.m in that patch btw?
21:16
is it my updated version? that might help
Avatar
ah yes, that's what's breaking things
21:18
wait oy merged my pull
21:18
how do you still have that client.m? 😄
21:18
oh that commit has that client.m
21:18
I'm stupid
Avatar
git cherry-pick 7f602078e
21:19
I think that should work
Avatar
nobody1s-MacBook-Pro:teeworlds nobody1$ git cherry-pick 7f602078e error: commit 7f602078e4d9543f4182ed63654ad4dd20b528f0 is a merge but no -m option was given. fatal: cherry-pick failed
Avatar
uhm wait are we on a detached head?
21:20
git checkout -b testbranch
21:20
git merge l2/tw_pr_sdldelegate
21:21
Avatar
wat am i testing here
Avatar
@noby remove the updatescreensize thing on WINDOWEVENT
21:23
add a dbg message to WINDOWEVENT_RESIZED THINGOMAJIG
21:24
SDL_WINDOWEVENT_SIZE_CHANGED this one
21:24
highdpi 0 and 1 both should work
21:24
hopefully
21:24
or I'll just cry
Avatar
case SDL_WINDOWEVENT: Graphics()->UpdateScreenSize(); printf("EVENT %d\n", Event.window.event); switch(Event.window.event) { #if defined(CONF_PLATFORM_MACOSX) // Todo SDL: remove this when fixed (mouse state is faulty on start) case SDL_WINDOWEVENT_MAXIMIZED: MouseModeAbsolute(); MouseModeRelative(); break; #endif case SDL_WINDOWEVENT_SIZE_CHANGED: dbg_msg("DEBUG", "o/"); Graphics()->UpdateScreenSize(); break; } break;
21:25
this is already there
21:25
should i just comment out the updatescreensize
Avatar
comment out the first updatescreensize
21:25
the rest can stay the same
Avatar
clipping was broken for you when highdpi was 0 right?
21:26
and either i fcked something up or its still broken
Avatar
is it still broken like this?
Avatar
also did we get a o/ in the log? 😄
Avatar
okay so we don't get a o/ which means we didn't get lucky
21:28
I hoped it was just the broken event loop in that client.m which was not allowing the resize event through
Avatar
cant it just updatescreensize less often
Avatar
but I guess not, debugging any further is just too hard
Avatar
since that seemed to fix it
21:28
rip
Avatar
@noby well I know one more place we can check
21:29
uncomment that top updatescreensize
21:29
find updatescreensize, and add a dbg msg above and below GL_GetDrawablesize
21:30
case SDL_WINDOWEVENT: Graphics()->UpdateScreenSize(); printf("EVENT %d\n", Event.window.event); switch(Event.window.event)
21:30
so do that again in input
21:30
and put back the dbg messages in backend_sdl?
21:30
void CGraphicsBackend_SDL_OpenGL::GetScreenSize(int *pScreenWidth, int *pScreenHeight) { SDL_GL_GetDrawableSize(m_pWindow, pScreenWidth, pScreenHeight); } void CCommandProcessorFragment_SDL::Cmd_Resize(const CCommandBuffer::SCommand_Resize *pCommand) { SDL_SetWindowSize(m_pWindow, pCommand->m_Width, pCommand->m_Height); int Width, Height; SDL_GL_GetDrawableSize(m_pWindow, &Width, &Height); glViewport(0, 0, Width, Height); } SDL_GetWindowSize(m_pWindow, pWindowWidth, pWindowHeight); SDL_GL_GetDrawableSize(m_pWindow, pScreenWidth, pScreenHeight); // drawable size may differ in high dpi mode
21:30
there are three instances of getdrawablesize
Avatar
oh wait there is no GL_Getdrawablesize there
Avatar
which one should i add dbg to
Avatar
okay it's a little different then I remembered, go to L929 instead
21:32
put the dbg above and below m_pBackend->GetScreenSize
21:32
in which file?
21:32
neither one are that long
Avatar
graphics_threaded.cpp
Avatar
this really is the last thing we can check, after this we need to hook into or debug sdl, or go even further and debug AppKit, which is not fun nor something I can really walk you through given I wouldn't even know where I myself would begin 😛
Avatar
[2020-04-07 16:33:34][client]: WARNING: netversion hash differs 0: 2560 1600 1: 1280 800 EVENT 4 0: 1280 800 1: 1280 800 EVENT 1 0: 1280 800 1: 1280 800 EVENT 3
21:34
this is with highdpi 0
Avatar
oh that's interesting
21:34
how/when did it become 2560 1600?
Avatar
¯\_(ツ)_/¯
21:35
thats the size of my screen
Avatar
I think that's highdpi resolution
21:35
try setting the window smaller, see if it's 2x again
21:36
or if it's the desktop resolution
Avatar
the window cant be set smaller thats the whole problem i thoughtr
Avatar
didn't we patch that first?
21:37
i change in settings.cfg
21:37
1024x768
21:37
and it changes it back to 1280x800
Avatar
remember that block patch in backend_sdl.cpp?
21:37
L701 702 703
21:37
you can do that again
21:37
that only breaks fullscreen toggle which we won't do
21:38
oh the line numbers might have changed with the patches
21:38
wow
21:38
finally
Avatar
what does the console look like?
Avatar
0: 1600 1200 1: 800 600 EVENT 1 0: 800 600 1: 800 600 EVENT 3 0: 800 600 1: 800 600
Avatar
see that 1600 1200 is verywrong
21:39
this is with highdpi 0 right?
Avatar
i put 800x600
21:39
yes
Avatar
that initial 1600 1200 is what breaks the clipping
21:40
if we figure out where that comes from, that's a bug fixed
21:41
You can check the return of SDL_GL_GetDrawableSize in Init, hopefully it's there
Avatar
in backend_sdl.cpp
Avatar
/Users/nobody1/Downloads/teeworlds/src/engine/client/backend_sdl.cpp:754:26: error: cannot pass expression of type 'void' to variadic function; expected type from format string was 'int' printf("returned %d\n", SDL_GL_GetDrawableSize(m_pWindow, pScreenWidth, pScreenHeight)); // drawable size may differ in high dpi mode
21:45
it doenst return anything
Avatar
lol not like that
21:46
that function returns in pScreenWidth, pScreenHeight
21:46
ok
Avatar
so print *pScreenWidth, *pScreenHeight after calling it
Avatar
[2020-04-07 16:46:12][client]: starting... 800 600
Avatar
see at some point, the resolution becomes 1600 1200, idk how that is possible
21:48
we only seem to modify m_ScreenHeight and m_ScreenWidth there, except for code I added for the runtime resizing
21:48
and all of my modifications of it go through UpdateScreenSize
21:48
Well if you are up for it we can try a watchpoint tomorrow
21:49
if u tell me how
Avatar
watchpoints are very nice debugging tools
21:50
they watch a section of memory for change and if it changes it breaks so you can see what changed it
21:52
that sounds like it would be useful for this
Avatar
sleep is required
21:52
cya @noby, thanks for sticking around and debugging this
21:53
leme know if u want to try more tmrw
Avatar
@deen where do you get that SDL2.framework?
22:40
it seems to have a wrong path for hidapi in it
Avatar
not our fault, sdl2.0.12 seems to be linking weirdly
22:54
idk how @rpath is supposed to work exactly but the path it links to for hidapi feels like it should be "@rpath/Frameworks/hidapi.framework"
Exported 730 message(s)