MCPcopy Create free account
hub / github.com/JACoders/OpenJK / UI_OwnerDraw

Function UI_OwnerDraw

code/ui/ui_main.cpp:3812–3896  ·  view source on GitHub ↗

================= UI_OwnerDraw ================= */

Source from the content-addressed store, hash-verified

3810=================
3811*/
3812static void UI_OwnerDraw(float x, float y, float w, float h, float text_x, float text_y, int ownerDraw, int ownerDrawFlags, int align, float special, float scale, vec4_t color, qhandle_t shader, int textStyle, int iFontIndex)
3813{
3814 rectDef_t rect;
3815
3816 rect.x = x + text_x;
3817 rect.y = y + text_y;
3818 rect.w = w;
3819 rect.h = h;
3820
3821 switch (ownerDraw)
3822 {
3823 case UI_EFFECTS:
3824 UI_DrawEffects(&rect, scale, color);
3825 break;
3826 case UI_VERSION:
3827 UI_Version(&rect, scale, color, iFontIndex);
3828 break;
3829
3830 case UI_DATAPAD_MISSION:
3831 ui.Draw_DataPad(DP_HUD);
3832 ui.Draw_DataPad(DP_OBJECTIVES);
3833 break;
3834
3835 case UI_DATAPAD_WEAPONS:
3836 ui.Draw_DataPad(DP_HUD);
3837 ui.Draw_DataPad(DP_WEAPONS);
3838 break;
3839
3840 case UI_DATAPAD_INVENTORY:
3841 ui.Draw_DataPad(DP_HUD);
3842 ui.Draw_DataPad(DP_INVENTORY);
3843 break;
3844
3845 case UI_DATAPAD_FORCEPOWERS:
3846 ui.Draw_DataPad(DP_HUD);
3847 ui.Draw_DataPad(DP_FORCEPOWERS);
3848 break;
3849
3850 case UI_ALLMAPS_SELECTION://saved game thumbnail
3851
3852 int levelshot;
3853 levelshot = ui.R_RegisterShaderNoMip( va( "levelshots/%s", s_savedata[s_savegame.currentLine].currentSaveFileMap ) );
3854#ifdef JK2_MODE
3855 if (screenShotBuf[0])
3856 {
3857 ui.DrawStretchRaw( x, y, w, h, SG_SCR_WIDTH, SG_SCR_HEIGHT, screenShotBuf, 0, qtrue );
3858 }
3859 else
3860#endif
3861 if (levelshot)
3862 {
3863 ui.R_DrawStretchPic( x, y, w, h, 0, 0, 1, 1, levelshot );
3864 }
3865 else
3866 {
3867 UI_DrawHandlePic(x, y, w, h, uis.menuBackShader);
3868 }
3869

Callers

nothing calls this directly

Calls 7

UI_DrawEffectsFunction · 0.85
UI_VersionFunction · 0.70
UI_DrawHandlePicFunction · 0.70
UI_DrawCrosshairFunction · 0.70
UI_DrawGLInfoFunction · 0.70
UI_DrawKeyBindStatusFunction · 0.70
vaFunction · 0.50

Tested by

no test coverage detected