Hi,
I recently downloaded the source code to Quake 2 (not including the rendering engine), and I'm trying to understand how it works. In it, there's a source file called p_client.c, which includes a function declared thus:
Inside this function, a pointer is declared like this:Code:void PutClientInServer (edict_t *ent)
Now here's what I don't get. Say if I make myself another source code file called "bot.c", and I include all the header files that were included in p_client.c:Code:gclient_t *client;
And then, in a function in "bot.c" I try to declare a pointer like this:Code:#include "g_local.h" #include "m_player.h"
If I do this, I get an error. It says "error C2275: 'gclient_t' : illegal use of this type as an expression".Code:gclient_t *client;
Could this be something to do with how gclient_t is declared in "game.h"? This file is included by "g_local.h" which is one of the ones I mentioned to be included earlier.
Thanks. If you want to see the full source code you can download it here:Code:typedef struct edict_s edict_t; typedef struct gclient_s gclient_t; #ifndef GAME_INCLUDE struct gclient_s { player_state_t ps; // communicated by server to clients int ping; // the game dll can add anything it wants after // this point in the structure };
ftp://ftp.idsoftware.com/idstuff/qua...e/q2src320.exe



LinkBack URL
About LinkBacks



