#include "../game/q_shared.h"
#include "../qcommon/qcommon.h"
#include "../renderer/tr_public.h"
#include "../ui/ui_public.h"
#include "keys.h"
#include "snd_public.h"
#include "../cgame/cg_public.h"
#include "../game/bg_public.h"
Include dependency graph for client.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
|
|
Definition at line 78 of file client.h. Referenced by CL_DeltaEntity(), CL_GetParseEntityState(), CL_GetSnapshot(), CL_ParsePacketEntities(), and CL_ParseSnapshot(). |
|
|
|
|
|
Definition at line 143 of file cl_cin.c. 00143 {
00144 int i;
00145
00146 for ( i = 0 ; i < MAX_VIDEO_HANDLES ; i++ ) {
00147 if (cinTable[i].fileName[0] != 0 ) {
00148 CIN_StopCinematic(i);
00149 }
00150 }
00151 }
|
|
|
Definition at line 1589 of file cl_cin.c. References cin_cache::buf, byte, cin_cache::CIN_HEIGHT, cin_cache::CIN_WIDTH, cinTable, cin_cache::dirty, refexport_t::DrawStretchRaw, cin_cache::drawX, cin_cache::drawY, h(), cin_cache::height, Hunk_AllocateTempMemory(), Hunk_FreeTempMemory(), MAX_VIDEO_HANDLES, qtrue, re, SCR_AdjustFrom640(), cin_cache::status, w, cin_cache::width, x, cin_cache::xpos, y, and cin_cache::ypos. Referenced by CL_CgameSystemCalls(), CL_UISystemCalls(), and SCR_DrawCinematic(). 01589 {
01590 float x, y, w, h;
01591 byte *buf;
01592
01593 if (handle < 0 || handle>= MAX_VIDEO_HANDLES || cinTable[handle].status == FMV_EOF) return;
01594
01595 if (!cinTable[handle].buf) {
01596 return;
01597 }
01598
01599 x = cinTable[handle].xpos;
01600 y = cinTable[handle].ypos;
01601 w = cinTable[handle].width;
01602 h = cinTable[handle].height;
01603 buf = cinTable[handle].buf;
01604 SCR_AdjustFrom640( &x, &y, &w, &h );
01605
01606 if (cinTable[handle].dirty && (cinTable[handle].CIN_WIDTH != cinTable[handle].drawX || cinTable[handle].CIN_HEIGHT != cinTable[handle].drawY)) {
01607 int ix, iy, *buf2, *buf3, xm, ym, ll;
01608
01609 xm = cinTable[handle].CIN_WIDTH/256;
01610 ym = cinTable[handle].CIN_HEIGHT/256;
01611 ll = 8;
01612 if (cinTable[handle].CIN_WIDTH==512) {
01613 ll = 9;
01614 }
01615
01616 buf3 = (int*)buf;
01617 buf2 = Hunk_AllocateTempMemory( 256*256*4 );
01618 if (xm==2 && ym==2) {
01619 byte *bc2, *bc3;
01620 int ic, iiy;
01621
01622 bc2 = (byte *)buf2;
01623 bc3 = (byte *)buf3;
01624 for (iy = 0; iy<256; iy++) {
01625 iiy = iy<<12;
01626 for (ix = 0; ix<2048; ix+=8) {
01627 for(ic = ix;ic<(ix+4);ic++) {
01628 *bc2=(bc3[iiy+ic]+bc3[iiy+4+ic]+bc3[iiy+2048+ic]+bc3[iiy+2048+4+ic])>>2;
01629 bc2++;
01630 }
01631 }
01632 }
01633 } else if (xm==2 && ym==1) {
01634 byte *bc2, *bc3;
01635 int ic, iiy;
01636
01637 bc2 = (byte *)buf2;
01638 bc3 = (byte *)buf3;
01639 for (iy = 0; iy<256; iy++) {
01640 iiy = iy<<11;
01641 for (ix = 0; ix<2048; ix+=8) {
01642 for(ic = ix;ic<(ix+4);ic++) {
01643 *bc2=(bc3[iiy+ic]+bc3[iiy+4+ic])>>1;
01644 bc2++;
01645 }
01646 }
01647 }
01648 } else {
01649 for (iy = 0; iy<256; iy++) {
01650 for (ix = 0; ix<256; ix++) {
01651 buf2[(iy<<8)+ix] = buf3[((iy*ym)<<ll) + (ix*xm)];
01652 }
01653 }
01654 }
01655 re.DrawStretchRaw( x, y, w, h, 256, 256, (byte *)buf2, handle, qtrue);
01656 cinTable[handle].dirty = qfalse;
01657 Hunk_FreeTempMemory(buf2);
01658 return;
01659 }
01660
01661 re.DrawStretchRaw( x, y, w, h, cinTable[handle].drawX, cinTable[handle].drawY, buf, handle, cinTable[handle].dirty);
01662 cinTable[handle].dirty = qfalse;
01663 }
|
Here is the call graph for this function:

|
||||||||||||||||||||||||||||
|
Definition at line 1481 of file cl_cin.c. References cin_cache::alterGameState, cin, CIN_HandleForVideo(), cin_cache::CIN_HEIGHT, CIN_loop, CIN_SetExtents(), CIN_SetLooping(), cin_cache::CIN_WIDTH, cinTable, cl_inGameVideo, cls, Com_DPrintf(), Com_Memset(), Com_sprintf(), Con_Close(), cinematics_t::currentHandle, currentHandle, cinematics_t::file, cin_cache::fileName, FS_FOpenFileRead(), FS_Read(), h(), cin_cache::holdAtEnd, i, cin_cache::iFile, initRoQ(), cvar_s::integer, name, NULL, cin_cache::playonwalls, qtrue, RoQ_init(), RoQShutdown(), cin_cache::ROQSize, s_rawend, cin_cache::shader, cin_cache::silent, clientStatic_t::state, cin_cache::status, strcmp(), strcpy(), strstr(), Sys_BeginStreamedFile(), UI_SET_ACTIVE_MENU, UIMENU_NONE, uivm, VM_Call(), w, x, and y. Referenced by CL_CgameSystemCalls(), CL_PlayCinematic_f(), and CL_UISystemCalls(). 01481 {
01482 unsigned short RoQID;
01483 char name[MAX_OSPATH];
01484 int i;
01485
01486 if (strstr(arg, "/") == NULL && strstr(arg, "\\") == NULL) {
01487 Com_sprintf (name, sizeof(name), "video/%s", arg);
01488 } else {
01489 Com_sprintf (name, sizeof(name), "%s", arg);
01490 }
01491
01492 if (!(systemBits & CIN_system)) {
01493 for ( i = 0 ; i < MAX_VIDEO_HANDLES ; i++ ) {
01494 if (!strcmp(cinTable[i].fileName, name) ) {
01495 return i;
01496 }
01497 }
01498 }
01499
01500 Com_DPrintf("SCR_PlayCinematic( %s )\n", arg);
01501
01502 Com_Memset(&cin, 0, sizeof(cinematics_t) );
01503 currentHandle = CIN_HandleForVideo();
01504
01505 cin.currentHandle = currentHandle;
01506
01507 strcpy(cinTable[currentHandle].fileName, name);
01508
01509 cinTable[currentHandle].ROQSize = 0;
01510 cinTable[currentHandle].ROQSize = FS_FOpenFileRead (cinTable[currentHandle].fileName, &cinTable[currentHandle].iFile, qtrue);
01511
01512 if (cinTable[currentHandle].ROQSize<=0) {
01513 Com_DPrintf("play(%s), ROQSize<=0\n", arg);
01514 cinTable[currentHandle].fileName[0] = 0;
01515 return -1;
01516 }
01517
01518 CIN_SetExtents(currentHandle, x, y, w, h);
01519 CIN_SetLooping(currentHandle, (systemBits & CIN_loop)!=0);
01520
01521 cinTable[currentHandle].CIN_HEIGHT = DEFAULT_CIN_HEIGHT;
01522 cinTable[currentHandle].CIN_WIDTH = DEFAULT_CIN_WIDTH;
01523 cinTable[currentHandle].holdAtEnd = (systemBits & CIN_hold) != 0;
01524 cinTable[currentHandle].alterGameState = (systemBits & CIN_system) != 0;
01525 cinTable[currentHandle].playonwalls = 1;
01526 cinTable[currentHandle].silent = (systemBits & CIN_silent) != 0;
01527 cinTable[currentHandle].shader = (systemBits & CIN_shader) != 0;
01528
01529 if (cinTable[currentHandle].alterGameState) {
01530 // close the menu
01531 if ( uivm ) {
01532 VM_Call( uivm, UI_SET_ACTIVE_MENU, UIMENU_NONE );
01533 }
01534 } else {
01535 cinTable[currentHandle].playonwalls = cl_inGameVideo->integer;
01536 }
01537
01538 initRoQ();
01539
01540 FS_Read (cin.file, 16, cinTable[currentHandle].iFile);
01541
01542 RoQID = (unsigned short)(cin.file[0]) + (unsigned short)(cin.file[1])*256;
01543 if (RoQID == 0x1084)
01544 {
01545 RoQ_init();
01546 // FS_Read (cin.file, cinTable[currentHandle].RoQFrameSize+8, cinTable[currentHandle].iFile);
01547 // let the background thread start reading ahead
01548 Sys_BeginStreamedFile( cinTable[currentHandle].iFile, 0x10000 );
01549
01550 cinTable[currentHandle].status = FMV_PLAY;
01551 Com_DPrintf("trFMV::play(), playing %s\n", arg);
01552
01553 if (cinTable[currentHandle].alterGameState) {
01554 cls.state = CA_CINEMATIC;
01555 }
01556
01557 Con_Close();
01558
01559 s_rawend = s_soundtime;
01560
01561 return currentHandle;
01562 }
01563 Com_DPrintf("trFMV::play(), invalid RoQ ID\n");
01564
01565 RoQShutdown();
01566 return -1;
01567 }
|
Here is the call graph for this function:

|
|
Definition at line 1405 of file cl_cin.c. References abs(), cin_cache::alterGameState, cin, cinTable, CL_ScaledMilliseconds(), cls, com_timescale, currentHandle, cinematics_t::currentHandle, e_status, cin_cache::lastTime, cin_cache::looping, MAX_VIDEO_HANDLES, cin_cache::numQuads, cin_cache::playonwalls, RoQInterrupt(), RoQReset(), RoQShutdown(), cin_cache::shader, cin_cache::startTime, clientStatic_t::state, cin_cache::status, cin_cache::tfps, and cvar_s::value. Referenced by CL_CgameSystemCalls(), CL_UISystemCalls(), and SCR_RunCinematic(). 01406 {
01407 // bk001204 - init
01408 int start = 0;
01409 int thisTime = 0;
01410
01411 if (handle < 0 || handle>= MAX_VIDEO_HANDLES || cinTable[handle].status == FMV_EOF) return FMV_EOF;
01412
01413 if (cin.currentHandle != handle) {
01414 currentHandle = handle;
01415 cin.currentHandle = currentHandle;
01416 cinTable[currentHandle].status = FMV_EOF;
01417 RoQReset();
01418 }
01419
01420 if (cinTable[handle].playonwalls < -1)
01421 {
01422 return cinTable[handle].status;
01423 }
01424
01425 currentHandle = handle;
01426
01427 if (cinTable[currentHandle].alterGameState) {
01428 if ( cls.state != CA_CINEMATIC ) {
01429 return cinTable[currentHandle].status;
01430 }
01431 }
01432
01433 if (cinTable[currentHandle].status == FMV_IDLE) {
01434 return cinTable[currentHandle].status;
01435 }
01436
01437 // we need to use CL_ScaledMilliseconds because of the smp mode calls from the renderer
01438 thisTime = CL_ScaledMilliseconds()*com_timescale->value;
01439 if (cinTable[currentHandle].shader && (abs(thisTime - cinTable[currentHandle].lastTime))>100) {
01440 cinTable[currentHandle].startTime += thisTime - cinTable[currentHandle].lastTime;
01441 }
01442 // we need to use CL_ScaledMilliseconds because of the smp mode calls from the renderer
01443 cinTable[currentHandle].tfps = ((((CL_ScaledMilliseconds()*com_timescale->value) - cinTable[currentHandle].startTime)*3)/100);
01444
01445 start = cinTable[currentHandle].startTime;
01446 while( (cinTable[currentHandle].tfps != cinTable[currentHandle].numQuads)
01447 && (cinTable[currentHandle].status == FMV_PLAY) )
01448 {
01449 RoQInterrupt();
01450 if (start != cinTable[currentHandle].startTime) {
01451 // we need to use CL_ScaledMilliseconds because of the smp mode calls from the renderer
01452 cinTable[currentHandle].tfps = ((((CL_ScaledMilliseconds()*com_timescale->value)
01453 - cinTable[currentHandle].startTime)*3)/100);
01454 start = cinTable[currentHandle].startTime;
01455 }
01456 }
01457
01458 cinTable[currentHandle].lastTime = thisTime;
01459
01460 if (cinTable[currentHandle].status == FMV_LOOPED) {
01461 cinTable[currentHandle].status = FMV_PLAY;
01462 }
01463
01464 if (cinTable[currentHandle].status == FMV_EOF) {
01465 if (cinTable[currentHandle].looping) {
01466 RoQReset();
01467 } else {
01468 RoQShutdown();
01469 }
01470 }
01471
01472 return cinTable[currentHandle].status;
01473 }
|
Here is the call graph for this function:

|
||||||||||||||||||||||||
|
Definition at line 1569 of file cl_cin.c. References cinTable, cin_cache::dirty, cin_cache::height, MAX_VIDEO_HANDLES, cin_cache::status, cin_cache::width, cin_cache::xpos, and cin_cache::ypos. Referenced by CIN_PlayCinematic(), CL_CgameSystemCalls(), and CL_UISystemCalls(). 01569 {
01570 if (handle < 0 || handle>= MAX_VIDEO_HANDLES || cinTable[handle].status == FMV_EOF) return;
01571 cinTable[handle].xpos = x;
01572 cinTable[handle].ypos = y;
01573 cinTable[handle].width = w;
01574 cinTable[handle].height = h;
01575 cinTable[handle].dirty = qtrue;
01576 }
|
|
||||||||||||
|
Definition at line 1578 of file cl_cin.c. References cinTable, cin_cache::looping, MAX_VIDEO_HANDLES, and cin_cache::status. Referenced by CIN_PlayCinematic(). 01578 {
01579 if (handle < 0 || handle>= MAX_VIDEO_HANDLES || cinTable[handle].status == FMV_EOF) return;
01580 cinTable[handle].looping = loop;
01581 }
|
|
|
Definition at line 1374 of file cl_cin.c. References cin_cache::alterGameState, cin_cache::buf, cinTable, cls, Com_DPrintf(), currentHandle, e_status, MAX_VIDEO_HANDLES, RoQShutdown(), clientStatic_t::state, and cin_cache::status. Referenced by CIN_CloseAllVideos(), CL_CgameSystemCalls(), CL_UISystemCalls(), and SCR_StopCinematic(). 01374 {
01375
01376 if (handle < 0 || handle>= MAX_VIDEO_HANDLES || cinTable[handle].status == FMV_EOF) return FMV_EOF;
01377 currentHandle = handle;
01378
01379 Com_DPrintf("trFMV::stop(), closing %s\n", cinTable[currentHandle].fileName);
01380
01381 if (!cinTable[currentHandle].buf) {
01382 return FMV_EOF;
01383 }
01384
01385 if (cinTable[currentHandle].alterGameState) {
01386 if ( cls.state != CA_CINEMATIC ) {
01387 return cinTable[currentHandle].status;
01388 }
01389 }
01390 cinTable[currentHandle].status = FMV_EOF;
01391 RoQShutdown();
01392
01393 return FMV_EOF;
01394 }
|
Here is the call graph for this function:

|
|
Definition at line 1718 of file cl_cin.c. References cin_cache::buf, cinTable, cl_inGameVideo, cin_cache::dirty, cvar_s::integer, cin_cache::playonwalls, re, and refexport_t::UploadCinematic. 01718 {
01719 if (handle >= 0 && handle < MAX_VIDEO_HANDLES) {
01720 if (!cinTable[handle].buf) {
01721 return;
01722 }
01723 if (cinTable[handle].playonwalls <= 0 && cinTable[handle].dirty) {
01724 if (cinTable[handle].playonwalls == 0) {
01725 cinTable[handle].playonwalls = -1;
01726 } else {
01727 if (cinTable[handle].playonwalls == -1) {
01728 cinTable[handle].playonwalls = -2;
01729 } else {
01730 cinTable[handle].dirty = qfalse;
01731 }
01732 }
01733 }
01734 re.UploadCinematic( 256, 256, 256, 256, cinTable[handle].buf, handle, cinTable[handle].dirty);
01735 if (cl_inGameVideo->integer == 0 && cinTable[handle].playonwalls == 1) {
01736 cinTable[handle].playonwalls--;
01737 }
01738 }
01739 }
|
|
|
Definition at line 133 of file cl_main.c. References clc, Com_Error(), ERR_DROP, MAX_RELIABLE_COMMANDS, Q_strncpyz(), clientConnection_t::reliableAcknowledge, clientConnection_t::reliableCommands, and clientConnection_t::reliableSequence. Referenced by CL_BeginDownload(), CL_CgameSystemCalls(), CL_CheckUserinfo(), CL_Disconnect(), CL_DownloadsComplete(), CL_ForwardCommandToServer(), CL_ForwardToServer_f(), CL_ParseDownload(), CL_ResetPureClientAtServer(), CL_SendPureChecksums(), and Message_Key(). 00133 {
00134 int index;
00135
00136 // if we would be losing an old command that hasn't been acknowledged,
00137 // we must drop the connection
00138 if ( clc.reliableSequence - clc.reliableAcknowledge > MAX_RELIABLE_COMMANDS ) {
00139 Com_Error( ERR_DROP, "Client command overflow" );
00140 }
00141 clc.reliableSequence++;
00142 index = clc.reliableSequence & ( MAX_RELIABLE_COMMANDS - 1 );
00143 Q_strncpyz( clc.reliableCommands[ index ], cmd, sizeof( clc.reliableCommands[ index ] ) );
00144 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 3265 of file cl_main.c. 03265 {
03266 char ch;
03267 byte sum;
03268 char chs[3];
03269 int i, len;
03270
03271 len = strlen(key);
03272 if( len != CDKEY_LEN ) {
03273 return qfalse;
03274 }
03275
03276 if( checksum && strlen( checksum ) != CDCHKSUM_LEN ) {
03277 return qfalse;
03278 }
03279
03280 sum = 0;
03281 // for loop gets rid of conditional assignment warning
03282 for (i = 0; i < len; i++) {
03283 ch = *key++;
03284 if (ch>='a' && ch<='z') {
03285 ch -= 32;
03286 }
03287 switch( ch ) {
03288 case '2':
03289 case '3':
03290 case '7':
03291 case 'A':
03292 case 'B':
03293 case 'C':
03294 case 'D':
03295 case 'G':
03296 case 'H':
03297 case 'J':
03298 case 'L':
03299 case 'P':
03300 case 'R':
03301 case 'S':
03302 case 'T':
03303 case 'W':
03304 sum += ch;
03305 continue;
03306 default:
03307 return qfalse;
03308 }
03309 }
03310
03311 sprintf(chs, "%02x", sum);
03312
03313 if (checksum && !Q_stricmp(chs, checksum)) {
03314 return qtrue;
03315 }
03316
03317 if (!checksum) {
03318 return qtrue;
03319 }
03320
03321 return qfalse;
03322 }
|
|
|
Definition at line 794 of file cl_cgame.c. References CG_DRAW_ACTIVE_FRAME, cgvm, cl, clc, clientConnection_t::demoplaying, clientActive_t::serverTime, VM_Call(), and VM_Debug(). Referenced by SCR_DrawScreenField(). 00794 {
00795 VM_Call( cgvm, CG_DRAW_ACTIVE_FRAME, cl.serverTime, stereo, clc.demoplaying );
00796 VM_Debug( 0 );
00797 }
|
Here is the call graph for this function:

|
|
Definition at line 2986 of file cl_main.c. References ping_t::adr, cl_pinglist, and netadr_t::port. Referenced by CL_UpdateVisiblePings_f(), and LAN_ClearPing(). 02987 {
02988 if (n < 0 || n >= MAX_PINGREQUESTS)
02989 return;
02990
02991 cl_pinglist[n].adr.port = 0;
02992 }
|
|
|
Definition at line 705 of file cl_main.c. References cl, and Com_Memset(). Referenced by CL_Disconnect(), CL_Init(), and CL_ParseGamestate(). 00705 {
00706
00707 // S_StopAllSounds();
00708
00709 Com_Memset( &cl, 0, sizeof( cl ) );
00710 }
|
Here is the call graph for this function:

|
|
Definition at line 998 of file cl_main.c. References CA_DISCONNECTED, cls, Com_Error(), Cvar_Set(), ERR_DISCONNECT, SCR_StopCinematic(), and clientStatic_t::state. Referenced by CL_Init(), and CL_KeyEvent(). 00998 {
00999 SCR_StopCinematic();
01000 Cvar_Set("ui_singlePlayerActive", "0");
01001 if ( cls.state != CA_DISCONNECTED && cls.state != CA_CINEMATIC ) {
01002 Com_Error (ERR_DISCONNECT, "Disconnected from server");
01003 }
01004 }
|
Here is the call graph for this function:

|
|
|
|
|
Definition at line 885 of file cl_cgame.c. References Cbuf_AddText(), cl, cl_activeAction, clc, cls, Cvar_Set(), clientActive_t::oldServerTime, clientStatic_t::realtime, clSnapshot_t::serverTime, clientActive_t::serverTimeDelta, clientActive_t::snap, clSnapshot_t::snapFlags, clientStatic_t::state, cvar_s::string, Sys_BeginProfiling(), and clientConnection_t::timeDemoBaseTime. Referenced by CL_SetCGameTime(). 00885 {
00886 // ignore snapshots that don't have entities
00887 if ( cl.snap.snapFlags & SNAPFLAG_NOT_ACTIVE ) {
00888 return;
00889 }
00890 cls.state = CA_ACTIVE;
00891
00892 // set the timedelta so we are exactly on this first frame
00893 cl.serverTimeDelta = cl.snap.serverTime - cls.realtime;
00894 cl.oldServerTime = cl.snap.serverTime;
00895
00896 clc.timeDemoBaseTime = cl.snap.serverTime;
00897
00898 // if this is the first frame of active play,
00899 // execute the contents of activeAction now
00900 // this is to allow scripting a timedemo to start right
00901 // after loading
00902 if ( cl_activeAction->string[0] ) {
00903 Cbuf_AddText( cl_activeAction->string );
00904 Cvar_Set( "activeAction", "" );
00905 }
00906
00907 Sys_BeginProfiling();
00908 }
|
Here is the call graph for this function:

|
|
Definition at line 637 of file cl_main.c. 00637 {
00638
00639 // shutdown all the client stuff
00640 CL_ShutdownAll();
00641
00642 // if not running a server clear the whole hunk
00643 if ( !com_sv_running->integer ) {
00644 // clear the whole hunk
00645 Hunk_Clear();
00646 // clear collision map data
00647 CM_ClearMap();
00648 }
00649 else {
00650 // clear all the client data on the hunk
00651 Hunk_ClearToMark();
00652 }
00653
00654 CL_StartHunkUsers();
00655 }
|
|
|
Definition at line 779 of file cl_cgame.c. 00779 {
00780 if ( !cgvm ) {
00781 return qfalse;
00782 }
00783
00784 return VM_Call( cgvm, CG_CONSOLE_COMMAND );
00785 }
|
|
|
|
|