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


C++ CG_AdjustFrom640函数代码示例

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


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

示例1: CG_DrawSides

/*
================
CG_DrawSides

Coords are virtual 640x480
================
*/
void CG_DrawSides(float x, float y, float w, float h, float size)
{
	CG_AdjustFrom640(&x, &y, &w, &h);
	size *= cgs.screenXScale;
	trap_R_DrawStretchPic(x, y, size, h, 0, 0, 0, 0, cgs.media.whiteShader);
	trap_R_DrawStretchPic(x + w - size, y, size, h, 0, 0, 0, 0, cgs.media.whiteShader);
}
开发者ID:ethr,项目名称:ETXreaLPro_etmain,代码行数:14,代码来源:cg_drawtools.c

示例2: CG_DrawChar

/*
===============
CG_DrawChar

Coordinates and size in 640*480 virtual screen size
===============
*/
void CG_DrawChar( int x, int y, int width, int height, int ch ) {
	int row, col;
	gfixed frow, fcol;
	gfixed size;
	gfixed	ax, ay, aw, ah;

	ch &= 255;

	if ( ch == ' ' ) {
		return;
	}

	ax = MAKE_GFIXED(x);
	ay = MAKE_GFIXED(y);
	aw = MAKE_GFIXED(width);
	ah = MAKE_GFIXED(height);
	CG_AdjustFrom640( &ax, &ay, &aw, &ah );

	row = ch>>4;
	col = ch&15;

	frow = MAKE_GFIXED(row)*GFIXED(0,0625);
	fcol = MAKE_GFIXED(col)*GFIXED(0,0625);
	size = GFIXED(0,0625);

	_CG_trap_R_DrawStretchPic( ax, ay, aw, ah,
					   fcol, frow, 
					   fcol + size, frow + size, 
					   cgs.media.charsetShader );
}
开发者ID:Jsoucek,项目名称:q3ce,代码行数:37,代码来源:cg_drawtools.cpp

示例3: CG_DrawTopBottom

void CG_DrawTopBottom( float x, float y, float w, float h, float size )
{
	CG_AdjustFrom640( &x, &y, &w, &h );
	size *= cgs.screenYScale;
	trap_R_DrawStretchPic( x, y, w, size, 0, 0, 0, 0, cgs.media.whiteShader );
	trap_R_DrawStretchPic( x, y + h - size, w, size, 0, 0, 0, 0, cgs.media.whiteShader );
}
开发者ID:SHOVELL,项目名称:Unvanquished,代码行数:7,代码来源:cg_drawtools.c

示例4: CG_CalcVrect

static void CG_CalcVrect( void ) {
	int xsize, ysize;
	float lbheight;

	// NERVE - SMF
	if ( cg.limboMenu ) {
		float x, y, w, h;
		x = LIMBO_3D_X;
		y = LIMBO_3D_Y;
		w = LIMBO_3D_W;
		h = LIMBO_3D_H;

		cg.refdef.width = 0;
		CG_AdjustFrom640( &x, &y, &w, &h );

		cg.refdef.x = x;
		cg.refdef.y = y;
		cg.refdef.width = w;
		cg.refdef.height = h;
		return;
	}
	// -NERVE - SMF

	// the intermission should allways be full screen
	if ( cg.snap->ps.pm_type == PM_INTERMISSION ) {
		xsize = ysize = 100;
	} else {
		// bound normal viewsize
		if ( cg_viewsize.integer < 30 ) {
			trap_Cvar_Set( "cg_viewsize","30" );
			xsize = ysize = 30;
		} else if ( cg_viewsize.integer > 100 ) {
			trap_Cvar_Set( "cg_viewsize","100" );
			xsize = ysize = 100;
		} else {
			xsize = ysize = cg_viewsize.integer;
		}
	}

//----(SA)	added transition to/from letterbox
// normal aspect is xx:xx
// letterbox is yy:yy  (85% of 'normal' height)

	lbheight = ysize * 0.85;

	if ( cg_letterbox.integer ) {
		ysize = lbheight;
	}
//----(SA)	end


	cg.refdef.width = cgs.glconfig.vidWidth * xsize / 100;
	cg.refdef.width &= ~1;

	cg.refdef.height = cgs.glconfig.vidHeight * ysize / 100;
	cg.refdef.height &= ~1;

	cg.refdef.x = ( cgs.glconfig.vidWidth - cg.refdef.width ) / 2;
	cg.refdef.y = ( cgs.glconfig.vidHeight - cg.refdef.height ) / 2;
}
开发者ID:MAN-AT-ARMS,项目名称:iortcw-archive,代码行数:60,代码来源:cg_view.c

示例5: CG_DrawPic

/*
================
CG_DrawPic

Coordinates are 640*480 virtual values
=================
*/
void CG_DrawPic( float x, float y, float width, float height, qhandle_t hShader ) {
	float s0;
	float s1;
	float t0;
	float t1;

	if ( width < 0 ) {   // flip about vertical
		width  = -width;
		s0 = 1;
		s1 = 0;
	} else {
		s0 = 0;
		s1 = 1;
	}

	if ( height < 0 ) {  // flip about horizontal
		height = -height;
		t0 = 1;
		t1 = 0;
	} else {
		t0 = 0;
		t1 = 1;
	}

	CG_AdjustFrom640( &x, &y, &width, &height );
	trap_R_DrawStretchPic( x, y, width, height, s0, t0, s1, t1, hShader );
}
开发者ID:AdrienJaguenet,项目名称:Enemy-Territory,代码行数:34,代码来源:cg_drawtools.c

示例6: CG_Text_PaintChar

void CG_Text_PaintChar(float x, float y, float width, float height, float scale, float s, float t, float s2, float t2, qhandle_t hShader) {
  float w, h;
  w = width * scale;
  h = height * scale;
  CG_AdjustFrom640( &x, &y, &w, &h,qtrue);
  trap_R_DrawStretchPic( x, y, w, h, s, t, s2, t2, hShader );
}
开发者ID:Aravind7z,项目名称:zeq2lite,代码行数:7,代码来源:cg_draw.c

示例7: CG_DrawChar2

/*
===============
CG_DrawChar2

Coordinates and size in 640*480 virtual screen size
===============
*/
void CG_DrawChar2( int x, int y, int width, int height, int ch ) {
	int row, col;
	float frow, fcol;
	float size;
	float ax, ay, aw, ah;

	ch &= 255;

	if ( ch == ' ' ) {
		return;
	}

	ax = x;
	ay = y;
	aw = width;
	ah = height;
	CG_AdjustFrom640( &ax, &ay, &aw, &ah );

	row = ch >> 4;
	col = ch & 15;

	frow = row * 0.0625;
	fcol = col * 0.0625;
	size = 0.0625;

	trap_R_DrawStretchPic( ax, ay, aw, ah,
						   fcol, frow,
						   fcol + size, frow + size,
						   cgs.media.menucharsetShader );
}
开发者ID:AdrienJaguenet,项目名称:Enemy-Territory,代码行数:37,代码来源:cg_drawtools.c

示例8: CG_Cinematic_f

/*
=================
CG_Cinematic_f
=================
*/
void CG_Cinematic_f( void ) {
	char	arg[MAX_QPATH];
	char	s[6];
	float	x, y, width, height;
	int		bits = CIN_system;

	Com_DPrintf("CG_Cinematic_f\n");
	CG_StopCinematic_f();

	trap_Argv( 1, arg, sizeof( arg ) );
	trap_Argv( 2, s, sizeof( s ) );

	if (s[0] == '1' || Q_stricmp(arg,"demoend.roq")==0 || Q_stricmp(arg,"end.roq")==0) {
		bits |= CIN_hold;
	}
	if (s[0] == '2') {
		bits |= CIN_loop;
	}

	//trap_S_StopAllSounds();

	x = 0;
	y = 0;
	width = SCREEN_WIDTH;
	height = SCREEN_HEIGHT;
	CG_SetScreenPlacement( PLACE_CENTER, PLACE_CENTER );
	CG_AdjustFrom640( &x, &y, &width, &height );

	cg.cinematicHandle = trap_CIN_PlayCinematic( arg, x, y, width, height, bits );
}
开发者ID:LavenderMoon,项目名称:mint-arena,代码行数:35,代码来源:cg_consolecmds.c

示例9: CG_DrawRotatedPic

/*
================
CG_DrawRotatedPic

Coordinates are 640*480 virtual values
=================
*/
void CG_DrawRotatedPic(float x, float y, float width, float height, qhandle_t hShader, float angle)
{

	CG_AdjustFrom640(&x, &y, &width, &height);

	trap_R_DrawRotatedPic(x, y, width, height, 0, 0, 1, 1, hShader, angle);
}
开发者ID:ethr,项目名称:ETXreaLPro_etmain,代码行数:14,代码来源:cg_drawtools.c

示例10: CG_FillRectGradient

/*
==============
CG_FillRectGradient
==============
*/
void CG_FillRectGradient( float x, float y, float width, float height, const float *color, const float *gradcolor, int gradientType ) {
	trap_R_SetColor( color );

	CG_AdjustFrom640( &x, &y, &width, &height );
	trap_R_DrawStretchPicGradient( x, y, width, height, 0, 0, 0, 0, cgs.media.whiteShader, gradcolor, gradientType );

	trap_R_SetColor( NULL );
}
开发者ID:AdrienJaguenet,项目名称:Enemy-Territory,代码行数:13,代码来源:cg_drawtools.c

示例11: CG_LimboPanel_RenderCounterNumber

void CG_LimboPanel_RenderCounterNumber(float x, float y, float w, float h, float number, qhandle_t shaderBack, qhandle_t shaderRoll, int numbuttons) {
	float numberS = (((numbuttons - 1) - number) + 0) * (1.f / numbuttons);
	float numberE = (((numbuttons - 1) - number) + 1) * (1.f / numbuttons);

	CG_AdjustFrom640(&x, &y, &w, &h);
	trap_R_DrawStretchPic(x, y, w, h, 0, 0, 1, 1, shaderBack);
	trap_R_DrawStretchPic(x, y, w, h, 0, numberS, 1, numberE, shaderRoll);
}
开发者ID:ETrun,项目名称:ETrun,代码行数:8,代码来源:cg_limbopanel.c

示例12: CG_FillRect

/*
================
CG_FillRect

Coordinates are 640*480 virtual values
=================
*/
void CG_FillRect( gfixed x, gfixed y, gfixed width, gfixed height, const gfixed *color ) {
	_CG_trap_R_SetColor( color );

	CG_AdjustFrom640( &x, &y, &width, &height );
	_CG_trap_R_DrawStretchPic( x, y, width, height, GFIXED_0, GFIXED_0, GFIXED_0, GFIXED_0, cgs.media.whiteShader );

	_CG_trap_R_SetColor( NULL );
}
开发者ID:Jsoucek,项目名称:q3ce,代码行数:15,代码来源:cg_drawtools.cpp

示例13: CG_FillRect

/*
================
CG_FillRect

Coordinates are 640*480 virtual values
=================
*/
void CG_FillRect( float x, float y, float width, float height, const float *color ) {
	trap_R_SetColor( color );

	CG_AdjustFrom640( &x, &y, &width, &height );
	trap_R_DrawStretchPic( x, y, width, height, 0, 0, 0, 1, cgs.media.whiteShader );

	trap_R_SetColor( NULL );
}
开发者ID:AdrienJaguenet,项目名称:Enemy-Territory,代码行数:15,代码来源:cg_drawtools.c

示例14: CG_DrawSides

/*
================
CG_DrawSides

Coords are virtual 640x480
================
*/
void CG_DrawSides(float x, float y, float w, float h, float size) {
	CG_AdjustFrom640( &x, &y, &w, &h );
	if (cg_horizontalPlacement == PLACE_STRETCH) {
		size *= cgs.screenXScaleStretch;
	} else {
		size *= cgs.screenXScale;
	}
	trap_R_DrawStretchPic( x, y, size, h, 0, 0, 0, 0, cgs.media.whiteShader );
	trap_R_DrawStretchPic( x + w - size, y, size, h, 0, 0, 0, 0, cgs.media.whiteShader );
}
开发者ID:SilverlineDev,项目名称:mint-arena,代码行数:17,代码来源:cg_drawtools.c

示例15: CG_DrawTopBottom

void CG_DrawTopBottom(float x, float y, float w, float h, float size) {
	CG_AdjustFrom640( &x, &y, &w, &h );
	if (cg_verticalPlacement == PLACE_STRETCH) {
		size *= cgs.screenYScaleStretch;
	} else {
		size *= cgs.screenYScale;
	}
	trap_R_DrawStretchPic( x, y, w, size, 0, 0, 0, 0, cgs.media.whiteShader );
	trap_R_DrawStretchPic( x, y + h - size, w, size, 0, 0, 0, 0, cgs.media.whiteShader );
}
开发者ID:SilverlineDev,项目名称:mint-arena,代码行数:10,代码来源:cg_drawtools.c


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