• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pie_SetRendMode函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: iV_DrawImage2

void iV_DrawImage2(const QString &filename, float x, float y, float width, float height)
{
	ImageDef *image = iV_GetImage(filename, x, y);
	const GLfloat invTextureSize = image->invTextureSize;
	const int tu = image->Tu;
	const int tv = image->Tv;
	const int w = width > 0 ? width : image->Width;
	const int h = height > 0 ? height : image->Height;
	x += image->XOffset;
	y += image->YOffset;
	pie_SetTexturePage(image->textureId);
	glColor4ubv(WZCOL_WHITE.vector);
	pie_SetRendMode(REND_ALPHA);
	glBegin(GL_TRIANGLE_STRIP);
	glTexCoord2f(tu * image->invTextureSize, tv * invTextureSize);
	glVertex2f(x, y);

	glTexCoord2f((tu + image->Width) * invTextureSize, tv * invTextureSize);
	glVertex2f(x + w, y);

	glTexCoord2f(tu * invTextureSize, (tv + image->Height) * invTextureSize);
	glVertex2f(x, y + h);

	glTexCoord2f((tu + image->Width) * invTextureSize, (tv + image->Height) * invTextureSize);
	glVertex2f(x + w, y + h);
	glEnd();
}
开发者ID:Manistein,项目名称:warzone2100,代码行数:27,代码来源:pieblitfunc.cpp


示例2: pie_DrawSkybox

void pie_DrawSkybox(float scale)
{
	GL_DEBUG("Drawing skybox");

	glPushAttrib(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_FOG_BIT);
	// no use in updating the depth buffer
	glDepthMask(GL_FALSE);

	// fog should not affect the sky
	glDisable(GL_FOG);

	// So we have realistic colors
	glColor4ub(0xFF,0xFF,0xFF,0xFF);

	// enable alpha
	pie_SetRendMode(REND_ALPHA);

	// for the nice blend of the sky with the fog
	glDisable(GL_ALPHA_TEST);

	// Apply scale matrix
	glScalef(scale, scale/2.0f, scale);

	skyboxGfx->draw();

	glPopAttrib();
}
开发者ID:noccy80,项目名称:warzone2100,代码行数:27,代码来源:piefunc.cpp


示例3: pie_Draw3DButton

static void pie_Draw3DButton(iIMDShape *shape)
{
	const PIELIGHT colour = WZCOL_WHITE;
	const PIELIGHT teamcolour = pal_GetTeamColour(NetPlay.players[selectedPlayer].colour);
	pie_SetFogStatus(false);
	pie_SetDepthBufferStatus(DEPTH_CMP_LEQ_WRT_ON);
	pie_ActivateShader(SHADER_BUTTON, shape, teamcolour, colour);
	pie_SetRendMode(REND_OPAQUE);
	glColor4ubv(colour.vector);     // Only need to set once for entire model
	pie_SetTexturePage(shape->texpage);
	glEnableClientState(GL_VERTEX_ARRAY);
	glEnableClientState(GL_NORMAL_ARRAY);
	glEnableClientState(GL_TEXTURE_COORD_ARRAY);
	glBindBuffer(GL_ARRAY_BUFFER, shape->buffers[VBO_VERTEX]); glVertexPointer(3, GL_FLOAT, 0, NULL);
	glBindBuffer(GL_ARRAY_BUFFER, shape->buffers[VBO_NORMAL]); glNormalPointer(GL_FLOAT, 0, NULL);
	glBindBuffer(GL_ARRAY_BUFFER, shape->buffers[VBO_TEXCOORD]); glTexCoordPointer(2, GL_FLOAT, 0, NULL);
	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, shape->buffers[VBO_INDEX]);
	glDrawElements(GL_TRIANGLES, shape->npolys * 3, GL_UNSIGNED_SHORT, NULL);
	glDisableClientState(GL_VERTEX_ARRAY);
	glDisableClientState(GL_NORMAL_ARRAY);
	glDisableClientState(GL_TEXTURE_COORD_ARRAY);
	polyCount += shape->npolys;
	pie_DeactivateShader();
	pie_SetDepthBufferStatus(DEPTH_CMP_ALWAYS_WRT_ON);
}
开发者ID:renato13,项目名称:warzone2100,代码行数:25,代码来源:piedraw.cpp


示例4: pie_DrawShadows

static void pie_DrawShadows(void)
{
    const float width = pie_GetVideoBufferWidth();
    const float height = pie_GetVideoBufferHeight();

    pie_SetTexturePage(TEXPAGE_NONE);

    glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
    glDepthFunc(GL_LESS);
    glDepthMask(GL_FALSE);
    glEnable(GL_STENCIL_TEST);

    ShadowStencilFunc();

    glEnable(GL_CULL_FACE);
    glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
    glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
    glStencilMask(~0);
    glStencilFunc(GL_LESS, 0, ~0);

    glDisable(GL_DEPTH_TEST);
    PIELIGHT grey;
    grey.byte = { 0, 0, 0, 128 };
    pie_BoxFill(0, 0, width, height, grey, REND_ALPHA);

    pie_SetRendMode(REND_OPAQUE);
    glDisable(GL_STENCIL_TEST);
    glEnable(GL_DEPTH_TEST);
    glDepthMask(GL_TRUE);

    scshapes.resize(0);
}
开发者ID:cybersphinx,项目名称:warzone2100,代码行数:32,代码来源:piedraw.cpp


示例5: pie_RenderRadarRotated

void pie_RenderRadarRotated(IMAGEDEF *Image,iBitmap *Bmp,UDWORD Modulus,int x,int y,int angle)
{
	PIEIMAGE pieImage;
	PIERECT dest;
	//special case of pie_ImageDef
	switch (pie_GetRenderEngine())
	{
	case ENGINE_4101:
	case ENGINE_SR:
		pie_ImageDef(Image,Bmp,Modulus,x,y,FALSE);
		break;
	case ENGINE_GLIDE:
		pie_ImageDef(Image,Bmp,Modulus,x,y,TRUE);
		break;
	case ENGINE_D3D:
		pie_SetBilinear(TRUE);
		pie_SetRendMode(REND_GOURAUD_TEX);
		pie_SetColour(COLOURINTENSITY);
		pie_SetColourKeyedBlack(TRUE);
		//special case function because texture is held outside of texture list
		pieImage.texPage = RADAR_TEXPAGE_D3D;
		pieImage.tu = 0;
		pieImage.tv = 0;
		pieImage.tw = dtm_GetRadarTexImageSize();
		pieImage.th = dtm_GetRadarTexImageSize();
		dest.x = x;
		dest.y = y;
		dest.w = 128;
		dest.h = 128;
		pie_DrawImage(&pieImage, &dest, &rendStyle);
	default:
		break;
	}
}
开发者ID:pheonixstorm,项目名称:wzredemption,代码行数:34,代码来源:pieblitfunc.c


示例6: iV_DrawImageRepeatX

// Repeat a texture
void iV_DrawImageRepeatX(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Width)
{
	int hRep, hRemainder;

	assertValidImage(ImageFile, ID);
	const ImageDef *Image = &ImageFile->imageDefs[ID];

	pie_SetRendMode(REND_OPAQUE);
	pie_SetAlphaTest(true);

	PIERECT dest;
	Vector2i pieImage = makePieImage(ImageFile, ID, &dest, x, y);

	hRemainder = Width % Image->Width;

	for (hRep = 0; hRep < Width / Image->Width; hRep++)
	{
		pie_DrawImage(ImageFile, ID, pieImage, &dest);
		dest.x += Image->Width;
	}

	// draw remainder
	if (hRemainder > 0)
	{
		pieImage.x = hRemainder;
		dest.w = hRemainder;
		pie_DrawImage(ImageFile, ID, pieImage, &dest);
	}
}
开发者ID:wildsoul,项目名称:warzone2100,代码行数:30,代码来源:pieblitfunc.cpp


示例7: pie_Line

void pie_Line(int x0, int y0, int x1, int y1, uint32 colour)
{
	PIELIGHT light;
	iColour* psPalette;

	pie_SetRendMode(REND_FLAT);
	pie_SetColour(colour);
	pie_SetTexturePage(-1);

	switch (pie_GetRenderEngine())
	{
	case ENGINE_4101:
	case ENGINE_SR:
		line(x0, y0, x1, y1, colour);
		break;
	case ENGINE_GLIDE:
		gl_Line(x0, y0, x1, y1, colour);
		break;
	case ENGINE_D3D:
		/* Get our colour values from the ivis palette */
		psPalette = pie_GetGamePal();
		light.byte.r = psPalette[colour].r;
		light.byte.g = psPalette[colour].g;
		light.byte.b = psPalette[colour].b;
		light.byte.a = MAX_UB_LIGHT;
		pie_DrawLine(x0, y0, x1, y1, light.argb, TRUE);
	default:
		break;
	}
}
开发者ID:pheonixstorm,项目名称:wzredemption,代码行数:30,代码来源:pieblitfunc.c


示例8: pie_DrawFogBox

/// Draws a fog colored box which is wider at the top
void pie_DrawFogBox(float left, float right, float front, float back, float height, float wider)
{
	PIELIGHT fog_colour = pie_GetFogColour();

	pie_SetTexturePage(TEXPAGE_NONE);

	glColor4ub(fog_colour.byte.r,fog_colour.byte.g,fog_colour.byte.b,0xFF);

	pie_SetRendMode(REND_OPAQUE);

	glPushAttrib(GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT | GL_FOG_BIT);
	// no use in updating the depth buffer
	glDepthMask(GL_FALSE);
	glDisable(GL_FOG);
	glBegin(GL_QUAD_STRIP);
		// Front
		glVertex3f(-left, 0, front); // bottom left
		glVertex3f(-left-wider, height, front+wider); // top left
		glVertex3f( right, 0, front); // bottom right
		glVertex3f( right+wider, height, front+wider); // top right

		// Right
		glVertex3f( right, 0,-back); // bottom r
		glVertex3f( right+wider, height,-back-wider); // top r

		// Back
		glVertex3f(-left, 0, -back); // bottom right
		glVertex3f(-left-wider, height, -back-wider); // top right

		// Left
		glVertex3f(-left, 0, front); // bottom r
		glVertex3f(-left-wider, height, front+wider); // top r
	glEnd();
	glPopAttrib();
}
开发者ID:blezek,项目名称:warzone2100,代码行数:36,代码来源:piefunc.c


示例9: pie_DrawViewingWindow

void pie_DrawViewingWindow()
{
	SDWORD i;
	PIELIGHT colour = pieColour;

	pie_SetTexturePage(TEXPAGE_NONE);
	pie_SetRendMode(REND_ALPHA);

	glColor4ub(colour.byte.r, colour.byte.g, colour.byte.b, colour.byte.a >> 1);
	glBegin(GL_TRIANGLE_FAN);
		for (i = 0; i < VW_VERTICES; i++)
		{
			glVertex2f(pieVrts[i].x, pieVrts[i].y);
		}
	glEnd();

	glColor4ub(colour.byte.r, colour.byte.g, colour.byte.b, colour.byte.a);
	glBegin(GL_LINE_STRIP);
		for (i = 0; i < VW_VERTICES; i++)
		{
			glVertex2f(pieVrts[i].x, pieVrts[i].y);
		}
		glVertex2f(pieVrts[0].x, pieVrts[0].y);
	glEnd();
}
开发者ID:noccy80,项目名称:warzone2100,代码行数:25,代码来源:piefunc.cpp


示例10: iV_DrawImageRepeatY

void iV_DrawImageRepeatY(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Height)
{
	int vRep, vRemainder;

	assertValidImage(ImageFile, ID);
	const ImageDef *Image = &ImageFile->imageDefs[ID];

	pie_SetRendMode(REND_OPAQUE);
	pie_SetAlphaTest(true);

	PIERECT dest;
	Vector2i pieImage = makePieImage(ImageFile, ID, &dest, x, y);

	vRemainder = Height % Image->Height;

	for (vRep = 0; vRep < Height / Image->Height; vRep++)
	{
		pie_DrawImage(ImageFile, ID, pieImage, &dest);
		dest.y += Image->Height;
	}

	// draw remainder
	if (vRemainder > 0)
	{
		pieImage.y = vRemainder;
		dest.h = vRemainder;
		pie_DrawImage(ImageFile, ID, pieImage, &dest);
	}
}
开发者ID:wildsoul,项目名称:warzone2100,代码行数:29,代码来源:pieblitfunc.cpp


示例11: iV_ShadowBox

void iV_ShadowBox(int x0, int y0, int x1, int y1, int pad, PIELIGHT first, PIELIGHT second, PIELIGHT fill)
{
	pie_SetRendMode(REND_OPAQUE);
	pie_SetTexturePage(TEXPAGE_NONE);
	pie_DrawRect(x0 + pad, y0 + pad, x1 - pad, y1 - pad, fill);
	iV_Box2(x0, y0, x1, y1, first, second);
}
开发者ID:Manistein,项目名称:warzone2100,代码行数:7,代码来源:pieblitfunc.cpp


示例12: pie_DrawShadows

static void pie_DrawShadows(void)
{
	const float width = pie_GetVideoBufferWidth();
	const float height = pie_GetVideoBufferHeight();

	pie_SetTexturePage(TEXPAGE_NONE);

	glPushMatrix();

	pie_SetAlphaTest(false);
	glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
	glDepthFunc(GL_LESS);
	glDepthMask(GL_FALSE);
	glEnable(GL_STENCIL_TEST);

	ShadowStencilFunc();

	pie_SetRendMode(REND_ALPHA);
	glEnable(GL_CULL_FACE);
	glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
	glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
	glStencilMask(~0);
	glStencilFunc(GL_LESS, 0, ~0);
	glColor4f(0, 0, 0, 0.5);

	pie_PerspectiveEnd();
	glLoadIdentity();
	glDisable(GL_DEPTH_TEST);
	glBegin(GL_TRIANGLE_STRIP);
		glVertex2f(0, 0);
		glVertex2f(width, 0);
		glVertex2f(0, height);
		glVertex2f(width, height);
	glEnd();
	pie_PerspectiveBegin();

	pie_SetRendMode(REND_OPAQUE);
	glDisable(GL_STENCIL_TEST);
	glEnable(GL_DEPTH_TEST);
	glDepthMask(GL_TRUE);

	glPopMatrix();

	scshapes.clear();
}
开发者ID:Emdek,项目名称:warzone2100,代码行数:45,代码来源:piedraw.cpp


示例13: drawDecals

static void drawDecals(const glm::mat4 &ModelViewProjection, const glm::vec4 &paramsXLight, const glm::vec4 &paramsYLight, const glm::mat4 &textureMatrix)
{
	const auto &renderState = getCurrentRenderState();
	const glm::vec4 fogColor(
		renderState.fogColour.vector[0] / 255.f,
		renderState.fogColour.vector[1] / 255.f,
		renderState.fogColour.vector[2] / 255.f,
		renderState.fogColour.vector[3] / 255.f
	);
	const auto &program = pie_ActivateShader(SHADER_DECALS, ModelViewProjection, paramsXLight, paramsYLight, 0, 1, textureMatrix,
		renderState.fogEnabled, renderState.fogBegin, renderState.fogEnd, fogColor);
	// select the terrain texture page
	pie_SetTexturePage(terrainPage);

	// use the alpha to blend
	pie_SetRendMode(REND_ALPHA);

	// and the texture coordinates buffer
	decalVBO->bind();
	glVertexAttribPointer(program.locVertex, 3, GL_FLOAT, GL_FALSE, sizeof(DecalVertex), BUFFER_OFFSET(0));
	glEnableVertexAttribArray(program.locVertex);

	glVertexAttribPointer(program.locTexCoord, 2, GL_FLOAT, GL_FALSE, sizeof(DecalVertex), BUFFER_OFFSET(12));
	glEnableVertexAttribArray(program.locTexCoord);
	glBindBuffer(GL_ARRAY_BUFFER, 0);

	int size = 0;
	int offset = 0;
	for (int x = 0; x < xSectors; x++)
	{
		for (int y = 0; y < ySectors + 1; y++)
		{
			if (y < ySectors && offset + size == sectors[x * ySectors + y].decalOffset && sectors[x * ySectors + y].draw)
			{
				// append
				size += sectors[x * ySectors + y].decalSize;
				continue;
			}
			// can't append, so draw what we have and start anew
			if (size > 0)
			{
				glDrawArrays(GL_TRIANGLES, offset, size);
			}
			size = 0;
			if (y < ySectors && sectors[x * ySectors + y].draw)
			{
				offset = sectors[x * ySectors + y].decalOffset;
				size = sectors[x * ySectors + y].decalSize;
			}
		}
	}

	glDepthMask(GL_TRUE);
	glDisableVertexAttribArray(program.locTexCoord);
	glDisableVertexAttribArray(program.locVertex);
	pie_DeactivateShader();
}
开发者ID:Warzone2100,项目名称:warzone2100,代码行数:57,代码来源:terrain.cpp


示例14: painter

// Re-enable when Qt's font rendering is improved.
void WzMainWindow::drawPixmap(int XPos, int YPos, QPixmap *pix)
{
	QPainter painter(context()->device());
	painter.drawPixmap(XPos, YPos, *pix);
	painter.end();
	glEnable(GL_CULL_FACE);
	rendStatesRendModeHack();  // rendStates.rendMode = REND_ALPHA;
	pie_SetRendMode(REND_OPAQUE);		// beat state machinery into submission
}
开发者ID:Mysteryem,项目名称:warzone2100,代码行数:10,代码来源:wzapp_qt.cpp


示例15: pie_DrawSkybox

void pie_DrawSkybox(float scale, const glm::mat4 &viewMatrix)
{
	// no use in updating the depth buffer
	glDepthMask(GL_FALSE);
	// enable alpha
	pie_SetRendMode(REND_ALPHA);

	// Apply scale matrix
	skyboxGfx->draw(pie_PerspectiveGet() * viewMatrix * glm::scale(scale, scale / 2.f, scale));
}
开发者ID:lamyongxian,项目名称:warzone2100,代码行数:10,代码来源:piefunc.cpp


示例16: drawDepthOnly

static void drawDepthOnly(const glm::mat4 &ModelViewProjection, const glm::vec4 &paramsXLight, const glm::vec4 &paramsYLight)
{
	const auto &program = pie_ActivateShader(SHADER_TERRAIN_DEPTH, ModelViewProjection, paramsXLight, paramsYLight, 1, glm::mat4(1.f), glm::mat4(1.f));
	pie_SetTexturePage(TEXPAGE_NONE);
	pie_SetRendMode(REND_OPAQUE);

	// we only draw in the depth buffer of using fog of war, as the clear color is black then
	if (!pie_GetFogStatus())
	{
		glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
	}

	// draw slightly higher distance than it actually is so it will not
	// by accident obscure the actual terrain
	glEnable(GL_POLYGON_OFFSET_FILL);
	glPolygonOffset(0.1f, 1.0f);

	// bind the vertex buffer
	geometryIndexVBO->bind();
	geometryVBO->bind();

	glVertexAttribPointer(program.locVertex, 3, GL_FLOAT, GL_FALSE, sizeof(RenderVertex), BUFFER_OFFSET(0));
	glEnableVertexAttribArray(program.locVertex);

	for (int x = 0; x < xSectors; x++)
	{
		for (int y = 0; y < ySectors; y++)
		{
			if (sectors[x * ySectors + y].draw)
			{
				addDrawRangeElements(GL_TRIANGLES,
					sectors[x * ySectors + y].geometryOffset,
					sectors[x * ySectors + y].geometryOffset + sectors[x * ySectors + y].geometrySize,
					sectors[x * ySectors + y].geometryIndexSize,
					GL_UNSIGNED_INT,
					sectors[x * ySectors + y].geometryIndexOffset);
			}
		}
	}
	finishDrawRangeElements();
	glBindBuffer(GL_ARRAY_BUFFER, 0);
	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);

	if (!pie_GetFogStatus())
	{
		glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
	}

	// disable the depth offset
	glDisable(GL_POLYGON_OFFSET_FILL);
	glDisableVertexAttribArray(program.locVertex);
	pie_DeactivateShader();
}
开发者ID:Warzone2100,项目名称:warzone2100,代码行数:53,代码来源:terrain.cpp


示例17: pie_RenderRadar

/** Display radar texture using the given height and width, depending on zoom level. */
void pie_RenderRadar(int x, int y, int width, int height)
{
	pie_SetTexturePage(radarTexture);
	pie_SetRendMode(REND_ALPHA);

	glColor4ubv(WZCOL_WHITE.vector);
	glBegin(GL_TRIANGLE_STRIP);
		glTexCoord2f(0, 0);			glVertex2f(x, y);
		glTexCoord2f(radarTexX, 0);		glVertex2f(x + width, y);
		glTexCoord2f(0, radarTexY);		glVertex2f(x, y + height);
		glTexCoord2f(radarTexX, radarTexY);	glVertex2f(x + width, y + height);
	glEnd();
}
开发者ID:Emdek,项目名称:warzone2100,代码行数:14,代码来源:pieblitfunc.cpp


示例18: pie_Box

void pie_Box(int x0,int y0, int x1, int y1, uint32 colour)
{
	PIELIGHT light;
	iColour* psPalette;

	pie_SetRendMode(REND_FLAT);
	pie_SetColour(colour);
	pie_SetTexturePage(-1);

	if (x0>psRendSurface->clip.right || x1<psRendSurface->clip.left ||
		y0>psRendSurface->clip.bottom || y1<psRendSurface->clip.top)
	return;

	if (x0<psRendSurface->clip.left)
		x0 = psRendSurface->clip.left;
	if (x1>psRendSurface->clip.right)
		x1 = psRendSurface->clip.right;
	if (y0<psRendSurface->clip.top)
		y0 = psRendSurface->clip.top;
	if (y1>psRendSurface->clip.bottom)
		y1 = psRendSurface->clip.bottom;

	switch (pie_GetRenderEngine())
	{
	case ENGINE_4101:
	case ENGINE_SR:
		box(x0,y0,x1,y1,colour);
		break;
	case ENGINE_GLIDE:
		gl_Line(x0, y0, x1, y0, colour);
		gl_Line(x1, y0, x1, y1, colour);
		gl_Line(x1, y1, x0, y1, colour);
		gl_Line(x0, y1, x0, y0, colour);
		break;
	case ENGINE_D3D:
		psPalette = pie_GetGamePal();
		/* Get our colour values from the ivis palette */
		light.byte.r = psPalette[colour].r;
		light.byte.g = psPalette[colour].g;
		light.byte.b = psPalette[colour].b;
		light.byte.a = MAX_UB_LIGHT;
		pie_DrawLine(x0, y0, x1, y0, light.argb, FALSE);
		pie_DrawLine(x1, y0, x1, y1, light.argb, FALSE);
		pie_DrawLine(x1, y1, x0, y1, light.argb, FALSE);
		pie_DrawLine(x0, y1, x0, y0, light.argb, FALSE);
	default:
		break;
	}

}
开发者ID:pheonixstorm,项目名称:wzredemption,代码行数:50,代码来源:pieblitfunc.c


示例19: drawRadar

void drawRadar(void)
{
	float	pixSizeH, pixSizeV;

	ASSERT(radarBuffer, "No radar buffer allocated");
	if (!radarBuffer)
	{
		return;
	}

	CalcRadarPixelSize(&pixSizeH, &pixSizeV);

	if (frameSkip <= 0)
	{
		bool filter = true;
		if (!rotateRadar)
		{
			filter = RadarZoom % 16 != 0;
		}
		DrawRadarTiles();
		DrawRadarObjects();
		pie_DownLoadRadar(radarBuffer, radarTexWidth, radarTexHeight, filter);
		frameSkip = RADAR_FRAME_SKIP;
	}
	frameSkip--;
	pie_SetRendMode(REND_ALPHA);
	pie_MatBegin();
		pie_TRANSLATE(radarCenterX, radarCenterY, 0);
		if (rotateRadar)
		{
			// rotate the map
			pie_MatRotZ(player.r.y);
			DrawNorth();
		}
		// draw the box at the dimensions of the map
		iV_TransBoxFill(-radarWidth/2.0 - 1,
						-radarHeight/2.0 - 1,
						 radarWidth/2.0,
						 radarHeight/2.0);
		pie_RenderRadar(-radarWidth/2.0 - 1,
						-radarHeight/2.0 - 1,
						 radarWidth,
						 radarHeight);
        pie_MatBegin();
            pie_TRANSLATE(-radarWidth/2 - 1, -radarHeight/2 - 1, 0);
            DrawRadarExtras(0, 0, pixSizeH, pixSizeV);
        pie_MatEnd();
		drawRadarBlips(-radarWidth/2.0 - 1, -radarHeight/2.0 - 1, pixSizeH, pixSizeV);
	pie_MatEnd();
}
开发者ID:kerbys,项目名称:warzone2100,代码行数:50,代码来源:radar.cpp


示例20: iV_DrawImage

void iV_DrawImage(IMAGEFILE *ImageFile, UWORD ID, int x, int y)
{
	if (!assertValidImage(ImageFile, ID))
	{
		return;
	}

	PIERECT dest;
	Vector2i pieImage = makePieImage(ImageFile, ID, &dest, x, y);

	pie_SetRendMode(REND_ALPHA);

	pie_DrawImage(ImageFile, ID, pieImage, &dest);
}
开发者ID:Manistein,项目名称:warzone2100,代码行数:14,代码来源:pieblitfunc.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ piglit_build_simple_program函数代码示例发布时间:2022-05-30
下一篇:
C++ pid_to_ptid函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap