Esempio n. 1
0
void pie_SetDefaultStates(void)//Sets all states
{
//		pie_SetFogColour(0x00B08f5f);//nicks colour
	//fog off
	rendStates.fogEnabled = FALSE;// enable fog before renderer
	rendStates.fog = FALSE;//to force reset to false
	pie_SetFogStatus(FALSE);
	pie_SetFogColour(0x00000000);//nicks colour

	//depth Buffer on
	rendStates.depthBuffer = FALSE;//to force reset to true
	pie_SetDepthBufferStatus(DEPTH_CMP_LEQ_WRT_ON);

	//set render mode
	pie_SetTranslucent(TRUE);
	pie_SetAdditive(TRUE);
	
	//basic gouraud textured rendering
	rendStates.texCombine = TEX_NONE;//to force reset to GOURAUD_TEX
	pie_SetTexCombine(TEX_LOCAL);
	rendStates.colourCombine = COLOUR_FLAT_CONSTANT;//to force reset to GOURAUD_TEX
	pie_SetColourCombine(COLOUR_TEX_ITERATED);
	rendStates.alphaCombine = ALPHA_ITERATED;//to force reset to GOURAUD_TEX
	pie_SetAlphaCombine(ALPHA_CONSTANT);
	rendStates.transMode = TRANS_ALPHA;//to force reset to DECAL
	pie_SetTranslucencyMode(TRANS_DECAL);

	//chroma keying on black
	rendStates.keyingOn = FALSE;//to force reset to true
	pie_SetColourKeyedBlack(TRUE);

	//bilinear filtering
	rendStates.bilinearOn = FALSE;//to force reset to true
	pie_SetBilinear(TRUE);
}
Esempio n. 2
0
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_SetTranslucencyMode(TRANS_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();
}
Esempio n. 3
0
void pie_ResetStates(void)//Sets all states
{
	SDWORD		temp;

//		pie_SetFogColour(0x00B08f5f);//nicks colour
	rendStates.fog = !rendStates.fog;//to force reset
	pie_SetFogStatus(!rendStates.fog);

	//depth Buffer on
	temp = rendStates.depthBuffer;
	rendStates.depthBuffer = -1;//to force reset
	pie_SetDepthBufferStatus(temp);

	//set render mode
//	pie_SetTranslucent(TRUE);
//	pie_SetAdditive(TRUE);
	
	//basic gouraud textured rendering
	temp = rendStates.texCombine;
	rendStates.texCombine = -1;//to force reset
	pie_SetTexCombine(temp);

	temp = rendStates.colourCombine;
	rendStates.colourCombine = -1;//to force reset
	pie_SetColourCombine(temp);

	temp = rendStates.alphaCombine;
	rendStates.alphaCombine = -1;//to force reset
	pie_SetAlphaCombine(temp);

	temp = rendStates.transMode;
	rendStates.transMode = -1;//to force reset
	pie_SetTranslucencyMode(temp);

	//chroma keying on black
	temp = rendStates.keyingOn;
	rendStates.keyingOn = -1;//to force reset
	pie_SetColourKeyedBlack(temp);

	//bilinear filtering
	temp = rendStates.bilinearOn;
	rendStates.bilinearOn = -1;//to force reset
	pie_SetBilinear(temp);
}