void M_Main_Draw (menuframework_s *self) { int i; int w, h; int ystart; int xoffset; int widest = -1; for ( i = 0; names[i] != 0; i++ ) { Draw_GetPicSize( &w, &h, names[i] ); if ( w > widest ) widest = w; } ystart = ( viddef.height / 2 - 110 ); xoffset = ( viddef.width - widest + 70 ) / 2; Draw_GetPicSize( &w, &h, "m_main_plaque" ); Draw_Pic( xoffset - 30 - w, ystart, "m_main_plaque", 1 ); Draw_Pic( xoffset - 30 - w, ystart + h + 5, "m_main_logo", 1 ); Menu_Draw( self ); }
/* * Allows rendering code to cache all needed sbar graphics */ void SCR_TouchPics(void) { int i, j; for (i = 0; i < 2; i++) { for (j = 0; j < 11; j++) { Draw_FindPic(sb_nums[i][j]); } } if (crosshair->value) { if ((crosshair->value > 3) || (crosshair->value < 0)) { crosshair->value = 3; } Com_sprintf(crosshair_pic, sizeof(crosshair_pic), "ch%i", (int)(crosshair->value)); Draw_GetPicSize(&crosshair_width, &crosshair_height, crosshair_pic); if (!crosshair_width) { crosshair_pic[0] = 0; } } }
void M_Banner( char *name ) { int w, h; Draw_GetPicSize (&w, &h, name ); Draw_Pic( viddef.width / 2 - w / 2, viddef.height / 2 - 110, name, 1 ); }
void M_Quit_Draw (menuframework_s *self) { int w, h; Draw_GetPicSize (&w, &h, "quit"); Draw_Pic ( (viddef.width-w)/2, (viddef.height-h)/2, "quit", 1 ); }
/* ============== SCR_DrawLoading ============== */ void SCR_DrawLoading (void) { int w, h; if (!scr_draw_loading) return; scr_draw_loading = false; Draw_GetPicSize (&w, &h, "loading"); Draw_Pic ((viddef.width-w)/2, (viddef.height-h)/2, "loading"); }
/* ============== SCR_DrawPause ============== */ void SCR_DrawPause (void) { int w, h; if (!scr_showpause->value) // turn off for screenshots return; if (!cl_paused->value) return; Draw_GetPicSize (&w, &h, "pause"); Draw_Pic ((viddef.width-w)/2, viddef.height/2 + 8, "pause"); }
/* ========================================================================= */ void VID_MenuDraw ( void ) { q_int32_t w, h; /* draw the banner */ Draw_GetPicSize ( &w, &h, "m_banner_video" ); Draw_Pic ( viddef.width / 2 - w / 2, viddef.height / 2 - 110, "m_banner_video" ); /* move cursor to a reasonable starting position */ Menu_AdjustCursor ( &s_opengl_menu, 1 ); /* draw the menu */ Menu_Draw ( &s_opengl_menu ); }
void MainMenu_Init( void ) { int i; int w, h; int ystart; int xoffset; int widest = -1; for( i=0 ; names[i] ; i++ ) { Draw_GetPicSize( &w, &h, names[i] ); if( w > widest ) widest = w; } ystart = (viddef.height / 2 - 110); xoffset = (viddef.width - widest + 70) / 2; memset( &m_main, 0, sizeof( m_main ) ); for( i=0 ; i<MAIN_ITEMS ; i++ ) { Draw_GetPicSize( &w, &h, names[i] ); m_main.bitmaps[i].generic.type = MTYPE_BITMAP; m_main.bitmaps[i].generic.name = names[i]; m_main.bitmaps[i].generic.x = xoffset; m_main.bitmaps[i].generic.y = ystart + i * 40 + 13; m_main.bitmaps[i].generic.width = w; m_main.bitmaps[i].generic.height = h; m_main.bitmaps[i].generic.cursordraw = MainMenu_CursorDraw; m_main.bitmaps[i].generic.callback = MainMenu_Callback; Menu_AddItem( &m_main.menu, (void *)&m_main.bitmaps[i] ); } m_main.menu.draw = M_Main_Draw; m_main.menu.key = NULL; }
void SCR_DrawLoading(void) { int w, h; float scale = SCR_GetMenuScale(); if (!scr_draw_loading) { return; } Draw_GetPicSize(&w, &h, "loading"); Draw_PicScaled((viddef.width - w * scale) / 2, (viddef.height - h * scale) / 2, "loading", scale); }
void VID_MenuDraw(void) { int w, h; float scale = SCR_GetMenuScale(); /* draw the banner */ Draw_GetPicSize(&w, &h, "m_banner_video"); Draw_PicScaled(viddef.width / 2 - (w * scale) / 2, viddef.height / 2 - (110 * scale), "m_banner_video", scale); /* move cursor to a reasonable starting position */ Menu_AdjustCursor(&s_opengl_menu, 1); /* draw the menu */ Menu_Draw(&s_opengl_menu); }
void SCR_DrawPause(void) { int w, h; float scale = SCR_GetMenuScale(); if (!scr_showpause->value) /* turn off for screenshots */ { return; } if (!cl_paused->value) { return; } Draw_GetPicSize(&w, &h, "pause"); Draw_PicScaled((viddef.width - w * scale) / 2, viddef.height / 2 + 8 * scale, "pause", scale); }
/* ================ VID_MenuDraw ================ */ void VID_MenuDraw (menuframework_s *self) { int w, h; /* ** draw the banner */ Draw_GetPicSize( &w, &h, "m_banner_video" ); Draw_Pic( viddef.width / 2 - w / 2, viddef.height /2 - 110, "m_banner_video", 1 ); /* ** move cursor to a reasonable starting position */ Menu_AdjustCursor( self, 1 ); /* ** draw the menu */ Menu_Draw( self ); }