02:03 <+bridge> Can anyone give me some thought on how to find out what is in the camera so visible to the player with the zoom level. 02:03 <+bridge> Would then use the information to compare to a rect and the camera automatically has that field or rect in the center. 02:13 <+bridge> it probably is stored in memory 02:13 <+bridge> unless you want to actually edit the source code 02:13 <+bridge> it probably is stored in memory, where the top left of the camera is 02:13 <+bridge> it probably is stored in memory, where the top left of the camera is (in the world) 02:27 <+bridge> @KDaniel wdym 02:28 <+bridge> are u talking about that : https://github.com/ddnet/ddnet/blob/master/src/game/server/entity.cpp#L90 02:29 <+bridge> i want to calculate the view of the camera like im on camera position 10 10 and the zoom level is 12 then i want 2x vec2 to get the rectangle of view 02:33 <+bridge> example image for better understanding.. hard to explain for me 02:33 <+bridge> https://cdn.discordapp.com/attachments/293493549758939136/1063994322359418931/image.png 02:34 <+bridge> I can calculate the green box but not the red box of the current camera view 02:42 <+bridge> do you have the current position of the tee? 02:43 <+bridge> do you have the current position of the tee? or let me rephrase. is the tee in the center of that red box? 02:46 <+bridge> so like, will it be like you have to hold tab and use the scroll wheel? 02:46 <+bridge> no the tee is not at the center 02:48 <+bridge> the input parameters and specified output would help :) 02:48 <+bridge> <丿丨v丨丿> how to fix it:oop: 02:48 <+bridge> <丿丨v丨丿> https://cdn.discordapp.com/attachments/293493549758939136/1063998112219275264/image.png 02:48 <+bridge> just tried to find x/y position using CE and the hud. they seem to hide it. 02:49 <+bridge> just tried to find x/y position using CE and the hud. they seem to hide it. can't help then. sorry. 02:49 <+bridge> either wheel or drag the scrollbar with the cursor like normally 02:49 <+bridge> just tried to find x/y position using CE and the hud. they seem to hide it. can't help then. sorry. not interested to unrandomize the values. 02:49 <+bridge> i think its better to use scroll wheel, unless you want a seperate cursor just for that menu 02:49 <+bridge> like in emotes 02:50 <+bridge> even then you can still look around holding tab 02:51 <+bridge> just tried to find x/y position using CE and the hud. they seem to hide it. can't help then. sorry. not interested to unrandomize the values at 02:50 in the night. 02:51 <+bridge> cursor is more intuitive for new people who don't know the shortcuts 02:51 <+bridge> fair 02:52 <+bridge> i use cursor for zoozing 03:30 <+bridge> i think 03:30 <+bridge> ``` 03:30 <+bridge> float ScreenX0, ScreenY0, ScreenX1, ScreenY1; 03:30 <+bridge> Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1); 03:30 <+bridge> ``` 03:30 <+bridge> i think this is my solution 11:33 <+bridge> nice. would be nice to fix this error, though it could be tricky if this undefined behavior has always been part of the shapshot compression. 11:35 <+bridge> i named myself `ᴷᵉᵏᶳ` over a bind 11:35 <+bridge> 11:35 <+bridge> then in F1 typed `player_name nae` 11:35 <+bridge> as soon as the server confirmed the name change it happened 11:43 <+bridge> doesn't seem to work for me locally :/ 11:44 <+bridge> u need the client version that still prints the errors 11:44 <+bridge> or add it back, i tested it on multiple ddnet servers 11:45 <+bridge> I'm on current master with the errors enabled again 11:45 <+bridge> mhh let me test 11:48 <+bridge> for me it still happens: 11:48 <+bridge> 37.230.210.231:8344 11:48 <+bridge> 11:48 <+bridge> even renaming to keks 11:49 <+bridge> i uncommented this lines: 11:49 <+bridge> https://github.com/ddnet/ddnet/commit/b62e7f1299fc672e210a761caba7780d6ee9d06a 11:52 <+bridge> well weird it behaves different between us 11:52 <+bridge> 11:52 <+bridge> i use clang 16 on debian linux 11:52 <+bridge> 11:52 <+bridge> i dunno if this could be simly because the compiler compiles it differently 11:52 <+bridge> 11:52 <+bridge> but i am sure it also happened on gcc 11:52 <+bridge> 11:52 <+bridge> so maybe bcs my pc runs faster, or bcs linux/windows difference 11:53 <+bridge> or network/ping 11:54 <+bridge> btw `in_range` is that even a save template parameter? 11:54 <+bridge> 11:54 <+bridge> can't long be 32-bit on a 32-bit computer? 11:54 <+bridge> btw `in_range` is that even a safe template parameter? 11:54 <+bridge> 11:54 <+bridge> can't long be 32-bit on a 32-bit computer? 11:57 <+bridge> ah, should probably use `int64_t` 11:59 <+bridge> if there is smth that helps you understanding the problem just ping me, i can reprod it even in debug build 11:59 <+bridge> `debug: sizeof(int)=4 sizeof(long)=4 sizeof(int64_t)=8` 11:59 <+bridge> yeah, I guess the check never worked on my Windows system 11:59 <+bridge> oh ok 😄 12:00 <+bridge> now I get the error immediately when renaming 17:41 <+bridge> Uf, is that really the prettiest way to write `add_int_wrap`? I'm really not a huge fan of the random 64 assumption in there 17:55 <+bridge> Our assumption that int's are 4 bytes also annoys me 😛 17:56 <+bridge> But I guess that one is deeply rooted 18:14 <+bridge> Is there a smarter way then doing a memcpy to convert between type and unsigned type? 18:14 <+bridge> 18:14 <+bridge> ``` 18:14 <+bridge> template 18:14 <+bridge> constexpr inline T bit_cast(U u) 18:14 <+bridge> { 18:14 <+bridge> static_assert(sizeof(T) == sizeof(U) && std::is_trivially_copyable_v && std::is_trivially_copyable_v); 18:14 <+bridge> T t; 18:14 <+bridge> std::memcpy(&t, &u, sizeof(T)); 18:14 <+bridge> return t; 18:14 <+bridge> } 18:14 <+bridge> 18:14 <+bridge> template 18:14 <+bridge> constexpr inline T add_wrap(T a, T b) 18:14 <+bridge> { 18:14 <+bridge> typedef typename std::make_unsigned::type unsigned_type; 18:15 <+bridge> return bit_cast(bit_cast(a) + bit_cast(b)); 18:15 <+bridge> } 18:15 <+bridge> ``` 18:15 <+bridge> 18:15 <+bridge> When I use `reinterpret_cast` I get `error: invalid cast from type 'int' to type 'unsigned_type' {aka 'unsigned int'} 18:15 <+bridge> 148 | return reinterpret_cast(reinterpret_cast(a) + reinterpret_cast(b));` 18:24 <+bridge> reinterpret_cast takes pointer 18:25 <+bridge> use `*reinterpret_cast(&a)` 18:29 <+bridge> I see, thanks 18:55 <+bridge> I actually wonder if that reinterpret cast is actually legal. Though not enough to dig out the standard 😄 19:00 <+bridge> Mh, the `bit_cast` one is definitely legal. `reinterpret_cast` might not be, I don't really remember now 19:16 <+bridge> With `gcc -O2` both implementations have the same assembly https://godbolt.org/z/McW3EWaqE 19:19 <+bridge> [bit_cast](https://en.cppreference.com/w/cpp/numeric/bit_cast) - the code is practically the same as in their possible implementation segment. 19:19 <+bridge> 19:19 <+bridge> They also note 19:19 <+bridge> ``` 19:19 <+bridge> reinterpret_cast (or equivalent explicit cast) between pointer or reference types shall not be used to reinterpret object representation in most cases because of the type aliasing rule. 19:19 <+bridge> ``` 19:19 <+bridge> https://stackoverflow.com/questions/98650/what-is-the-strict-aliasing-rule 19:25 <+bridge> Maybe do the bit_cast just in case. We had issues with strict aliasing once and its really no fun to debug 19:32 <+bridge> [bit_cast](https://en.cppreference.com/w/cpp/numeric/bit_cast) - the code is practically the same as in their possible implementation segment. 19:32 <+bridge> 19:33 <+bridge> They also note 19:33 <+bridge> ``` 19:33 <+bridge> reinterpret_cast (or equivalent explicit cast) between pointer or reference types shall not be used to reinterpret object representation in most cases because of the type aliasing rule. 19:33 <+bridge> ``` 19:33 <+bridge> https://stackoverflow.com/questions/98650/what-is-the-strict-aliasing-rule 19:33 <+bridge> https://stackoverflow.com/questions/14623266/why-cant-i-reinterpret-cast-uint-to-int 19:46 <+bridge> you can safely reinterpret_cast between types of same size 19:48 <+bridge> discord troll admins 19:48 <+bridge> fat fingers 19:48 <+bridge> woden hands 19:49 <+bridge> i mean its not only #developer 19:49 <+bridge> even showroom 19:50 <+bridge> wtf, someone reordered channels order? 19:56 <+bridge> discord really needs a layout lock xD 20:00 <+bridge> Actually even the size doesn't seem to matter 😄 C++11 5.2.10p7 allows converting any object pointer to an object pointer of different type 20:00 <+bridge> Let me see if you are allowed to actually access it without invoking UB though 20:00 <+bridge> probably not 20:00 <+bridge> pls 20:00 <+bridge> move #developer back 20:00 <+bridge> under #general 20:01 <+bridge> @Learath2 this is a matter of life and death 20:01 <+bridge> I think that was intentional we've been moved down 😦 20:01 <+bridge> nonono 20:01 <+bridge> this cant be done 20:01 <+bridge> move it back 20:01 <+bridge> @Discord Mod 20:02 <+bridge> who did this 20:02 <+bridge> https://tenor.com/view/this-is-war-war-theres-going-to-be-a-war-dwight-schrute-gif-15746079 20:02 <+bridge> move it back while we figure it out 20:03 <+bridge> :cammostripes: 20:05 <+bridge> deen 20:05 <+bridge> i'd need 5 years to get used to this game breaking change 20:05 <+bridge> @deen pls 20:11 <+bridge> before developers goes here #off-topic can go here lmao 20:14 <+ChillerDragon> yo joptster im thinking about stealing your laser_text.cpp is it free to use? who even made it? fstd? https://github.com/Jupeyy/teeworlds-fng2-mod/blob/07ac6046c37eba552d5d0b59bcc7bf35904b3e4f/src/game/server/laser_text.cpp 20:16 <+bridge> hello @Learath2 @deen @snail @murpi Some moderator has just global banned me for 1day for racism? i have not said anything remotely racist so can you investigate the moderators for abusing rcon and kindly unban me? 20:16 <+bridge> Glad guys u moved this channel down, thanks 🙏 20:16 <+bridge> chillerdragon: yeah u can use it for free af 20:17 <+bridge> Knowing you, I bet you said something especially vile. I've never seen you not be racist 20:17 <+ChillerDragon> who made it? 20:18 <+bridge> I am sorry you think that way of me but i can assure you that i did not. if you believe that i did could you provide the logs to me? 20:18 <+bridge> (@Learath2) 20:18 <+bridge> I shall inquire with the appropriate mod and get back to you kind sir 20:19 <+bridge> Thank you very much 20:22 <+bridge> i knew u would be the main one crying 20:22 <+bridge> u such a old man 20:23 <+bridge> ssh 20:23 <+bridge> ofc 20:23 <+bridge> developers should be the second channel 20:23 <+bridge> its a rule 20:23 <+bridge> for 95% players this channel is irrelevant 20:23 <+bridge> 1. we encourage ppl to look here more, its the most interesting discussion 20:23 <+bridge> 2. ppl learn 20:23 <+bridge> its more logic to have it below 20:23 <+bridge> with questions/bugs 20:23 <+bridge> how is it less interesting than #off-topic tho 20:23 <+bridge> even tho its obviously disturbing since we arent used to it 20:24 <+bridge> its not about interesting its about relevancy 20:24 <+bridge> its the most relevant channel? 20:24 <+bridge> literally lol 20:24 <+bridge> for devs yes 20:24 <+bridge> not for most ppl 20:24 <+bridge> for the game 20:24 <+bridge> i think second most relevant 20:24 <+bridge> for ppl 20:24 <+bridge> #bugs should be at top 20:24 <+bridge> it has most messages 20:24 <+ChillerDragon> what are u talkin about 20:24 <+bridge> they moved the channel down 20:25 <+bridge> like its trash 20:25 <+bridge> this is my rust dump 20:25 <+bridge> it must be up 20:25 <+ChillerDragon> i mean the learto sp racism logs thingy 20:25 <+bridge> who cares 20:25 <+ChillerDragon> i do 20:25 <+ChillerDragon> who cared about discord 20:25 <+bridge> :feelsbadman: 20:25 <+ChillerDragon> axaxax 20:26 <+ChillerDragon> jopstar 20:26 <+ChillerDragon> did u steal laser text too or write it ur self? 20:26 <+ChillerDragon> i feel like this has been around forever maybe fstd made it idk 20:26 <+ChillerDragon> oh wow he is even still on this irc 20:27 <+ChillerDragon> helo if u got the ping 20:27 <+bridge> i stole the idea 20:27 <+bridge> but i wrote myself iirc 20:27 <+ChillerDragon> but ur code? 20:27 <+ChillerDragon> cool stuff 20:27 <+bridge> i guess so, the old version didnt connect the laser dots 20:27 <+ChillerDragon> wait but wasnt there fstd's openfng when u started? 20:27 <+bridge> i wanted it connected 20:28 <+ChillerDragon> so you made it tighther? 20:28 <+bridge> i made it so it looks more like text 20:28 <+ChillerDragon> idk how it looked before 20:28 <+ChillerDragon> was there space between? 20:28 <+bridge> order looks good now, regarding relevancy 20:28 <+bridge> The original idea with laser text was indeed fstd's, but people have improved upon it since then 20:29 <+ChillerDragon> wait it was fstds idea? 20:29 <+ChillerDragon> i thought that idea was even older 20:29 <+ChillerDragon> and he only made the open src port 20:29 <+bridge> Yes, I just moved the rest around a bit too, should be good now 20:29 <+bridge> i mean where the fuck is the idea behind it xD 20:29 <+bridge> its text made of laser dots 20:29 <+ChillerDragon> fakof 20:29 <+ChillerDragon> its genious 20:29 <+ChillerDragon> and culture 20:29 <+bridge> do u fear copyright or what is ur problem xd 20:29 <+bridge> just use it 20:29 <+ChillerDragon> no im just curious 20:29 <+bridge> be criminal 20:30 <+ChillerDragon> and if i steal it into my mod i would at least like to properly credit 20:30 <+bridge> Hm, first I saw loltext was in openfng or ddwar, not sure which, but I'm not sure if he took it from another mod 20:30 <+bridge> then give it to fstd 20:30 <+bridge> i dont want credits for anything 20:30 <+ChillerDragon> if i manage to understand the code i might make a yt video on it explaining it seems like a fun copy paste for new devs 20:30 <+bridge> order looks good now, regarding relevance 20:31 <+ChillerDragon> send screenshot 20:31 <+ChillerDragon> of discord channels 20:32 <+bridge> https://cdn.discordapp.com/attachments/293493549758939136/1064265753093738506/image.png 20:32 <+ChillerDragon> ty babe 20:32 <+ChillerDragon> lmao all muted 20:32 <+ChillerDragon> @zwelf when bridge all those? 21:06 <+bridge> he can bridge it as soon as he has own bridge that doesnt create 2000 seconds delay xdd