当前位置: 首页>>代码示例>>C++>>正文


C++ Con_Print函数代码示例

本文整理汇总了C++中Con_Print函数的典型用法代码示例。如果您正苦于以下问题:C++ Con_Print函数的具体用法?C++ Con_Print怎么用?C++ Con_Print使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Con_Print函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Host_Shutdown

/*
===============
Host_Shutdown

FIXME: this is a callback from Sys_Quit and Sys_Error.  It would be better
to run quit through here before the final handoff to the sys code.
===============
*/
void Host_Shutdown(void)
{
	static qboolean isdown = false;

	if (isdown)
	{
		Con_Print("recursive shutdown\n");
		return;
	}
	if (setjmp(host_abortframe))
	{
		Con_Print("aborted the quitting frame?!?\n");
		return;
	}
	isdown = true;

	// be quiet while shutting down
	S_StopAllSounds();

	// disconnect client from server if active
	CL_Disconnect();

	// shut down local server if active
	Host_ShutdownServer ();

	// Shutdown menu
	if(MR_Shutdown)
		MR_Shutdown();

	// AK shutdown PRVM
	// AK hmm, no PRVM_Shutdown(); yet

	CL_Gecko_Shutdown();
	CL_Video_Shutdown();

	Host_SaveConfig();

	CDAudio_Shutdown ();
	S_Terminate ();
	Curl_Shutdown ();
	NetConn_Shutdown ();
	//PR_Shutdown ();

	if (cls.state != ca_dedicated)
	{
		R_Modules_Shutdown();
		VID_Shutdown();
		Thread_Shutdown();
	}

	Cmd_Shutdown();
	Key_Shutdown();
	CL_Shutdown();
	Sys_Shutdown();
	Log_Close();
	Crypto_Shutdown();
	FS_Shutdown();
	Con_Shutdown();
	Memory_Shutdown();
}
开发者ID:VenFPS,项目名称:Vengeance,代码行数:68,代码来源:host.c

示例2: CDAudio_SysGetAudioDiskInfo

int CDAudio_SysGetAudioDiskInfo(void)
{
	DWORD				dwReturn;
	MCI_STATUS_PARMS	mciStatusParms;

	mciStatusParms.dwItem = MCI_STATUS_READY;
	dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD_PTR) (LPVOID) &mciStatusParms);
	if (dwReturn)
	{
		Con_Print("CDAudio_SysGetAudioDiskInfo: drive ready test - get status failed\n");
		return -1;
	}
	if (!mciStatusParms.dwReturn)
	{
		Con_Print("CDAudio_SysGetAudioDiskInfo: drive not ready\n");
		return -1;
	}

	mciStatusParms.dwItem = MCI_STATUS_NUMBER_OF_TRACKS;
	dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD_PTR) (LPVOID) &mciStatusParms);
	if (dwReturn)
	{
		Con_Print("CDAudio_SysGetAudioDiskInfo: get tracks - status failed\n");
		return -1;
	}
	if (mciStatusParms.dwReturn < 1)
	{
		Con_Print("CDAudio_SysGetAudioDiskInfo: no music tracks\n");
		return -1;
	}

	return mciStatusParms.dwReturn;
}
开发者ID:Blub,项目名称:darkplaces,代码行数:33,代码来源:cd_win.c

示例3: Curl_Info_f

// TODO rewrite using Curl_GetDownloadInfo?
static void Curl_Info_f(void)
{
	downloadinfo *di;
	if(!curl_dll)
		return;
	if(Curl_Running())
	{
		Con_Print("Currently running downloads:\n");
		for(di = downloads; di; di = di->next)
		{
			double speed, percent;
			Con_Printf("  %s -> %s ",  CleanURL(di->url), di->filename);
			percent = 100.0 * Curl_GetDownloadAmount(di);
			speed = Curl_GetDownloadSpeed(di);
			if(percent >= 0)
				Con_Printf("(%.1f%% @ %.1f KiB/s)\n", percent, speed / 1024.0);
			else
				Con_Print("(queued)\n");
		}
	}
	else
	{
		Con_Print("No downloads running.\n");
	}
}
开发者ID:MarioMario,项目名称:smbnex-engine,代码行数:26,代码来源:libcurl.c

示例4: CDAudio_Startup

int CDAudio_Startup (void)
{
	if (COM_CheckParm("-nocdaudio"))
		return -1;

	CDAudio_SysStartup ();

	if (CDAudio_GetAudioDiskInfo())
	{
		Con_Print("CDAudio_Init: No CD in player.\n");
		cdValid = false;
	}

	saved_vol = CDAudio_SysGetVolume ();
	if (saved_vol < 0.0f)
	{
		Con_Print ("Can't get initial CD volume\n");
		saved_vol = 1.0f;
	}
	else
		Con_Printf ("Initial CD volume: %g\n", saved_vol);

	initialized = true;

	Con_Print("CD Audio Initialized\n");

	return 0;
}
开发者ID:Blub,项目名称:darkplaces,代码行数:28,代码来源:cd_shared.c

示例5: CL_Stop_f

/*
====================
CL_Stop_f

stop recording a demo
====================
*/
void CL_Stop_f (void)
{
	sizebuf_t buf;
	unsigned char bufdata[64];

	if (!cls.demorecording)
	{
		Con_Print("Деморолик не записывается.\n");
		return;
	}

// write a disconnect message to the demo file
	// LordHavoc: don't replace the cl_message when doing this
	buf.data = bufdata;
	buf.maxsize = sizeof(bufdata);
	SZ_Clear(&buf);
	MSG_WriteByte(&buf, svc_disconnect);
	CL_WriteDemoMessage(&buf);

// finish up
	if(cl_autodemo.integer && (cl_autodemo_delete.integer & 1))
	{
		FS_RemoveOnClose(cls.demofile);
		Con_Print("Деморолик записан и удален\n");
	}
	else
		Con_Print("Деморолик записан\n");
	FS_Close (cls.demofile);
	cls.demofile = NULL;
	cls.demorecording = false;
}
开发者ID:chekoopa,项目名称:darkplaces-rus,代码行数:38,代码来源:cl_demo.c

示例6: W_LoadTextureWadFile

/*
====================
W_LoadTextureWadFile
====================
*/
void W_LoadTextureWadFile (char *filename, int complain)
{
	wadinfo_t		header;
	int				infotableofs;
	qfile_t			*file;
	int				numlumps;
	mwad_t			*w;

	file = FS_OpenVirtualFile(filename, false);
	if (!file)
	{
		if (complain)
			Con_Printf("W_LoadTextureWadFile: couldn't find %s\n", filename);
		return;
	}

	if (FS_Read(file, &header, sizeof(wadinfo_t)) != sizeof(wadinfo_t))
	{Con_Print("W_LoadTextureWadFile: unable to read wad header\n");FS_Close(file);file = NULL;return;}

	if(memcmp(header.identification, "WAD3", 4))
	{Con_Printf("W_LoadTextureWadFile: Wad file %s doesn't have WAD3 id\n",filename);FS_Close(file);file = NULL;return;}

	numlumps = LittleLong(header.numlumps);
	if (numlumps < 1 || numlumps > 65536)
	{Con_Printf("W_LoadTextureWadFile: invalid number of lumps (%i)\n", numlumps);FS_Close(file);file = NULL;return;}
	infotableofs = LittleLong(header.infotableofs);
	if (FS_Seek (file, infotableofs, SEEK_SET))
	{Con_Print("W_LoadTextureWadFile: unable to seek to lump table\n");FS_Close(file);file = NULL;return;}

	if (!wad.hlwads.mempool)
		Mem_ExpandableArray_NewArray(&wad.hlwads, cls.permanentmempool, sizeof(mwad_t), 16);
	w = (mwad_t *) Mem_ExpandableArray_AllocRecord(&wad.hlwads);
	w->file = file;
	w->numlumps = numlumps;
	w->lumps = (lumpinfo_t *) Mem_Alloc(cls.permanentmempool, w->numlumps * sizeof(lumpinfo_t));

	if (!w->lumps)
	{
		Con_Print("W_LoadTextureWadFile: unable to allocate temporary memory for lump table\n");
		FS_Close(w->file);
		w->file = NULL;
		w->numlumps = 0;
		return;
	}

	if (FS_Read(file, w->lumps, sizeof(lumpinfo_t) * w->numlumps) != (fs_offset_t)sizeof(lumpinfo_t) * numlumps)
	{
		Con_Print("W_LoadTextureWadFile: unable to read lump table\n");
		FS_Close(w->file);
		w->file = NULL;
		w->numlumps = 0;
		Mem_Free(w->lumps);
		w->lumps = NULL;
		return;
	}

	W_SwapLumps(w->numlumps, w->lumps);

	// leaves the file open
}
开发者ID:divVerent,项目名称:darkplaces-travis,代码行数:65,代码来源:wad.c

示例7: LoadSky_f

// LordHavoc: added LoadSky console command
static void LoadSky_f (void)
{
	switch (Cmd_Argc())
	{
	case 1:
		if (skyname[0])
			Con_Printf("current sky: %s\n", skyname);
		else
			Con_Print("no skybox has been set\n");
		break;
	case 2:
		if (R_SetSkyBox(Cmd_Argv(1)))
		{
			if (skyname[0])
				Con_Printf("skybox set to %s\n", skyname);
			else
				Con_Print("skybox disabled\n");
		}
		else
			Con_Printf("failed to load skybox %s\n", Cmd_Argv(1));
		break;
	default:
		Con_Print("usage: loadsky skyname\n");
		break;
	}
}
开发者ID:CyberSys,项目名称:darkplaces,代码行数:27,代码来源:r_sky.c

示例8: PRVM_PrintStatement

static void PRVM_PrintStatement(prvm_prog_t *prog, mstatement_t *s)
{
    size_t i;
    int opnum = (int)(s - prog->statements);
    char valuebuf[MAX_INPUTLINE];

    Con_Printf("s%i: ", opnum);
    if( prog->statement_linenums )
    {
        if ( prog->statement_columnnums )
            Con_Printf( "%s:%i:%i: ", PRVM_GetString( prog, prog->xfunction->s_file ), prog->statement_linenums[ opnum ], prog->statement_columnnums[ opnum ] );
        else
            Con_Printf( "%s:%i: ", PRVM_GetString( prog, prog->xfunction->s_file ), prog->statement_linenums[ opnum ] );
    }

    if (prvm_statementprofiling.integer)
        Con_Printf("%7.0f ", prog->statement_profile[s - prog->statements]);

    if ( (unsigned)s->op < sizeof(prvm_opnames)/sizeof(prvm_opnames[0]))
    {
        Con_Printf("%s ",  prvm_opnames[s->op]);
        i = strlen(prvm_opnames[s->op]);
        // don't count a preceding color tag when padding the name
        if (prvm_opnames[s->op][0] == STRING_COLOR_TAG)
            i -= 2;
        for ( ; i<10 ; i++)
            Con_Print(" ");
    }
    if (s->operand[0] >= 0) Con_Printf(  "%s", PRVM_GlobalString(prog, s->operand[0], valuebuf, sizeof(valuebuf)));
    if (s->operand[1] >= 0) Con_Printf(", %s", PRVM_GlobalString(prog, s->operand[1], valuebuf, sizeof(valuebuf)));
    if (s->operand[2] >= 0) Con_Printf(", %s", PRVM_GlobalString(prog, s->operand[2], valuebuf, sizeof(valuebuf)));
    if (s->jumpabsolute >= 0) Con_Printf(", statement %i", s->jumpabsolute);
    Con_Print("\n");
}
开发者ID:paulvortex,项目名称:DpOmnicide,代码行数:34,代码来源:prvm_exec.c

示例9: PHS

/*
================
CalcPHS

Calculate the PHS (Potentially Hearable Set)
by ORing together all the PVS visible from a leaf
================
*/
void CalcPHS (void)
{
	int		i, j, k, l, index;
	int		bitbyte;
	long	*dest, *src;
	byte	*scan;
	int		count;
	byte	uncompressed[MAX_MAP_LEAFS/8];
	byte	compressed[MAX_MAP_LEAFS/8];

	Con_Print("Building PHS...\n");

	count = 0;
	for (i=0 ; i<portalclusters ; i++)
	{
		scan = uncompressedvis + i*leafbytes;
		memcpy (uncompressed, scan, leafbytes);
		for (j=0 ; j<leafbytes ; j++)
		{
			bitbyte = scan[j];
			if (!bitbyte)
				continue;
			for (k=0 ; k<8 ; k++)
			{
				if (! (bitbyte & (1<<k)) )
					continue;
				// OR this pvs row into the phs
				index = ((j<<3)+k);
				if (index >= portalclusters)
					Con_Error("Bad bit in PVS\n");	// pad bits should be 0
				src = (long *)(uncompressedvis + index*leafbytes);
				dest = (long *)uncompressed;
				for (l=0 ; l<leaflongs ; l++)
					((long *)uncompressed)[l] |= src[l];
			}
		}
		for (j=0 ; j<portalclusters ; j++)
			if (uncompressed[j>>3] & (1<<(j&7)) )
				count++;

	//
	// compress the bit string
	//
		j = CompressVis (uncompressed, compressed);

		dest = (long *)vismap_p;
		vismap_p += j;
		
		if (vismap_p > vismap_end)
			Con_Error("Vismap expansion overflow\n");

		dvis->bitofs[i][DVIS_PHS] = (byte *)dest-vismap;

		memcpy (dest, compressed, j);	
	}

	Con_Print("Average clusters hearable: %i\n", count/portalclusters);
}
开发者ID:raynorpat,项目名称:cake,代码行数:66,代码来源:qvis.c

示例10: SndSys_Init

/*
====================
SndSys_Init

Create "snd_renderbuffer" with the proper sound format if the call is successful
May return a suggested format if the requested format isn't available
====================
*/
qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
{
#ifdef SUPPORTDIRECTX
	qboolean wavonly;
    sndinitstat stat;
#endif

	if (!sndsys_registeredcvars)
	{
		sndsys_registeredcvars = true;
		Cvar_RegisterVariable(&snd_wav_partitionsize);
	}

	Con_Print ("SndSys_Init: using the Win32 module\n");

#ifdef SUPPORTDIRECTX
// COMMANDLINEOPTION: Windows Sound: -wavonly uses wave sound instead of DirectSound
	wavonly = (COM_CheckParm ("-wavonly") != 0);
	dsound_init = false;
#endif
	wav_init = false;

#ifdef SUPPORTDIRECTX
    stat = SIS_FAILURE; // assume DirectSound won't initialize

	// Init DirectSound
	if (!wavonly)
	{
		stat = SndSys_InitDirectSound (requested);

		if (stat == SIS_SUCCESS)
			Con_Print("DirectSound initialized\n");
		else
			Con_Print("DirectSound failed to init\n");
	}
#endif

	// if DirectSound didn't succeed in initializing, try to initialize
	// waveOut sound, unless DirectSound failed because the hardware is
	// already allocated (in which case the user has already chosen not
	// to have sound)
#ifdef SUPPORTDIRECTX
	if (!dsound_init && (stat != SIS_NOTAVAIL))
#endif
	{
		if (SndSys_InitMmsystem (requested))
			Con_Print("Wave sound (MMSYSTEM) initialized\n");
		else
			Con_Print("Wave sound failed to init\n");
	}

#ifdef SUPPORTDIRECTX
	return (dsound_init || wav_init);
#else
	return wav_init;
#endif
}
开发者ID:kasymovga,项目名称:DarkPlacesRM,代码行数:65,代码来源:snd_win.c

示例11: IRC_Printf

/*
====================
IRC_Printf

Internal, used for logging.
====================
*/
static void IRC_Printf(const char *fmt, ...) {
    va_list args;
    char msg[MAX_INPUTLINE];
    
    va_start(args, fmt);
    dpvsnprintf(msg, sizeof(msg), fmt, args);
    va_end(args);
    
    Con_Print("IRC: ");
    Con_Print(msg);
}
开发者ID:Hanzo-nex,项目名称:DarkPlacesRM,代码行数:18,代码来源:irc.c

示例12: ListState

void ListState()
{
	Con_Print("List render states");
	for (dword dw=0;dw<210;dw++)
	{
		if (GetRenderStateString(dw))
		{
			DWORD state;
			D3DDevice()->GetRenderState((D3DRENDERSTATETYPE)dw, &state);
			Con_Print("%s = %d", GetRenderStateString(dw), state);
		}
	}
}
开发者ID:gejza,项目名称:Hoe3D,代码行数:13,代码来源:ref_d3d9_debug.cpp

示例13: SndSys_LockRenderBuffer

/*
====================
SndSys_LockRenderBuffer

Get the exclusive lock on "snd_renderbuffer"
====================
*/
qboolean SndSys_LockRenderBuffer (void)
{
#ifdef SUPPORTDIRECTX
	int reps;
	HRESULT hresult;
	DWORD	dwStatus;

	if (pDSBuf)
	{
		// if the buffer was lost or stopped, restore it and/or restart it
		if (IDirectSoundBuffer_GetStatus (pDSBuf, &dwStatus) != DS_OK)
			Con_Print("Couldn't get sound buffer status\n");

		if (dwStatus & DSBSTATUS_BUFFERLOST)
		{
			Con_Print("DSound buffer is lost!!\n");
			IDirectSoundBuffer_Restore (pDSBuf);
		}

		if (!(dwStatus & DSBSTATUS_PLAYING))
			IDirectSoundBuffer_Play(pDSBuf, 0, 0, DSBPLAY_LOOPING);

		reps = 0;

		while ((hresult = IDirectSoundBuffer_Lock(pDSBuf, 0, gSndBufSize, (LPVOID*)&dsound_pbuf, &dsound_dwSize, (LPVOID*)&dsound_pbuf2, &dsound_dwSize2, 0)) != DS_OK)
		{
			if (hresult != DSERR_BUFFERLOST)
			{
				Con_Print("S_LockBuffer: DS: Lock Sound Buffer Failed\n");
				S_Shutdown ();
				S_Startup ();
				return false;
			}

			if (++reps > 10000)
			{
				Con_Print("S_LockBuffer: DS: couldn't restore buffer\n");
				S_Shutdown ();
				S_Startup ();
				return false;
			}
		}

		if ((void*)dsound_pbuf != snd_renderbuffer->ring)
			Sys_Error("SndSys_LockRenderBuffer: the ring address has changed!!!\n");
		return true;
	}
#endif

	return wav_init;
}
开发者ID:kasymovga,项目名称:DarkPlacesRM,代码行数:58,代码来源:snd_win.c

示例14: getserverliststring

/*
=========
VM_M_getserverliststring

string	getserverliststring(float field, float hostnr)
=========
*/
static void VM_M_getserverliststring(prvm_prog_t *prog)
{
	serverlist_entry_t *cache;
	int hostnr;

	VM_SAFEPARMCOUNT(2, VM_M_getserverliststring);

	PRVM_G_INT(OFS_RETURN) = OFS_NULL;

	hostnr = (int)PRVM_G_FLOAT(OFS_PARM1);

	if(hostnr < 0 || hostnr >= serverlist_viewcount)
	{
		Con_Print("VM_M_getserverliststring: bad hostnr passed!\n");
		return;
	}
	cache = ServerList_GetViewEntry(hostnr);
	switch( (int) PRVM_G_FLOAT(OFS_PARM0) ) {
		case SLIF_CNAME:
			PRVM_G_INT( OFS_RETURN ) = PRVM_SetTempString( prog, cache->info.cname );
			break;
		case SLIF_NAME:
			PRVM_G_INT( OFS_RETURN ) = PRVM_SetTempString( prog, cache->info.name );
			break;
		case SLIF_QCSTATUS:
			PRVM_G_INT (OFS_RETURN ) = PRVM_SetTempString( prog, cache->info.qcstatus );
			break;
		case SLIF_PLAYERS:
			PRVM_G_INT (OFS_RETURN ) = PRVM_SetTempString( prog, cache->info.players );
			break;
		case SLIF_GAME:
			PRVM_G_INT( OFS_RETURN ) = PRVM_SetTempString( prog, cache->info.game );
			break;
		case SLIF_MOD:
			PRVM_G_INT( OFS_RETURN ) = PRVM_SetTempString( prog, cache->info.mod );
			break;
		case SLIF_MAP:
			PRVM_G_INT( OFS_RETURN ) = PRVM_SetTempString( prog, cache->info.map );
			break;
		// TODO remove this again
		case 1024:
			PRVM_G_INT( OFS_RETURN ) = PRVM_SetTempString( prog, cache->line1 );
			break;
		case 1025:
			PRVM_G_INT( OFS_RETURN ) = PRVM_SetTempString( prog, cache->line2 );
			break;
		default:
			Con_Print("VM_M_getserverliststring: bad field number passed!\n");
	}
}
开发者ID:AidHamza,项目名称:eviltoys,代码行数:57,代码来源:mvm_cmds.c

示例15: Plug_Init

int Plug_Init(int *args)
{
	if (!Plug_Export("Tick", EmailNotification_Frame) || !Plug_Export("ExecuteCommand", EmailNotification_ExecuteCommand))
	{
		Con_Print("email notification plugin failed\n");
		return false;
	}

	Cmd_AddCommand("imapaccount");
	Cmd_AddCommand("pop3account");

	Con_Print("email notification plugin loaded\n");

	return true;
}
开发者ID:ProfessorKaos64,项目名称:ftequake,代码行数:15,代码来源:pop3noti.c


注:本文中的Con_Print函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。