Ejemplo n.º 1
0
void SCR_Init(void)
{
	int i,j;
	
	
   
    SRC_CalcViewPortDimensions();
    
   	
	
	
	for (i=0; i < 4; i++) 
	for (j=0; j < 4; j++) 
		fadeVertices[i].color[j] = 0;
	
	/*
	fadeVertices[0].color[R] = 0;
	fadeVertices[0].color[G] = 0;
	fadeVertices[0].color[B] = 0;
	
	fadeVertices[1].color[R] = 0;
	fadeVertices[1].color[G] = 0;
	fadeVertices[1].color[B] = 0;
	fadeVertices[2].color[R] = 0;
	fadeVertices[2].color[G] = 0;
	fadeVertices[2].color[B] = 0;
	fadeVertices[3].color[R] = 0;
	fadeVertices[3].color[G] = 0;
	fadeVertices[3].color[B] = 0;
	*/
	SCR_SetFadeFullScreen();
	
	renderer.enabled = 1;
	
}
Ejemplo n.º 2
0
void SCR_Init(void)
{
	int i,j;
	float ratio;
	
	//renderWidth =  320 * renderer.resolution;
	//renderHeight = 480 * renderer.resolution;
	
	//Centering rendition area with viewPort
	//vector2Clear(viewPortCentering);
	
	renderer.viewPortDimensions[VP_WIDTH] = 320.0f * renderer.resolution ;
	renderer.viewPortDimensions[VP_HEIGHT] = 480.0f * renderer.resolution ;
	
	if (renderer.viewPortDimensions[VP_WIDTH] > renderer.glBuffersDimensions[WIDTH])
	{
		ratio = renderer.glBuffersDimensions[WIDTH] / renderer.viewPortDimensions[VP_WIDTH];
		renderer.viewPortDimensions[VP_WIDTH]  = renderer.glBuffersDimensions[WIDTH] * ratio;
		renderer.viewPortDimensions[VP_HEIGHT] = renderer.glBuffersDimensions[HEIGHT]* ratio;		
	}
	
	if (renderer.viewPortDimensions[VP_HEIGHT] > renderer.glBuffersDimensions[HEIGHT])
	{
		ratio = renderer.glBuffersDimensions[HEIGHT] / renderer.viewPortDimensions[VP_HEIGHT];
		renderer.viewPortDimensions[VP_WIDTH]  = renderer.glBuffersDimensions[WIDTH] * ratio;
		renderer.viewPortDimensions[VP_HEIGHT] = renderer.glBuffersDimensions[HEIGHT]* ratio;		
		
	}
	
	
	renderer.viewPortDimensions[VP_X] = (renderer.glBuffersDimensions[WIDTH] - renderer.viewPortDimensions[VP_WIDTH]) / 2;
	renderer.viewPortDimensions[VP_Y] = (renderer.glBuffersDimensions[HEIGHT] - renderer.viewPortDimensions[VP_HEIGHT]) / 2;
	
	
	
	
	for (i=0; i < 4; i++) 
	for (j=0; j < 4; j++) 
		fadeVertices[i].color[j] = 0;
	
	/*
	fadeVertices[0].color[R] = 0;
	fadeVertices[0].color[G] = 0;
	fadeVertices[0].color[B] = 0;
	
	fadeVertices[1].color[R] = 0;
	fadeVertices[1].color[G] = 0;
	fadeVertices[1].color[B] = 0;
	fadeVertices[2].color[R] = 0;
	fadeVertices[2].color[G] = 0;
	fadeVertices[2].color[B] = 0;
	fadeVertices[3].color[R] = 0;
	fadeVertices[3].color[G] = 0;
	fadeVertices[3].color[B] = 0;
	*/
	SCR_SetFadeFullScreen();
	
	renderer.enabled = 1;
	
}
Ejemplo n.º 3
0
Archivo: menu.c Proyecto: shanfl/Shmup
void MENU_Set(signed char menuId)
{
	int i;
	menu_screen_t* currentMenu;
	
	//Log_Printf("MENU_Set(%d)\n",menuId);
	
	
	if (currentMenuId != -1)
	{
		
		currentMenu = &menuScreens[currentMenuId];
		
		//Need to reset button stats for next time the menu is displayed
		for (i=0 ; i < currentMenu->numButtons; i++) 
		{
			currentMenu->buttons[i].actionTriggered = 0;
			currentMenu->buttons[i].touch->down= 0;
		}
	}
	
	engine.menuVisible = (menuId != MENU_NONE);
	
	
	currentMenuId = menuId;
	if (currentMenuId != MENU_NONE)
	{
		SCR_SetFadeFullScreen();
		currentMenu = &menuScreens[currentMenuId];
		currentMenu->alpha = 0;
	}
	
	
	if (menuId == MENU_NONE)
	{
		MENU_FreeRessources();
		return;
	}
	else 
	{
		MENU_LoadRessources();
	}
	
	
	
	
	
}