short version:
i just need to know how to access CG_CenterPrint which is located in cgame - cg_draw.c from ClientBegin which is located in game - g_client.c
issue:
cant find cg_centerprint and dont know how to properly link the 2 files
guess:
because the files containing cg_centerprint are located in a different project
_______________________
ive been looking for how to print messages in large text in the center of the screen since ive started
ex: You Fragged X
i found it today :
project - file - function
cgame - cg_event.c - CG_Obituary -
s = va(S_COLOR_GREEN "You obliterated %s\n%s place with %i", targetName,
CG_PlaceString( cg.snap->ps.persistant[PERS_RANK] + 1 ),
CG_CenterPrint( s, SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH );
changed some of the messages just to test it
ex: You Obliterated X
it worked...
i tried to put the code in to another project
game - g_client.c - client_begin
CG_CenterPrint( S_COLOR_GREEN "ZoNiDe", SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH );
it doesnt link properly...
game error LNK2019: unresolved external symbol _CG_CenterPrint referenced in function _ClientBegin
game fatal error LNK1120: 1 unresolved externals
i tried to include cg_draw.c in g_client.c
#include "../cgame/cg_draw.c"
\code\game\bg_public.h(98): error C2365: 'GT_FFA' : redefinition; previous definition was a 'enumerator'
didnt work... it gave me a sh*t load of errors
then i noticed that some of the other projects used files that were in other projects...
1 file being used by 2 projects? no errors?
so then i tried it... wouldnt let me add the cg_draw.c to the game source files... it would only let me put it in the header folder.. seemed like i was making progress...
i hit play...
game error LNK2019: unresolved external symbol _trap_R_RenderScene referenced in function _CG_Draw3DModel
im guessing i should find the file that contains _trap_R_RenderScene and add it to the headers folder
i did... it was in cg_main.c
i added it and hit play
game error LNK2005: _vmMain already defined in g_main.obj
ok... now what...
please help
linking files across projects
-
- Posts: 304
- Joined: Fri Aug 08, 2003 7:00 am