예제 #1
0
/*
=================
UI_LoadGame_Ownerdraw
=================
*/
static void UI_LoadGame_Ownerdraw( void *self )
{
	menuCommon_s	*item = (menuCommon_s *)self;

	if( item->type != QMTYPE_ACTION && item->id == ID_LEVELSHOT )
	{
		int	x, y, w, h;

		// draw the levelshot
		x = LEVELSHOT_X;
		y = LEVELSHOT_Y;
		w = LEVELSHOT_W;
		h = LEVELSHOT_H;
		
		UI_ScaleCoords( &x, &y, &w, &h );

		if( strlen( uiLoadGame.saveName[uiLoadGame.savesList.curItem] ))
		{
			char	saveshot[128];

			sprintf( saveshot, "save/%s.bmp", uiLoadGame.saveName[uiLoadGame.savesList.curItem] );

			if( !FILE_EXISTS( saveshot ))
				UI_DrawPicAdditive( x, y, w, h, uiColorWhite, "{GRAF001" );
			else UI_DrawPic( x, y, w, h, uiColorWhite, saveshot );
		}
		else UI_DrawPicAdditive( x, y, w, h, uiColorWhite, "{GRAF001" );

		// draw the rectangle
		UI_DrawRectangle( item->x, item->y, item->width, item->height, uiInputFgColor );
	}
}
/*
=================
UI_PlayerSetup_Ownerdraw
=================
*/
static void UI_PlayerSetup_Ownerdraw( void *self )
{
	menuCommon_s	*item = (menuCommon_s *)self;

	// draw the background
	UI_FillRect( item->x, item->y, item->width, item->height, uiPromptBgColor );

	// draw the rectangle
	UI_DrawRectangle( item->x, item->y, item->width, item->height, uiInputFgColor );

	if( !ui_showmodels->value && playerImage != 0 )
	{
		PIC_Set( playerImage, 255, 255, 255, 255 );
		PIC_Draw( item->x, item->y, item->width, item->height );
	}
	else
	{
		R_ClearScene ();

		// update renderer timings
		uiPlayerSetup.refdef.time = gpGlobals->time;
		uiPlayerSetup.refdef.frametime = gpGlobals->frametime;
		uiPlayerSetup.ent->curstate.body = 0; // clearing body each frame

		// draw the player model
		R_AddEntity( ET_NORMAL, uiPlayerSetup.ent );
		R_RenderFrame( &uiPlayerSetup.refdef );
	}
}