lolirelia / Flappy

Multiplayer Flappy bird game made in C using Raylib for rendering and LibUV for UDP Networking
10 stars 1 forks source link

Clean up code #4

Open lolirelia opened 2 months ago

lolirelia commented 2 months ago

As it stands the code became extremely messy after separating the modules as networking vs rendering since raylib has collisions with the Win32 API. But the networking also needs structures and vector math located in raymath. Likewise the drawing needs variables from the networking and vice verse. To resolve this I recreated the structures raylib defines in the networking side of the code and used to extern for linkage. I also used a bunch of externs all over the code to link variables between the rendering and networking modules. All of this can be cleaned up following a structured design.

Some things to consider

sominator commented 1 month ago

Not meaning to create more work for you, but apparently this header exists: raylib_win32.h

Perhaps it might be used to make libuv and raylib play nice so that you don't have to redefine raymath structs and use externs.

lolirelia commented 1 month ago

Not meaning to create more work for you, but apparently this header exists: raylib_win32.h

Perhaps it might be used to make libuv and raylib play nice so that you don't have to redefine raymath structs and use externs.

Hi. Yes I am aware of this. I had spoken to Jeff when he had proposed it to raylib extras. Unfortunately it was after I had made all my modifications. The solution is fairly simple though, it would just prevent the use of the defualt win32 calls which collide to raylib. Which is perfectly fine considering if you're using raylib you probably aren't using the default win32 UI functions.

sominator commented 1 month ago

Yep! Agreed.