本文整理汇总了C++中SCR_UpdateScreen函数的典型用法代码示例。如果您正苦于以下问题:C++ SCR_UpdateScreen函数的具体用法?C++ SCR_UpdateScreen怎么用?C++ SCR_UpdateScreen使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SCR_UpdateScreen函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CL_UISystemCalls
//.........这里部分代码省略.........
case UI_R_ADDREFENTITYTOSCENE:
re->AddRefEntityToScene( (const refEntity_t *)VMA(1) );
return 0;
case UI_R_ADDPOLYTOSCENE:
re->AddPolyToScene( args[1], args[2], (const polyVert_t *)VMA(3), 1 );
return 0;
case UI_R_ADDLIGHTTOSCENE:
#ifdef VV_LIGHTING
VVLightMan.RE_AddLightToScene( (const float *)VMA(1), VMF(2), VMF(3), VMF(4), VMF(5) );
#else
re->AddLightToScene( (const float *)VMA(1), VMF(2), VMF(3), VMF(4), VMF(5) );
#endif
return 0;
case UI_R_RENDERSCENE:
re->RenderScene( (const refdef_t *)VMA(1) );
return 0;
case UI_R_SETCOLOR:
re->SetColor( (const float *)VMA(1) );
return 0;
case UI_R_DRAWSTRETCHPIC:
re->DrawStretchPic( VMF(1), VMF(2), VMF(3), VMF(4), VMF(5), VMF(6), VMF(7), VMF(8), args[9] );
return 0;
case UI_R_MODELBOUNDS:
re->ModelBounds( args[1], (float *)VMA(2), (float *)VMA(3) );
return 0;
case UI_UPDATESCREEN:
SCR_UpdateScreen();
return 0;
case UI_CM_LERPTAG:
re->LerpTag( (orientation_t *)VMA(1), args[2], args[3], args[4], VMF(5), (const char *)VMA(6) );
return 0;
case UI_S_REGISTERSOUND:
return S_RegisterSound( (const char *)VMA(1) );
case UI_S_STARTLOCALSOUND:
S_StartLocalSound( args[1], args[2] );
return 0;
case UI_KEY_KEYNUMTOSTRINGBUF:
Key_KeynumToStringBuf( args[1], (char *)VMA(2), args[3] );
return 0;
case UI_KEY_GETBINDINGBUF:
Key_GetBindingBuf( args[1], (char *)VMA(2), args[3] );
return 0;
case UI_KEY_SETBINDING:
Key_SetBinding( args[1], (const char *)VMA(2) );
return 0;
case UI_KEY_ISDOWN:
return Key_IsDown( args[1] );
case UI_KEY_GETOVERSTRIKEMODE:
return Key_GetOverstrikeMode();
case UI_KEY_SETOVERSTRIKEMODE:
示例2: CL_CgameSystemCalls
intptr_t CL_CgameSystemCalls( intptr_t *args ) {
#ifndef __NO_JK2
if( com_jk2 && com_jk2->integer )
{
args[0] = (intptr_t)CL_ConvertJK2SysCall((cgameJK2Import_t)args[0]);
}
#endif
switch( args[0] ) {
case CG_PRINT:
Com_Printf( "%s", VMA(1) );
return 0;
case CG_ERROR:
Com_Error( ERR_DROP, S_COLOR_RED"%s", VMA(1) );
return 0;
case CG_MILLISECONDS:
return Sys_Milliseconds();
case CG_CVAR_REGISTER:
Cvar_Register( (vmCvar_t *) VMA(1), (const char *) VMA(2), (const char *) VMA(3), args[4] );
return 0;
case CG_CVAR_UPDATE:
Cvar_Update( (vmCvar_t *) VMA(1) );
return 0;
case CG_CVAR_SET:
Cvar_Set( (const char *) VMA(1), (const char *) VMA(2) );
return 0;
case CG_ARGC:
return Cmd_Argc();
case CG_ARGV:
Cmd_ArgvBuffer( args[1], (char *) VMA(2), args[3] );
return 0;
case CG_ARGS:
Cmd_ArgsBuffer( (char *) VMA(1), args[2] );
return 0;
case CG_FS_FOPENFILE:
return FS_FOpenFileByMode( (const char *) VMA(1), (int *) VMA(2), (fsMode_t) args[3] );
case CG_FS_READ:
FS_Read( VMA(1), args[2], args[3] );
return 0;
case CG_FS_WRITE:
FS_Write( VMA(1), args[2], args[3] );
return 0;
case CG_FS_FCLOSEFILE:
FS_FCloseFile( args[1] );
return 0;
case CG_SENDCONSOLECOMMAND:
Cbuf_AddText( (const char *) VMA(1) );
return 0;
case CG_ADDCOMMAND:
CL_AddCgameCommand( (const char *) VMA(1) );
return 0;
case CG_SENDCLIENTCOMMAND:
CL_AddReliableCommand( (const char *) VMA(1) );
return 0;
case CG_UPDATESCREEN:
// this is used during lengthy level loading, so pump message loop
Com_EventLoop(); // FIXME: if a server restarts here, BAD THINGS HAPPEN!
SCR_UpdateScreen();
return 0;
case CG_RMG_INIT:
/*
if (!com_sv_running->integer)
{ // don't do this if we are connected locally
if (!TheRandomMissionManager)
{
TheRandomMissionManager = new CRMManager;
}
TheRandomMissionManager->SetLandScape( cmg.landScapes[args[1]] );
TheRandomMissionManager->LoadMission(qfalse);
TheRandomMissionManager->SpawnMission(qfalse);
cmg.landScapes[args[1]]->UpdatePatches();
}
*/ //this is SP.. I guess we're always the client and server.
// cl.mRMGChecksum = cm.landScapes[args[1]]->get_rand_seed();
RM_CreateRandomModels(args[1], (const char *)VMA(2));
//cmg.landScapes[args[1]]->rand_seed(cl.mRMGChecksum); // restore it, in case we do a vid restart
cmg.landScape->rand_seed(cmg.landScape->get_rand_seed());
// TheRandomMissionManager->CreateMap();
return 0;
case CG_CM_REGISTER_TERRAIN:
return CM_RegisterTerrain((const char *)VMA(1), false)->GetTerrainId();
case CG_RE_INIT_RENDERER_TERRAIN:
re.InitRendererTerrain((const char *)VMA(1));
return 0;
case CG_CM_LOADMAP:
CL_CM_LoadMap( (const char *) VMA(1), args[2] );
return 0;
case CG_CM_NUMINLINEMODELS:
return CM_NumInlineModels();
case CG_CM_INLINEMODEL:
return CM_InlineModel( args[1] );
case CG_CM_TEMPBOXMODEL:
return CM_TempBoxModel( (const float *) VMA(1), (const float *) VMA(2) );//, (int) VMA(3) );
case CG_CM_POINTCONTENTS:
return CM_PointContents( (float *)VMA(1), args[2] );
case CG_CM_TRANSFORMEDPOINTCONTENTS:
return CM_TransformedPointContents( (const float *) VMA(1), args[2], (const float *) VMA(3), (const float *) VMA(4) );
case CG_CM_BOXTRACE:
CM_BoxTrace( (trace_t *) VMA(1), (const float *) VMA(2), (const float *) VMA(3), (const float *) VMA(4), (const float *) VMA(5), args[6], args[7] );
//.........这里部分代码省略.........
示例3: Console_Key
/*
====================
Console_Key
Handles history and console scrollback
====================
*/
void Console_Key (int key) {
// ctrl-L clears screen
if ( key == 'l' && keys[K_CTRL].down ) {
Cbuf_AddText ("clear\n");
return;
}
// enter finishes the line
if ( key == K_ENTER || key == K_KP_ENTER ) {
// if not in the game explicitly prepend a slash if needed
if ( cls.state != CA_ACTIVE
&& g_consoleField.buffer[0] != '\0'
&& g_consoleField.buffer[0] != '\\'
&& g_consoleField.buffer[0] != '/' ) {
char temp[MAX_EDIT_LINE-1];
Q_strncpyz( temp, g_consoleField.buffer, sizeof( temp ) );
Com_sprintf( g_consoleField.buffer, sizeof( g_consoleField.buffer ), "\\%s", temp );
g_consoleField.cursor++;
}
Com_Printf ( "]%s\n", g_consoleField.buffer );
// leading slash is an explicit command
if ( g_consoleField.buffer[0] == '\\' || g_consoleField.buffer[0] == '/' ) {
Cbuf_AddText( g_consoleField.buffer+1 ); // valid command
Cbuf_AddText ("\n");
} else {
// other text will be chat messages
if ( !g_consoleField.buffer[0] ) {
return; // empty lines just scroll the console without adding to history
} else {
Cbuf_AddText ("cmd say ");
Cbuf_AddText( g_consoleField.buffer );
Cbuf_AddText ("\n");
}
}
// copy line to history buffer
Con_SaveField( &g_consoleField );
Field_Clear( &g_consoleField );
g_consoleField.widthInChars = g_console_field_width;
if ( cls.state == CA_DISCONNECTED ) {
SCR_UpdateScreen (); // force an update, because the command
} // may take some time
return;
}
// command completion
if (key == K_TAB) {
Field_AutoComplete(&g_consoleField);
return;
}
// command history (ctrl-p ctrl-n for unix style)
if ( (key == K_MWHEELUP && keys[K_SHIFT].down) || ( key == K_UPARROW ) || ( key == K_KP_UPARROW ) ||
( ( tolower(key) == 'p' ) && keys[K_CTRL].down ) ) {
Con_HistoryGetPrev( &g_consoleField );
g_consoleField.widthInChars = g_console_field_width;
return;
}
if ( (key == K_MWHEELDOWN && keys[K_SHIFT].down) || ( key == K_DOWNARROW ) || ( key == K_KP_DOWNARROW ) ||
( ( tolower(key) == 'n' ) && keys[K_CTRL].down ) ) {
Con_HistoryGetNext( &g_consoleField );
g_consoleField.widthInChars = g_console_field_width;
return;
}
// console scrolling
if ( key == K_PGUP ) {
if ( keys[K_CTRL].down ) { // hold <ctrl> to accelerate scrolling
Con_PageUp( 0 ); // by one visible page
} else {
Con_PageUp( 1 );
}
return;
}
if ( key == K_PGDN ) {
if ( keys[K_CTRL].down ) { // hold <ctrl> to accelerate scrolling
Con_PageDown( 0 ); // by one visible page
} else {
Con_PageDown( 1 );
}
return;
}
if ( key == K_MWHEELUP ) { //----(SA) added some mousewheel functionality to the console
//.........这里部分代码省略.........
示例4: _Host_Frame
/*
==================
Host_Frame
Runs all active servers
==================
*/
void _Host_Frame (float time)
{
static double time1 = 0;
static double time2 = 0;
static double time3 = 0;
int pass1, pass2, pass3;
if (setjmp (host_abortserver) )
return; // something bad happened, or the server disconnected
// keep the random time dependent
rand ();
// decide the simulation time
if (!Host_FilterTime (time))
return; // don't run too fast, or packets will flood out
// get new key events
Sys_SendKeyEvents ();
// allow mice or other external controllers to add commands
IN_Commands ();
// process console commands
Cbuf_Execute ();
NET_Poll();
// if running the server locally, make intentions now
if (sv.active){
CL_SendCmd ();
}
//-------------------
//
// server operations
//
//-------------------
// check for commands typed to the host
Host_GetConsoleCommands ();
if (sv.active){
Host_ServerFrame ();
}
//-------------------
//
// client operations
//
//-------------------
// if running the server remotely, send intentions now after
// the incoming messages have been read
if (!sv.active){
CL_SendCmd ();
}
host_time += host_frametime;
// fetch results from server
if (cls.state == ca_connected)
{
CL_ReadFromServer ();
}
// update video
if (host_speeds.value)
time1 = Sys_FloatTime ();
SCR_UpdateScreen ();
if (host_speeds.value)
time2 = Sys_FloatTime ();
// update audio
if (cls.signon == SIGNONS)
{
S_Update (r_origin, vpn, vright, vup);
CL_DecayLights ();
}
else
S_Update (vec3_origin, vec3_origin, vec3_origin, vec3_origin);
CDAudio_Update();
if (host_speeds.value)
{
pass1 = (time1 - time3)*1000;
time3 = Sys_FloatTime ();
pass2 = (time2 - time1)*1000;
pass3 = (time3 - time2)*1000;
Con_Printf ("%3i tot %3i server %3i gfx %3i snd\n",
pass1+pass2+pass3, pass1, pass2, pass3);
//.........这里部分代码省略.........
示例5: CL_UISystemCalls
//.........这里部分代码省略.........
case UI_R_ADDCORONATOSCENE:
re.AddCoronaToScene( static_cast<const vec_t*> (VMA( 1 )), VMF( 2 ), VMF( 3 ), VMF( 4 ), VMF( 5 ), args[6], args[7] );
return 0;
case UI_R_RENDERSCENE:
re.RenderScene( static_cast<const refdef_t*> (VMA( 1 )) );
return 0;
case UI_R_SETCOLOR:
re.SetColor( static_cast<const float*> (VMA( 1 )) );
return 0;
#if defined RTCW_ET
case UI_R_DRAW2DPOLYS:
re.Add2dPolys( static_cast<polyVert_t*> (VMA( 1 )), args[2], args[3] );
return 0;
#endif // RTCW_XX
case UI_R_DRAWSTRETCHPIC:
re.DrawStretchPic( VMF( 1 ), VMF( 2 ), VMF( 3 ), VMF( 4 ), VMF( 5 ), VMF( 6 ), VMF( 7 ), VMF( 8 ), args[9] );
return 0;
#if defined RTCW_ET
case UI_R_DRAWROTATEDPIC:
re.DrawRotatedPic( VMF( 1 ), VMF( 2 ), VMF( 3 ), VMF( 4 ), VMF( 5 ), VMF( 6 ), VMF( 7 ), VMF( 8 ), args[9], VMF( 10 ) );
return 0;
#endif // RTCW_XX
case UI_R_MODELBOUNDS:
re.ModelBounds( args[1], static_cast<vec_t*> (VMA( 2 )), static_cast<vec_t*> (VMA( 3 )) );
return 0;
case UI_UPDATESCREEN:
SCR_UpdateScreen();
return 0;
case UI_CM_LERPTAG:
return re.LerpTag( static_cast<orientation_t*> (VMA( 1 )), static_cast<refEntity_t*> (VMA( 2 )), static_cast<const char*> (VMA( 3 )), args[4] );
case UI_S_REGISTERSOUND:
#ifdef DOOMSOUND ///// (SA) DOOMSOUND
return S_RegisterSound( VMA( 1 ) );
#else
#if !defined RTCW_ET
return S_RegisterSound( static_cast<const char*> (VMA( 1 )), qfalse );
#else
return S_RegisterSound( static_cast<const char*> (VMA( 1 )), args[2] );
#endif // RTCW_XX
#endif ///// (SA) DOOMSOUND
case UI_S_STARTLOCALSOUND:
#if !defined RTCW_ET
S_StartLocalSound( args[1], args[2] );
#else
S_StartLocalSound( args[1], args[2], args[3] );
#endif // RTCW_XX
return 0;
#if !defined RTCW_MP
//----(SA) added
case UI_S_FADESTREAMINGSOUND:
S_FadeStreamingSound( VMF( 1 ), args[2], args[3] );
示例6: CL_PrepVideo
/*
=================
CL_PrepVideo
Call before entering a new level, or after changing dlls
=================
*/
void CL_PrepVideo( void )
{
string name, mapname;
int i, mdlcount;
int map_checksum; // dummy
if( !cl.model_precache[1][0] )
return; // no map loaded
Cvar_SetFloat( "scr_loading", 0.0f ); // reset progress bar
MsgDev( D_NOTE, "CL_PrepVideo: %s\n", clgame.mapname );
// let the render dll load the map
Q_strncpy( mapname, cl.model_precache[1], MAX_STRING );
Mod_LoadWorld( mapname, &map_checksum, false );
cl.worldmodel = Mod_Handle( 1 ); // get world pointer
Cvar_SetFloat( "scr_loading", 25.0f );
SCR_UpdateScreen();
// make sure what map is valid
if( !cls.demoplayback && map_checksum != cl.checksum )
Host_Error( "Local map version differs from server: %i != '%i'\n", map_checksum, cl.checksum );
for( i = 0, mdlcount = 0; i < MAX_MODELS && cl.model_precache[i+1][0]; i++ )
mdlcount++; // total num models
for( i = 0; i < MAX_MODELS && cl.model_precache[i+1][0]; i++ )
{
Q_strncpy( name, cl.model_precache[i+1], MAX_STRING );
Mod_RegisterModel( name, i+1 );
Cvar_SetFloat( "scr_loading", scr_loading->value + 75.0f / mdlcount );
if( cl_allow_levelshots->integer || host.developer > 3 || cl.background )
SCR_UpdateScreen();
}
// update right muzzleflash indexes
CL_RegisterMuzzleFlashes ();
// invalidate all decal indexes
Q_memset( cl.decal_index, 0, sizeof( cl.decal_index ));
CL_ClearWorld ();
R_NewMap(); // tell the render about new map
V_SetupOverviewState(); // set overview bounds
// must be called after lightmap loading!
clgame.dllFuncs.pfnVidInit();
// release unused SpriteTextures
for( i = 1; i < MAX_IMAGES; i++ )
{
if( !clgame.sprites[i].name[0] ) continue; // free slot
if( clgame.sprites[i].needload != clgame.load_sequence )
Mod_UnloadSpriteModel( &clgame.sprites[i] );
}
Mod_FreeUnused ();
Cvar_SetFloat( "scr_loading", 100.0f ); // all done
if( host.decalList )
{
// need to reapply all decals after restarting
for( i = 0; i < host.numdecals; i++ )
{
decallist_t *entry = &host.decalList[i];
cl_entity_t *pEdict = CL_GetEntityByIndex( entry->entityIndex );
int decalIndex = CL_DecalIndex( CL_DecalIndexFromName( entry->name ));
int modelIndex = 0;
if( pEdict ) modelIndex = pEdict->curstate.modelindex;
CL_DecalShoot( decalIndex, entry->entityIndex, modelIndex, entry->position, entry->flags );
}
Z_Free( host.decalList );
}
host.decalList = NULL;
host.numdecals = 0;
if( host.soundList )
{
// need to reapply all ambient sounds after restarting
for( i = 0; i < host.numsounds; i++ )
{
soundlist_t *entry = &host.soundList[i];
if( entry->looping && entry->entnum != -1 )
{
MsgDev( D_NOTE, "Restarting sound %s...\n", entry->name );
S_AmbientSound( entry->origin, entry->entnum,
S_RegisterSound( entry->name ), entry->volume, entry->attenuation,
//.........这里部分代码省略.........
示例7: CL_Frame
void
CL_Frame(int msec)
{
static int extratime;
static int lasttimecalled;
if (dedicated->value)
{
return;
}
extratime += msec;
if (!cl_timedemo->value)
{
if ((cls.state == ca_connected) && (extratime < 100))
{
return; /* don't flood packets out while connecting */
}
if (extratime < 1000 / cl_maxfps->value)
{
return; /* framerate is too high */
}
}
/* decide the simulation time */
cls.frametime = extratime / 1000.0;
cl.time += extratime;
cls.realtime = curtime;
extratime = 0;
if (cls.frametime > (1.0 / 5))
{
cls.frametime = (1.0 / 5);
}
/* if in the debugger last frame, don't timeout */
if (msec > 5000)
{
cls.netchan.last_received = Sys_Milliseconds();
}
/* fetch results from server */
CL_ReadPackets();
/* send a new command message to the server */
CL_SendCommand();
/* predict all unacknowledged movements */
CL_PredictMovement();
/* allow renderer DLL change */
VID_CheckChanges();
if (!cl.refresh_prepped && (cls.state == ca_active))
{
CL_PrepRefresh();
}
/* update the screen */
if (host_speeds->value)
{
time_before_ref = Sys_Milliseconds();
}
SCR_UpdateScreen();
if (host_speeds->value)
{
time_after_ref = Sys_Milliseconds();
}
/* update audio */
S_Update(cl.refdef.vieworg, cl.v_forward, cl.v_right, cl.v_up);
#ifdef CDA
CDAudio_Update();
#endif
/* advance local effects for next frame */
CL_RunDLights();
CL_RunLightStyles();
SCR_RunCinematic();
SCR_RunConsole();
cls.framecount++;
if (log_stats->value)
{
if (cls.state == ca_active)
{
if (!lasttimecalled)
{
lasttimecalled = Sys_Milliseconds();
//.........这里部分代码省略.........
示例8: Key_Console
/*
====================
Key_Console
Interactive line editing and console scrollback
====================
*/
static void Key_Console (int key)
{
int history_line_last;
size_t len;
char *workline = key_lines[edit_line];
switch (key)
{
case K_ENTER:
// backslash text are commands, else chat
if (workline[1] == '\\' || workline[1] == '/')
Cbuf_AddText (workline + 2); // skip the >
else if (CheckForCommand())
Cbuf_AddText (workline + 1); // valid command
else
{ // convert to a chat message
if (cls.state >= ca_connected)
Cbuf_AddText ("say ");
Cbuf_AddText (workline + 1); // skip the >
}
Cbuf_AddText ("\n");
Con_Printf ("%s\n", workline);
edit_line = (edit_line + 1) & 31;
history_line = edit_line;
key_lines[edit_line][0] = ']';
key_lines[edit_line][1] = 0;
key_linepos = 1;
if (cls.state == ca_disconnected)
SCR_UpdateScreen (); // force an update, because the command
// may take some time
return;
case K_TAB:
CompleteCommand ();
return;
case K_LEFTARROW:
if (key_linepos < 2)
return;
if (keydown[K_CTRL])
{
/* ctrl - left, word processor style: first,
* move to the ending of previous word, then
* move to its beginning
*/
char *p = workline + key_linepos - 1;
while (p != workline && *p == ' ')
--p;
while (p != workline)
{
if (*--p == ' ')
break;
}
key_linepos = (int)(p - workline) + 1;
}
else /* simple cursor-to-left, only. */
{
--key_linepos;
}
return;
case K_RIGHTARROW:
if (!workline[key_linepos])
return;
if (keydown[K_CTRL])
{
/* ctrl - right, word processor style: if
* we are on a text move to its end, then
* move to the beginning of the next word
*/
char *p = workline + key_linepos;
while (*p && *p != ' ')
++p;
while (*p && *p == ' ')
++p;
key_linepos = (int)(p - workline);
}
else /* simple cursor-to-right only. */
{
++key_linepos;
}
return;
case K_BACKSPACE:
if (key_linepos > 1)
{
workline += key_linepos - 1;
if (workline[1])
{
len = strlen(workline);
memmove (workline, workline + 1, len);
}
//.........这里部分代码省略.........
示例9: CL_CgameSystemCalls
/*
====================
CL_CgameSystemCalls
The cgame module is making a system call
====================
*/
intptr_t CL_CgameSystemCalls( intptr_t *args ) {
switch ( args[0] ) {
case CG_PRINT:
Com_Printf( "%s", VMA( 1 ) );
return 0;
case CG_ERROR:
Com_Error( ERR_DROP, "%s", VMA( 1 ) );
return 0;
case CG_MILLISECONDS:
return Sys_Milliseconds();
case CG_CVAR_REGISTER:
Cvar_Register( VMA( 1 ), VMA( 2 ), VMA( 3 ), args[4] );
return 0;
case CG_CVAR_UPDATE:
Cvar_Update( VMA( 1 ) );
return 0;
case CG_CVAR_SET:
Cvar_Set( VMA( 1 ), VMA( 2 ) );
return 0;
case CG_CVAR_VARIABLESTRINGBUFFER:
Cvar_VariableStringBuffer( VMA( 1 ), VMA( 2 ), args[3] );
return 0;
case CG_ARGC:
return Cmd_Argc();
case CG_ARGV:
Cmd_ArgvBuffer( args[1], VMA( 2 ), args[3] );
return 0;
case CG_ARGS:
Cmd_ArgsBuffer( VMA( 1 ), args[2] );
return 0;
case CG_FS_FOPENFILE:
return FS_FOpenFileByMode( VMA( 1 ), VMA( 2 ), args[3] );
case CG_FS_READ:
FS_Read( VMA( 1 ), args[2], args[3] );
return 0;
case CG_FS_WRITE:
return FS_Write( VMA( 1 ), args[2], args[3] );
case CG_FS_FCLOSEFILE:
FS_FCloseFile( args[1] );
return 0;
case CG_SENDCONSOLECOMMAND:
Cbuf_AddText( VMA( 1 ) );
return 0;
case CG_ADDCOMMAND:
CL_AddCgameCommand( VMA( 1 ) );
return 0;
case CG_REMOVECOMMAND:
Cmd_RemoveCommand( VMA( 1 ) );
return 0;
case CG_SENDCLIENTCOMMAND:
CL_AddReliableCommand( VMA( 1 ) );
return 0;
case CG_UPDATESCREEN:
// this is used during lengthy level loading, so pump message loop
// Com_EventLoop(); // FIXME: if a server restarts here, BAD THINGS HAPPEN!
// We can't call Com_EventLoop here, a restart will crash and this _does_ happen
// if there is a map change while we are downloading at pk3.
// ZOID
SCR_UpdateScreen();
return 0;
case CG_CM_LOADMAP:
CL_CM_LoadMap( VMA( 1 ) );
return 0;
case CG_CM_NUMINLINEMODELS:
return CM_NumInlineModels();
case CG_CM_INLINEMODEL:
return CM_InlineModel( args[1] );
case CG_CM_TEMPBOXMODEL:
return CM_TempBoxModel( VMA( 1 ), VMA( 2 ), qfalse );
case CG_CM_TEMPCAPSULEMODEL:
return CM_TempBoxModel( VMA( 1 ), VMA( 2 ), qtrue );
case CG_CM_POINTCONTENTS:
return CM_PointContents( VMA( 1 ), args[2] );
case CG_CM_TRANSFORMEDPOINTCONTENTS:
return CM_TransformedPointContents( VMA( 1 ), args[2], VMA( 3 ), VMA( 4 ) );
case CG_CM_BOXTRACE:
CM_BoxTrace( VMA( 1 ), VMA( 2 ), VMA( 3 ), VMA( 4 ), VMA( 5 ), args[6], args[7], /*int capsule*/ qfalse );
return 0;
case CG_CM_TRANSFORMEDBOXTRACE:
CM_TransformedBoxTrace( VMA( 1 ), VMA( 2 ), VMA( 3 ), VMA( 4 ), VMA( 5 ), args[6], args[7], VMA( 8 ), VMA( 9 ), /*int capsule*/ qfalse );
return 0;
case CG_CM_CAPSULETRACE:
CM_BoxTrace( VMA( 1 ), VMA( 2 ), VMA( 3 ), VMA( 4 ), VMA( 5 ), args[6], args[7], /*int capsule*/ qtrue );
return 0;
case CG_CM_TRANSFORMEDCAPSULETRACE:
CM_TransformedBoxTrace( VMA( 1 ), VMA( 2 ), VMA( 3 ), VMA( 4 ), VMA( 5 ), args[6], args[7], VMA( 8 ), VMA( 9 ), /*int capsule*/ qtrue );
return 0;
case CG_CM_MARKFRAGMENTS:
return re.MarkFragments( args[1], VMA( 2 ), VMA( 3 ), args[4], VMA( 5 ), args[6], VMA( 7 ) );
case CG_S_STARTSOUND:
S_StartSound( VMA( 1 ), args[2], args[3], args[4] );
return 0;
//----(SA) added
//.........这里部分代码省略.........
示例10: CL_CgameSystemCalls
/*
====================
CL_CgameSystemCalls
The cgame module is making a system call
====================
*/
intptr_t CL_CgameSystemCalls( intptr_t *args ) {
switch( args[0] ) {
case CG_PRINT:
Com_Printf( "%s", VMA(1) );
return 0;
case CG_FATAL_ERROR:
Com_Error( ERR_DROP, "%s", VMA(1) );
return 0;
case CG_MILLISECONDS:
return Sys_Milliseconds();
case CG_CVAR_REGISTER:
Cvar_Register( VMA(1), VMA(2), VMA(3), args[4] );
return 0;
case CG_CVAR_UPDATE:
Cvar_Update( VMA(1) );
return 0;
case CG_CVAR_SET:
Cvar_Set( VMA(1), VMA(2) );
return 0;
case CG_CVAR_VARIABLESTRINGBUFFER:
Cvar_VariableStringBuffer( VMA(1), VMA(2), args[3] );
return 0;
case CG_ARGC:
return Cmd_Argc();
case CG_ARGV:
Cmd_ArgvBuffer( args[1], VMA(2), args[3] );
return 0;
case CG_ARGVI:
return atoi( Cmd_Argv( args[1] ) );
case CG_ARGS:
Cmd_ArgsBuffer( VMA(1), args[2] );
return 0;
case CG_CMD_EXECUTETEXT:
Cbuf_ExecuteText( args[1], VMA(2) );
return 0;
case CG_FS_FOPENFILE:
return FS_FOpenFileByMode( VMA(1), VMA(2), args[3] );
case CG_FS_READ:
FS_Read( VMA(1), args[2], args[3] );
return 0;
case CG_FS_WRITE:
FS_Write( VMA(1), args[2], args[3] );
return 0;
case CG_FS_FCLOSEFILE:
FS_FCloseFile( args[1] );
return 0;
case CG_SENDCONSOLECOMMAND:
Cbuf_AddText( VMA(1) );
return 0;
case CG_FORWARDCOMMAND:
VM_Call( uivm, UI_CONSOLE_COMMAND, cls.realtime );
return 0;
case CG_ADDCOMMAND:
CL_AddCgameCommand( VMA(1) );
return 0;
case CG_REMOVECOMMAND:
Cmd_RemoveCommand( VMA(1) );
return 0;
case CG_SENDCLIENTCOMMAND:
CL_AddReliableCommand( VMA(1) );
return 0;
case CG_UPDATESCREEN:
// this is used during lengthy level loading, so pump message loop
// Com_EventLoop(); // FIXME: if a server restarts here, BAD THINGS HAPPEN!
// We can't call Com_EventLoop here, a restart will crash and this _does_ happen
// if there is a map change while we are downloading at pk3.
// ZOID
SCR_UpdateScreen();
return 0;
case CG_CM_LOADMAP:
CL_CM_LoadMap( VMA(1) );
return 0;
case CG_CM_NUMINLINEMODELS:
return CM_NumInlineModels();
case CG_CM_INLINEMODEL:
return CM_InlineModel( args[1] );
case CG_CM_TEMPBOXMODEL:
return CM_TempBoxModel( VMA(1), VMA(2), /*int capsule*/ qfalse );
case CG_CM_TEMPCAPSULEMODEL:
return CM_TempBoxModel( VMA(1), VMA(2), /*int capsule*/ qtrue );
case CG_CM_POINTCONTENTS:
return CM_PointContents( VMA(1), args[2] );
case CG_CM_TRANSFORMEDPOINTCONTENTS:
return CM_TransformedPointContents( VMA(1), args[2], VMA(3), VMA(4) );
case CG_CM_BOXTRACE:
CM_BoxTrace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], /*int capsule*/ qfalse );
return 0;
case CG_CM_CAPSULETRACE:
CM_BoxTrace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], /*int capsule*/ qtrue );
return 0;
case CG_CM_TRANSFORMEDBOXTRACE:
CM_TransformedBoxTrace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], VMA(8), VMA(9), /*int capsule*/ qfalse );
return 0;
//.........这里部分代码省略.........
示例11: CL_CgameSystemCalls
//.........这里部分代码省略.........
case CG_FS_GETFILELIST:
VM_CheckBlock( args[3], args[4], "FSGFL" );
return FS_GetFileList( VMA( 1 ), VMA( 2 ), VMA( 3 ), args[ 4 ] );
case CG_FS_DELETEFILE:
return FS_Delete( VMA( 1 ) );
case CG_SENDCONSOLECOMMAND:
Cbuf_AddText( VMA( 1 ) );
return 0;
case CG_ADDCOMMAND:
CL_AddCgameCommand( VMA( 1 ) );
return 0;
case CG_REMOVECOMMAND:
Cmd_RemoveCommand( VMA( 1 ) );
return 0;
case CG_COMPLETE_CALLBACK:
if ( completer )
{
completer( VMA( 1 ) );
}
return 0;
case CG_SENDCLIENTCOMMAND:
CL_AddReliableCommand( VMA( 1 ) );
return 0;
case CG_UPDATESCREEN:
SCR_UpdateScreen();
return 0;
case CG_CM_LOADMAP:
CL_CM_LoadMap( VMA( 1 ) );
return 0;
case CG_CM_NUMINLINEMODELS:
return CM_NumInlineModels();
case CG_CM_INLINEMODEL:
return CM_InlineModel( args[ 1 ] );
case CG_CM_TEMPBOXMODEL:
return CM_TempBoxModel( VMA( 1 ), VMA( 2 ), qfalse );
case CG_CM_TEMPCAPSULEMODEL:
return CM_TempBoxModel( VMA( 1 ), VMA( 2 ), qtrue );
case CG_CM_POINTCONTENTS:
return CM_PointContents( VMA( 1 ), args[ 2 ] );
case CG_CM_TRANSFORMEDPOINTCONTENTS:
return CM_TransformedPointContents( VMA( 1 ), args[ 2 ], VMA( 3 ), VMA( 4 ) );
case CG_CM_BOXTRACE:
CM_BoxTrace( VMA( 1 ), VMA( 2 ), VMA( 3 ), VMA( 4 ), VMA( 5 ), args[ 6 ], args[ 7 ], TT_AABB );
return 0;
case CG_CM_TRANSFORMEDBOXTRACE:
CM_TransformedBoxTrace( VMA( 1 ), VMA( 2 ), VMA( 3 ), VMA( 4 ), VMA( 5 ), args[ 6 ], args[ 7 ], VMA( 8 ), VMA( 9 ), TT_AABB );
return 0;
示例12: CL_Frame
//.........这里部分代码省略.........
}
lodFrameCount++;
if(lodFrameCount==5 && bias > 0)
{
bias--;
Cvar_SetValue("r_lodBias", bias);
lodFrameCount = 0;
}
}
frameCount++;
if(in_camera)
{
// No LOD stuff during cutscenes
Cvar_SetValue("r_lodBias", 0);
}
cls.frametimeFraction=fractionMsec;
cls.realtime += msec;
cls.realtimeFraction+=fractionMsec;
if (cls.realtimeFraction>=1.0f)
{
if (cl_newClock&&cl_newClock->integer)
{
cls.realtime++;
}
cls.realtimeFraction-=1.0f;
}
#ifndef _XBOX
if ( cl_timegraph->integer ) {
SCR_DebugGraph ( cls.realFrametime * 0.25, 0 );
}
#endif
#ifdef _XBOX
//Check on the hot swappable button states.
CL_UpdateHotSwap();
#endif
// see if we need to update any userinfo
CL_CheckUserinfo();
// if we haven't gotten a packet in a long time,
// drop the connection
CL_CheckTimeout();
// send intentions now
CL_SendCmd();
// resend a connection request if necessary
CL_CheckForResend();
// decide on the serverTime to render
CL_SetCGameTime();
if (cl_pano->integer && cls.state == CA_ACTIVE) { //grab some panoramic shots
int i = 1;
int pref = cl_pano->integer;
int oldnoprint = cl_noprint->integer;
Con_Close();
cl_noprint->integer = 1; //hide the screen shot msgs
for (; i <= cl_panoNumShots->integer; i++) {
Cvar_SetValue( "pano", i );
SCR_UpdateScreen();// update the screen
Cbuf_ExecuteText( EXEC_NOW, va("screenshot %dpano%02d\n", pref, i) ); //grab this screen
}
Cvar_SetValue( "pano", 0 ); //done
cl_noprint->integer = oldnoprint;
}
if (cl_skippingcin->integer && !cl_endcredits->integer && !com_developer->integer ) {
if (cl_skippingcin->modified){
S_StopSounds(); //kill em all but music
cl_skippingcin->modified=qfalse;
Com_Printf (va(S_COLOR_YELLOW"%s"), SE_GetString("CON_TEXT_SKIPPING"));
SCR_UpdateScreen();
}
} else {
// update the screen
SCR_UpdateScreen();
#if defined(_XBOX) && !defined(FINAL_BUILD)
if (D3DPERF_QueryRepeatFrame())
SCR_UpdateScreen();
#endif
}
// update audio
S_Update();
#ifdef _IMMERSION
FF_Update();
#endif // _IMMERSION
// advance local effects for next frame
SCR_RunCinematic();
Con_RunConsole();
cls.framecount++;
}
示例13: CL_UISystemCalls
//.........这里部分代码省略.........
re.AddCoronaToScene( VMA( 1 ), VMF( 2 ), VMF( 3 ), VMF( 4 ), VMF( 5 ), args[ 6 ], args[ 7 ] );
return 0;
case UI_R_RENDERSCENE:
re.RenderScene( VMA( 1 ) );
return 0;
case UI_R_SETCOLOR:
re.SetColor( VMA( 1 ) );
return 0;
// Tremulous
case UI_R_SETCLIPREGION:
re.SetClipRegion( VMA( 1 ) );
return 0;
case UI_R_DRAW2DPOLYS:
re.Add2dPolys( VMA( 1 ), args[ 2 ], args[ 3 ] );
return 0;
case UI_R_DRAWSTRETCHPIC:
re.DrawStretchPic( VMF( 1 ), VMF( 2 ), VMF( 3 ), VMF( 4 ), VMF( 5 ), VMF( 6 ), VMF( 7 ), VMF( 8 ), args[ 9 ] );
return 0;
case UI_R_DRAWROTATEDPIC:
re.DrawRotatedPic( VMF( 1 ), VMF( 2 ), VMF( 3 ), VMF( 4 ), VMF( 5 ), VMF( 6 ), VMF( 7 ), VMF( 8 ), args[ 9 ], VMF( 10 ) );
return 0;
case UI_R_MODELBOUNDS:
re.ModelBounds( args[ 1 ], VMA( 2 ), VMA( 3 ) );
return 0;
case UI_UPDATESCREEN:
SCR_UpdateScreen();
return 0;
case UI_CM_LERPTAG:
return re.LerpTag( VMA( 1 ), VMA( 2 ), VMA( 3 ), args[ 4 ] );
case UI_S_REGISTERSOUND:
#ifdef DOOMSOUND ///// (SA) DOOMSOUND
return S_RegisterSound( VMA( 1 ) );
#else
return S_RegisterSound( VMA( 1 ), args[ 2 ] );
#endif ///// (SA) DOOMSOUND
case UI_S_STARTLOCALSOUND:
//S_StartLocalSound(args[1], args[2], args[3]);
S_StartLocalSound( args[ 1 ], args[ 2 ] );
return 0;
case UI_S_FADESTREAMINGSOUND:
// FIXME
//S_FadeStreamingSound(VMF(1), args[2], args[3]);
return 0;
case UI_S_FADEALLSOUNDS:
// FIXME
//S_FadeAllSounds(VMF(1), args[2], args[3]);
return 0;
case UI_KEY_KEYNUMTOSTRINGBUF:
VM_CheckBlock( args[2], args[3], "KEYNTSB" );
Key_KeynumToStringBuf( args[ 1 ], VMA( 2 ), args[ 3 ] );
return 0;
示例14: CL_CgameSystemCalls
/*
====================
CL_CgameSystemCalls
The cgame module is making a system call
====================
*/
intptr_t CL_CgameSystemCalls( intptr_t *args )
{
if( cls.cgInterface == 2 && args[0] >= CG_R_SETCLIPREGION && args[0] < CG_MEMSET )
{
if( args[0] < CG_S_STOPBACKGROUNDTRACK - 1 )
args[0] += 1;
else if( args[0] < CG_S_STOPBACKGROUNDTRACK + 4 )
args[0] += CG_PARSE_ADD_GLOBAL_DEFINE - CG_S_STOPBACKGROUNDTRACK + 1;
else if( args[0] < CG_PARSE_ADD_GLOBAL_DEFINE + 4 )
args[0] -= 4;
else if( args[0] >= CG_PARSE_SOURCE_FILE_AND_LINE && args[0] <= CG_S_SOUNDDURATION )
args[0] = CG_PARSE_SOURCE_FILE_AND_LINE - 1337 - args[0] ;
}
switch( args[0] )
{
case CG_PRINT:
Com_Printf( "%s", (const char*)VMA(1) );
return 0;
case CG_ERROR:
if( probingCG )
{
cls.cgInterface = 2; // this is a 1.1.0 cgame
return 0;
}
Com_Error( ERR_DROP, "%s", (const char*)VMA(1) );
return 0;
case CG_MILLISECONDS:
return Sys_Milliseconds();
case CG_CVAR_REGISTER:
Cvar_Register( (vmCvar_t*)VMA(1), (const char*)VMA(2), (const char*)VMA(3), args[4] );
return 0;
case CG_CVAR_UPDATE:
Cvar_Update( (vmCvar_t*)VMA(1) );
return 0;
case CG_CVAR_SET:
Cvar_SetSafe( (const char*)VMA(1), (const char*)VMA(2) );
return 0;
case CG_CVAR_VARIABLESTRINGBUFFER:
Cvar_VariableStringBuffer( (const char*)VMA(1), (char*)VMA(2), args[3] );
return 0;
case CG_ARGC:
return Cmd_Argc();
case CG_ARGV:
Cmd_ArgvBuffer( args[1], (char*)VMA(2), args[3] );
return 0;
case CG_ARGS:
Cmd_ArgsBuffer( (char*)VMA(1), args[2] );
return 0;
case CG_LITERAL_ARGS:
Cmd_LiteralArgsBuffer( (char*)VMA(1), args[2] );
return 0;
case CG_FS_FOPENFILE:
return FS_FOpenFileByMode( (const char*)VMA(1), (fileHandle_t*)VMA(2), (FS_Mode)args[3] );
case CG_FS_READ:
FS_Read( VMA(1), args[2], args[3] );
return 0;
case CG_FS_WRITE:
FS_Write( VMA(1), args[2], args[3] );
return 0;
case CG_FS_FCLOSEFILE:
FS_FCloseFile( args[1] );
return 0;
case CG_FS_SEEK:
return FS_Seek( (fileHandle_t)args[1], args[2], (FS_Origin)args[3] );
case CG_FS_GETFILELIST:
return FS_GetFileList( (const char*)VMA(1), (const char*)VMA(2), (char*)VMA(3), args[4] );
case CG_SENDCONSOLECOMMAND:
Cbuf_AddText( (const char*)VMA(1) );
return 0;
case CG_ADDCOMMAND:
CL_AddCgameCommand( (const char*)VMA(1) );
return 0;
case CG_REMOVECOMMAND:
Cmd_RemoveCommandSafe( (const char*)VMA(1) );
return 0;
case CG_SENDCLIENTCOMMAND:
CL_AddReliableCommand((const char*)VMA(1), false);
return 0;
case CG_UPDATESCREEN:
// this is used during lengthy level loading, so pump message loop
// Com_EventLoop(); // FIXME: if a server restarts here, BAD THINGS HAPPEN!
// We can't call Com_EventLoop here, a restart will crash and this _does_ happen
// if there is a map change while we are downloading at pk3.
// ZOID
SCR_UpdateScreen();
return 0;
case CG_CM_LOADMAP:
CL_CM_LoadMap( (const char*)VMA(1) );
return 0;
//.........这里部分代码省略.........
示例15: SCR_UpdateWholeScreen
/*
==================
SCR_UpdateWholeScreen
==================
*/
void SCR_UpdateWholeScreen (void)
{
scr_fullupdate = 0;
SCR_UpdateScreen ();
}