本文整理汇总了C++中game_import_t::dprintf方法的典型用法代码示例。如果您正苦于以下问题:C++ game_import_t::dprintf方法的具体用法?C++ game_import_t::dprintf怎么用?C++ game_import_t::dprintf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game_import_t
的用法示例。
在下文中一共展示了game_import_t::dprintf方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShutdownGame
void ShutdownGame (void)
{
gi.dprintf ("==== ShutdownGame ====\n");
gi.FreeTags (TAG_LEVEL);
gi.FreeTags (TAG_GAME);
}
示例2: Com_Printf
void Com_Printf(const char *msg, int level, ...){
va_list argptr;
char text[1024];
va_start(argptr, level);
vsprintf(text, msg, argptr);
va_end(argptr);
gi.dprintf("%s", text);
}
示例3: Com_Printf
void Com_Printf (char *msg, ...)
{
va_list argptr;
char text[1024];
va_start (argptr, msg);
vsprintf (text, msg, argptr);
va_end (argptr);
gi.dprintf ("%s", text);
}
示例4: Debug_Soundindex
int Debug_Soundindex (char *name)
{
int soundnum;
soundnum = RealFunc.soundindex(name);
if(soundnum > max_soundindex)
{
gi.dprintf("Sound %03d %s\n",soundnum,name);
max_soundindex = soundnum;
}
return soundnum;
}
示例5: Debug_Modelindex
int Debug_Modelindex (char *name)
{
int modelnum;
modelnum = RealFunc.modelindex(name);
if(modelnum > max_modelindex)
{
gi.dprintf("Model %03d %s\n",modelnum,name);
max_modelindex = modelnum;
}
return modelnum;
}
示例6: Com_Printf
void Com_Printf (char *msg, ...)
{
va_list argptr;
char text[1024];
va_start (argptr, msg);
// vsprintf (text, msg, argptr);
Q_vsnprintf (text, sizeof(text), msg, argptr); // Knightmare- buffer overflow fix
va_end (argptr);
gi.dprintf ("%s", text);
}
示例7: game_dprintf
void game_dprintf(char *fmt, ...)
{
va_list args;
char buf[1024];
va_start(args, fmt);
vsnprintf(buf, sizeof buf, fmt, args);
buf[sizeof buf - 1] = 0;
va_end(args);
q2a_lua_LogMessage(buf);
gi.dprintf("%s", buf);
}
示例8: ShutdownGame
void ShutdownGame (void)
{
gi.dprintf ("==== ShutdownGame ====\n");
if(!deathmatch->value && !coop->value) {
#ifndef KMQUAKE2_ENGINE_MOD // engine has zoom autosensitivity
gi.cvar_forceset("m_pitch", va("%f",lazarus_pitch->value));
#endif
//gi.cvar_forceset("cd_loopcount", va("%d",lazarus_cd_loop->value));
//gi.cvar_forceset("gl_clear", va("%d", lazarus_gl_clear->value));
}
// Lazarus: Turn off fog if it's on
if(!dedicated->value)
Fog_Off();
gi.FreeTags (TAG_LEVEL);
gi.FreeTags (TAG_GAME);
}
示例9: LoadLibrary
/*
=================
GetGameAPI
Returns a pointer to the structure with all entry points
and global variables
=================
*/
game_export_t *GetGameAPI(game_import_t *import)
{
char dllname[256];
cvar_t *game;
GAMEAPI *getapi;
game_import_t g_import;
gi = *import;
game = gi.cvar ("game", "baseq2", 0);
q2a_strcpy(moddir, game->string);
if(moddir[0] == 0)
q2a_strcpy(moddir, "baseq2");
gi.dprintf ("Q2Admin %s running %s\n", Q2A_VERSION, moddir);
gi.cvar ("*Q2Admin", Q2A_VERSION, CVAR_SERVERINFO|CVAR_NOSET);
q2a_lua_init();
sprintf(dllname, "%s/%s", moddir, DLLNAME);
#ifdef _WIN32
hdll = LoadLibrary(dllname);
#else
hdll = dlopen(dllname, RTLD_NOW);
#endif
if(hdll == NULL)
{
gi.dprintf ("Q2A: Unable to load DLL %s.\n", dllname);
return &globals;
}
gi.dprintf("Q2A: Loaded game DLL: %s.\n", dllname);
#ifdef _WIN32
getapi = (GAMEAPI *)GetProcAddress (hdll, "GetGameAPI");
#else
getapi = (GAMEAPI *)dlsym(hdll, "GetGameAPI");
#endif
if(getapi == NULL)
{
#ifdef _WIN32
FreeLibrary(hdll);
#else
dlclose(hdll);
#endif
hdll = NULL;
gi.dprintf ("Q2A: No \"GetGameApi\" entry in DLL %s.\n", dllname);
return &globals;
}
/* proxy a few imports so we can capture the data */
memcpy(&g_import, import, sizeof(game_import_t));
g_import.bprintf = game_bprintf;
g_import.dprintf = game_dprintf;
g_import.cprintf = game_cprintf;
dllglobals = (*getapi)(&g_import);
globals.apiversion = dllglobals->apiversion;
globals.Init = Init;
globals.Shutdown = Shutdown;
globals.SpawnEntities = SpawnEntities;
globals.WriteGame = dllglobals->WriteGame;
globals.ReadGame = dllglobals->ReadGame;
globals.WriteLevel = dllglobals->WriteLevel;
globals.ReadLevel = dllglobals->ReadLevel;
globals.ClientConnect = ClientConnect;
globals.ClientBegin = ClientBegin;
globals.ClientUserinfoChanged = ClientUserinfoChanged;
globals.ClientDisconnect = ClientDisconnect;
globals.ClientCommand = ClientCommand;
globals.ClientThink = ClientThink;
globals.RunFrame = RunFrame;
globals.ServerCommand = ServerCommand;
copyDllInfo();
return &globals;
}