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

Function _UI_Init

code/ui/ui_main.cpp:2633–2781  ·  view source on GitHub ↗

================= UI_Init ================= */

Source from the content-addressed store, hash-verified

2631=================
2632*/
2633void _UI_Init( qboolean inGameLoad )
2634{
2635 // Get the list of possible languages
2636#ifndef JK2_MODE
2637 uiInfo.languageCount = SE_GetNumLanguages(); // this does a dir scan, so use carefully
2638#else
2639 // sod it, parse every menu strip file until we find a gap in the sequence...
2640 //
2641 for (int i=0; i<10; i++)
2642 {
2643 if (!ui.SP_Register(va("menus%d",i), /*SP_REGISTER_REQUIRED|*/SP_REGISTER_MENU))
2644 break;
2645 }
2646#endif
2647
2648 uiInfo.inGameLoad = inGameLoad;
2649
2650 UI_RegisterCvars();
2651
2652 UI_InitMemory();
2653
2654 // cache redundant calulations
2655 trap_GetGlconfig( &uiInfo.uiDC.glconfig );
2656
2657 // for 640x480 virtualized screen
2658 uiInfo.uiDC.yscale = uiInfo.uiDC.glconfig.vidHeight * (1.0/480.0);
2659 uiInfo.uiDC.xscale = uiInfo.uiDC.glconfig.vidWidth * (1.0/640.0);
2660 if ( uiInfo.uiDC.glconfig.vidWidth * 480 > uiInfo.uiDC.glconfig.vidHeight * 640 )
2661 {
2662 // wide screen
2663 uiInfo.uiDC.bias = 0.5 * ( uiInfo.uiDC.glconfig.vidWidth - ( uiInfo.uiDC.glconfig.vidHeight * (640.0/480.0) ) );
2664 }
2665 else
2666 {
2667 // no wide screen
2668 uiInfo.uiDC.bias = 0;
2669 }
2670
2671 Init_Display(&uiInfo.uiDC);
2672
2673 uiInfo.uiDC.drawText = &Text_Paint;
2674 uiInfo.uiDC.drawHandlePic = &UI_DrawHandlePic;
2675 uiInfo.uiDC.drawRect = &_UI_DrawRect;
2676 uiInfo.uiDC.drawSides = &_UI_DrawSides;
2677 uiInfo.uiDC.drawTextWithCursor = &Text_PaintWithCursor;
2678 uiInfo.uiDC.executeText = &Cbuf_ExecuteText;
2679 uiInfo.uiDC.drawTopBottom = &_UI_DrawTopBottom;
2680 uiInfo.uiDC.feederCount = &UI_FeederCount;
2681 uiInfo.uiDC.feederSelection = &UI_FeederSelection;
2682 uiInfo.uiDC.fillRect = &UI_FillRect;
2683 uiInfo.uiDC.getBindingBuf = &Key_GetBindingBuf;
2684 uiInfo.uiDC.getCVarString = Cvar_VariableStringBuffer;
2685 uiInfo.uiDC.getCVarValue = trap_Cvar_VariableValue;
2686 uiInfo.uiDC.getOverstrikeMode = &trap_Key_GetOverstrikeMode;
2687 uiInfo.uiDC.getValue = &UI_GetValue;
2688 uiInfo.uiDC.keynumToStringBuf = &Key_KeynumToStringBuf;
2689 uiInfo.uiDC.modelBounds = &trap_R_ModelBounds;
2690 uiInfo.uiDC.ownerDrawVisible = &UI_OwnerDrawVisible;

Callers 1

UI_InitFunction · 0.85

Calls 15

UI_RegisterCvarsFunction · 0.70
UI_InitMemoryFunction · 0.70
trap_GetGlconfigFunction · 0.70
Init_DisplayFunction · 0.70
UI_BuildPlayerModel_ListFunction · 0.70
String_InitFunction · 0.70
UI_Cvar_VariableStringFunction · 0.70
UI_LoadMenusFunction · 0.70
Menus_CloseAllFunction · 0.70
AssetCacheFunction · 0.70
trap_Cvar_VariableValueFunction · 0.70
trap_S_RegisterSoundFunction · 0.70

Tested by

no test coverage detected