本文整理汇总了C++中R_TakeScreenshot函数的典型用法代码示例。如果您正苦于以下问题:C++ R_TakeScreenshot函数的具体用法?C++ R_TakeScreenshot怎么用?C++ R_TakeScreenshot使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了R_TakeScreenshot函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: R_ScreenShotJPEG_f
void R_ScreenShotJPEG_f() {
// if we have saved a previous screenshot, don't scan
// again, because recording demo avis can involve
// thousands of shots
static int lastNumber = 0;
if ( !String::Cmp( Cmd_Argv( 1 ), "levelshot" ) ) {
R_LevelShot();
return;
}
bool silent = !String::Cmp( Cmd_Argv( 1 ), "silent" );
char checkname[ MAX_OSPATH ];
if ( Cmd_Argc() == 2 && !silent ) {
// explicit filename
String::Sprintf( checkname, MAX_OSPATH, "screenshots/%s.jpg", Cmd_Argv( 1 ) );
} else {
// scan for a free filename
if ( !R_FindAvailableScreenshotFilename( lastNumber, checkname, "jpg" ) ) {
return;
}
}
if ( GGameType & GAME_Tech3 ) {
R_TakeScreenshot( 0, 0, glConfig.vidWidth, glConfig.vidHeight, checkname, true );
} else {
R_TakeScreenshot( 0, 0, glConfig.vidWidth, glConfig.vidHeight, checkname, true );
}
if ( !silent ) {
common->Printf( "Wrote %s\n", checkname );
}
}
示例2: R_ScreenShotPNG_f
void R_ScreenShotPNG_f (void) {
char checkname[MAX_OSPATH];
static int lastNumber = -1;
qboolean silent;
qboolean levelshot;
if ( !strcmp( ri.Cmd_Argv(1), "levelshot" ) ) {
R_LevelShot( ST_PNG, ".png" );
levelshot = qtrue;
} else {
levelshot = qfalse;
}
if ( !strcmp( ri.Cmd_Argv(1), "silent" ) ) {
silent = qtrue;
} else {
silent = qfalse;
}
if ( levelshot ) {
sprintf( checkname, "levelshots/%s.png", tr.world->baseName );
} else if ( ri.Cmd_Argc() == 2 && !silent ) {
// explicit filename
Com_sprintf( checkname, MAX_OSPATH, "screenshots/%s.png", ri.Cmd_Argv( 1 ) );
} else {
// scan for a free filename
// if we have saved a previous screenshot, don't scan
// again, because recording demo avis can involve
// thousands of shots
if ( lastNumber == -1 ) {
lastNumber = 0;
}
// scan for a free number
for ( ; lastNumber <= 9999 ; lastNumber++ ) {
R_ScreenshotFilename( lastNumber, checkname, ".png" );
if (!ri.FS_FileExists( checkname ))
{
break; // file doesn't exist
}
}
if ( lastNumber >= 9999 ) {
ri.Printf (PRINT_ALL, "ScreenShot: Couldn't create a file\n");
return;
}
lastNumber++;
}
R_TakeScreenshot( 0, 0, glConfig.vidWidth, glConfig.vidHeight, checkname, ST_PNG );
if ( !silent ) {
ri.Printf (PRINT_ALL, "Wrote %s\n", checkname);
}
}
示例3: R_ScreenShotTGA_f
/*
==================
R_ScreenShotTGA_f
screenshot
screenshot [silent]
screenshot [levelshot]
screenshot [filename]
Doesn't print the pacifier message if there is a second arg
==================
*/
void R_ScreenShotTGA_f (void) {
#ifndef _XBOX
char checkname[MAX_OSPATH];
int len;
static int lastNumber = -1;
qboolean silent;
if ( !strcmp( Cmd_Argv(1), "levelshot" ) ) {
R_LevelShot();
return;
}
if ( !strcmp( Cmd_Argv(1), "silent" ) ) {
silent = qtrue;
} else {
silent = qfalse;
}
if ( Cmd_Argc() == 2 && !silent ) {
// explicit filename
Com_sprintf( checkname, MAX_OSPATH, "screenshots/%s.tga", Cmd_Argv( 1 ) );
} else {
// scan for a free filename
// if we have saved a previous screenshot, don't scan
// again, because recording demo avis can involve
// thousands of shots
if ( lastNumber == -1 ) {
// scan for a free number
for ( lastNumber = 0 ; lastNumber <= 9999 ; lastNumber++ ) {
R_ScreenshotFilename( lastNumber, checkname, ".tga" );
len = FS_ReadFile( checkname, NULL );
if ( len <= 0 ) {
break; // file doesn't exist
}
}
} else {
R_ScreenshotFilename( lastNumber, checkname, ".tga" );
}
if ( lastNumber == 10000 ) {
VID_Printf (PRINT_ALL, "ScreenShot: Couldn't create a file\n");
return;
}
lastNumber++;
}
R_TakeScreenshot( 0, 0, glConfig.vidWidth, glConfig.vidHeight, checkname );
if ( !silent ) {
VID_Printf (PRINT_ALL, "Wrote %s\n", checkname);
}
#endif
}
示例4: R_ScreenShotJPEG_f
void
R_ScreenShotJPEG_f(void)
{
char checkname[MAX_OSPATH];
static int lastNumber = -1;
qbool silent;
if(!strcmp(ri.cmdargv(1), "levelshot")){
R_LevelShot();
return;
}
if(!strcmp(ri.cmdargv(1), "silent")){
silent = qtrue;
}else{
silent = qfalse;
}
if(ri.cmdargc() == 2 && !silent){
/* explicit filename */
Q_sprintf(checkname, MAX_OSPATH, "screenshots/%s.jpg", ri.cmdargv(1));
}else{
/* scan for a free filename */
/* if we have saved a previous screenshot, don't scan
* again, because recording demo avis can involve
* thousands of shots */
if(lastNumber == -1){
lastNumber = 0;
}
/* scan for a free number */
for(; lastNumber <= 9999; lastNumber++){
R_ScreenshotFilenameJPEG(lastNumber, checkname);
if(!ri.fsfileexists(checkname)){
break; /* file doesn't exist */
}
}
if(lastNumber == 10000){
ri.Printf (PRINT_ALL, "ScreenShot: Couldn't create a file\n");
return;
}
lastNumber++;
}
R_TakeScreenshot(0, 0, glConfig.vidWidth, glConfig.vidHeight, checkname, qtrue);
if(!silent){
ri.Printf (PRINT_ALL, "Wrote %s\n", checkname);
}
}
示例5: R_ScreenShot_f
//.........这里部分代码省略.........
}
else
{
format = SSF_TGA;
}
if ( !strcmp( ri.Cmd_Argv( 1 ), "silent" ) )
{
silent = qtrue;
}
else
{
silent = qfalse;
}
if ( ri.Cmd_Argc() == 2 && !silent )
{
// explicit filename
switch ( format )
{
case SSF_TGA:
Com_sprintf( checkname, MAX_OSPATH, "screenshots/%s.tga", ri.Cmd_Argv( 1 ) );
break;
case SSF_JPEG:
Com_sprintf( checkname, MAX_OSPATH, "screenshots/%s.jpeg", ri.Cmd_Argv( 1 ) );
break;
case SSF_PNG:
Com_sprintf( checkname, MAX_OSPATH, "screenshots/%s.png", ri.Cmd_Argv( 1 ) );
break;
}
}
else
{
// scan for a free filename
// if we have saved a previous screenshot, don't scan
// again, because recording demo avis can involve
// thousands of shots
if ( lastNumber == -1 )
{
lastNumber = 0;
}
// scan for a free number
for ( ; lastNumber <= 9999; lastNumber++ )
{
switch ( format )
{
case SSF_TGA:
R_ScreenshotFilename( lastNumber, checkname );
break;
case SSF_JPEG:
R_ScreenshotFilenameJPEG( lastNumber, checkname );
break;
case SSF_PNG:
R_ScreenshotFilenamePNG( lastNumber, checkname );
break;
}
len = ri.FS_ReadFile( checkname, NULL );
if ( len <= 0 )
{
break; // file doesn't exist
}
}
if ( lastNumber >= 10000 )
{
ri.Printf( PRINT_ALL, "ScreenShot: Couldn't create a file\n" );
return;
}
lastNumber++;
}
switch ( format )
{
case SSF_TGA:
R_TakeScreenshot( 0, 0, glConfig.vidWidth, glConfig.vidHeight, checkname );
break;
case SSF_JPEG:
R_TakeScreenshotJPEG( 0, 0, glConfig.vidWidth, glConfig.vidHeight, checkname );
break;
case SSF_PNG:
R_TakeScreenshotPNG( 0, 0, glConfig.vidWidth, glConfig.vidHeight, checkname );
break;
}
if ( !silent )
{
ri.Printf( PRINT_ALL, "Wrote %s\n", checkname );
}
}