Guild icon
Teeworlds
discord.gg/teeworlds / development
For discussions around the development of the official Teeworlds
Between 2020-11-01 00:00:00Z and 2020-11-02 00:00:00Z
Avatar
Can I somehow do Collision class do client-only things?
00:08
well. I can totally pass pointers from the client to the collision class and the collision function would return me the values I want, but that'd just add another argument to the function that's not really necessary and I'd rather try to avoid bloating the function (edited)
Avatar
@TsFreddie teeworlds code uses f.e. as for example, but it's not really common in english, as I understand it. use e.g. instead
👀 2
Avatar
that's how I feel too
Avatar
I also tried adding a pointer to the client in collision.cpp
00:31
but when I added a client function it asked me to include client stuff for server :/
Avatar
you shouldn't really add a client pointer to the shared code (collision is shared code)
00:32
what problem do you want to solve?
Avatar
I want the functions in collision to tell the client at which point do the entities enter water, so that client can create waves in water at that exact point (edited)
Avatar
you could make the client register a callback function for this
00:36
think what the function would look like, then use that signature plus a void *pUser which can then be used in a static member function of CGameClient or wherever you need it, to store the value of this
00:44
are there any examples of callback functions already used that I can utilize as an example? ^^ (edited)
Avatar
yes, there are quite a few
00:45
let me check if I can find something clean and simple
00:46
for example in the net server:
00:47
these are the types for the callback functions
00:47
they're stored there ^
Avatar
o: I will check it out tomorrow and try to work out such a solution from there ^^
00:49
o: I will check it out tomorrow and try to work out such a solution from there ^^
nice 🙂
09:57
fdb9ba3 CFont fallback support - TsFreddie cfe914c Textrenderer regional variant support - TsFreddie ba54707 Textrender add console output to font loading - TsFreddie 61d2052 Reset texture when switching variants - TsFreddie 73c7830 Remove unused enum FaceType - TsFreddie
sonk 4
10:57
3b6d5a0 loop the envelop timer to reduce precision loss - TsFreddie b96d4ee fix loop edge case - TsFreddie e7fe333 Merge pull request #2801 from TsFreddie/0.7-env... - oy
Avatar
so far no success in static function... but I haven't given up yet!
Avatar
give me your progress
Avatar
uh... I declared a static void function in gameclient.h and defined it in gameclient.cpp
Avatar
signature?
Avatar
static void WaterSplash(float x, float y, float Force, void* pData); void CGameClient::WaterSplash(float x, float y, float Force, void* pData) { gs_Water.HitWater(x, y, Force); } I really don't know what I am doing (edited)
23:23
the examples didn't quite help me
Avatar
it doesn't compile?
Avatar
well, I want the function to be used in collision.cpp, and use it I need to link it, don't I? That creates a circle of linking
23:45
so compiling works, but there is an error at linking?
Avatar
actually... I removed my extra linking I've done and I still get the error... hold on
23:49
23:49
this is what I am getting, but it is not related to the static function but to something else I presume
Avatar
hm, maybe related to some include?
Avatar
no idea... I put my latest changes in a stash and I still get it... must be broken somewhere earlier
Avatar
did you change something in the way client_data.h is generated?
23:54
can you paste it somewhere? (e.g. https://paste.mozilla.org/)
Avatar
well. I get the issue on the master branch too.
23:55
could be a VS bug
Avatar
hmm
23:56
did you try a clean build?
Avatar
well, my master is clean. only 3 commits behind master
Avatar
I mean ask VS to clean build files
23:58
oh...
23:58
I think I know what might be it yeah
23:59
my /out/build/ is indeed littered with stuff
Exported 61 message(s)