static void SetUpTestCase() { TEST_Init(); cl_genericPool = Mem_CreatePool("Client: Generic"); cp_campaignPool = Mem_CreatePool("Client: Local (per game)"); cp_campaign = Cvar_Get("cp_campaign", "main"); cp_missiontest = Cvar_Get("cp_missiontest", "0"); vid_imagePool = Mem_CreatePool("Vid: Image system"); r_state.active_texunit = &r_state.texunits[0]; R_FontInit(); UI_Init(); GAME_InitStartup(); OBJZERO(cls); Com_ParseScripts(false); Cmd_ExecuteString("game_setmode campaign"); Cmd_AddCommand("msgoptions_set", Cmd_Dummy_f); CL_SetClientState(ca_disconnected); cls.realtime = Sys_Milliseconds(); }
/** * @brief Initialize the menu data hunk, add cvars and commands * @note This function is called once * @sa MN_Shutdown * @sa CL_InitLocal */ void CLMN_InitStartup (void) { /* print the keyBindings to mn.menuText */ Cmd_AddCommand("mn_init_keylist", CLMN_InitKeyList_f, NULL); UI_Init(); }
/** * The suite initialization function. * Returns zero on success, non-zero otherwise. */ static int UFO_InitSuiteCampaign (void) { TEST_Init(); cl_genericPool = Mem_CreatePool("Client: Generic"); cp_campaignPool = Mem_CreatePool("Client: Local (per game)"); cp_campaign = Cvar_Get("cp_campaign", "main", 0, NULL); cp_missiontest = Cvar_Get("cp_missiontest", "0", 0, NULL); vid_imagePool = Mem_CreatePool("Vid: Image system"); r_state.active_texunit = &r_state.texunits[0]; R_FontInit(); UI_Init(); OBJZERO(cls); Com_ParseScripts(qfalse); Cmd_AddCommand("msgoptions_set", Cmd_Dummy_f, NULL); cl_geoscape_overlay = Cvar_Get("cl_geoscape_overlay", "0", 0, NULL); cl_3dmap = Cvar_Get("cl_3dmap", "1", 0, NULL); CL_SetClientState(ca_disconnected); cls.realtime = Sys_Milliseconds(); return 0; }
/** * The suite initialization function. * Returns zero on success, non-zero otherwise. */ static int UFO_InitSuiteUILevel2 (void) { TEST_Init(); UI_Init(); vid_imagePool = Mem_CreatePool("Vid: Image system"); r_state.active_texunit = &texunit_diffuse; return 0; }
static void SetUpTestCase() { TEST_Init(); PTL_InitStartup(); vid_imagePool = Mem_CreatePool("Vid: Image system"); cl_genericPool = Mem_CreatePool("Client: Generic"); r_state.active_texunit = &r_state.texunits[0]; R_FontInit(); UI_Init(); OBJZERO(cls); Com_ParseScripts(false); }
/** * The suite initialization function. * Returns zero on success, non-zero otherwise. */ static int UFO_InitSuiteScripts (void) { TEST_Init(); cl_genericPool = Mem_CreatePool("Client: Generic"); vid_imagePool = Mem_CreatePool("Vid: Image system"); r_state.active_texunit = &r_state.texunits[0]; R_FontInit(); UI_Init(); OBJZERO(cls); Com_ParseScripts(qfalse); return 0; }
/** * @brief Reloads the ui scripts and reinitializes the ui */ static void UI_Restart_f (void) { typedef std::vector<std::string> Names; Names names; for (int i = 0; i < ui_global.windowStackPos; i++) { names.push_back(std::string(ui_global.windowStack[i]->name)); } UI_Shutdown(); CLMN_Shutdown(); R_FontShutdown(); UI_Init(); R_FontInit(); Com_Printf("%i ui script files\n", FS_BuildFileList("ufos/ui/*.ufo")); FS_NextScriptHeader(nullptr, nullptr, nullptr); const char* type, *name, *text; text = nullptr; while ((type = FS_NextScriptHeader("ufos/*.ufo", &name, &text)) != nullptr) { if (Q_streq(type, "font")) UI_ParseFont(name, &text); else if (Q_streq(type, "menu_model")) UI_ParseUIModel(name, &text); else if (Q_streq(type, "sprite")) UI_ParseSprite(name, &text); } UI_Reinit(); FS_NextScriptHeader(nullptr, nullptr, nullptr); text = nullptr; while ((type = FS_NextScriptHeader("ufos/ui/*.ufo", &name, &text)) != nullptr) { if (Q_streq(type, "window")) UI_ParseWindow(type, name, &text); else if (Q_streq(type, "component")) UI_ParseComponent(type, name, &text); else if (Q_streq(type, "menu_model")) UI_ParseUIModel(name, &text); else if (Q_streq(type, "sprite")) UI_ParseSprite(name, &text); else if (Q_streq(type, "lua")) UI_ParseAndLoadLuaScript(name, &text); } CLMN_Init(); for (Names::iterator i = names.begin(); i != names.end(); ++i) { UI_PushWindow(i->c_str()); } }
/* ================ vmMain This is the only way control passes into the module. This must be the very first function compiled into the .qvm file ================ */ Q_EXPORT intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11 ) { switch ( command ) { case UI_GETAPIVERSION: return UI_API_VERSION; case UI_INIT: UI_Init(); return 0; case UI_SHUTDOWN: UI_Shutdown(); return 0; case UI_KEY_EVENT: UI_KeyEvent( arg0, arg1 ); return 0; case UI_MOUSE_EVENT: UI_MouseEvent( arg0, arg1 ); return 0; case UI_REFRESH: UI_Refresh( arg0 ); return 0; case UI_IS_FULLSCREEN: return UI_IsFullscreen(); case UI_SET_ACTIVE_MENU: UI_SetActiveMenu( arg0 ); return 0; case UI_CONSOLE_COMMAND: return UI_ConsoleCommand(arg0); case UI_DRAW_CONNECT_SCREEN: UI_DrawConnectScreen( arg0 ); return 0; /* case UI_HASUNIQUECDKEY: // mod authors need to observe this return qtrue; // change this to qfalse for mods! */ } return -1; }
int main(void) { /* Disable watchdog: not required for this application */ MCUSR &= ~(1 << WDRF); wdt_disable(); setupTimer(); setupIO(); UI_Init(); /* All processing interrupt based from here*/ DO_TEST_HARNESS_SETUP(); sei(); // Update display on first application tick s_settings = Strobe_Init(); s_bSettingsChanged = true; while (true) { DO_TEST_HARNESS_RUNNING(); UI_Tick(); if (TMR8_Tick_TestAndClear(&appTick)) { applicationTick(); DO_TEST_HARNESS_TICK(); } if (TMR8_Tick_TestAndClear(&heartbeatTick)) { IO_Control(IO_PORTB, 5, IO_TOGGLE); } } return 0; }
/* ================ vmMain This is the only way control passes into the module. This must be the very first function compiled into the .qvm file ================ */ int vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6 ) { switch ( command ) { case UI_GETAPIVERSION: return UI_API_VERSION; case UI_INIT: UI_Init(); return 0; case UI_SHUTDOWN: UI_Shutdown(); return 0; case UI_KEY_EVENT: UI_KeyEvent( arg0 ); return 0; case UI_MOUSE_EVENT: UI_MouseEvent( arg0, arg1 ); return 0; case UI_REFRESH: UI_Refresh( arg0 ); return 0; case UI_IS_FULLSCREEN: return UI_IsFullscreen(); case UI_SET_ACTIVE_MENU: UI_SetActiveMenu( arg0 ); return 0; case UI_CONSOLE_COMMAND: return UI_ConsoleCommand(); case UI_DRAW_CONNECT_SCREEN: UI_DrawConnectScreen( arg0 ); return 0; } return -1; }
static void SetUpTestCase() { TEST_Init(); sv_genericPool = Mem_CreatePool("mapdef-test"); com_networkPool = Mem_CreatePool("Network"); vid_imagePool = Mem_CreatePool("Vid: Image system"); sv_dumpmapassembly = Cvar_Get("sv_dumpassembly", "0"); sv_public = Cvar_Get("sv_public", "0"); port = Cvar_Get("testport", "27909"); masterserver_url = Cvar_Get("masterserver_test", "http://localhost"); cl_genericPool = Mem_CreatePool("Client: Generic"); r_state.active_texunit = &r_state.texunits[0]; R_FontInit(); UI_Init(); OBJZERO(cls); Com_ParseScripts(false); }
/** * The suite initialization function. * Returns zero on success, non-zero otherwise. */ static int UFO_InitSuiteMapDef (void) { TEST_Init(); NET_Init(); sv_genericPool = Mem_CreatePool("mapdef-test"); com_networkPool = Mem_CreatePool("Network"); vid_imagePool = Mem_CreatePool("Vid: Image system"); sv_dumpmapassembly = Cvar_Get("sv_dumpassembly", "0", 0, NULL); sv_public = Cvar_Get("sv_public", "0", 0, NULL); port = Cvar_Get("testport", "27909", 0, NULL); cl_genericPool = Mem_CreatePool("Client: Generic"); r_state.active_texunit = &r_state.texunits[0]; R_FontInit(); UI_Init(); OBJZERO(cls); Com_ParseScripts(qfalse); return 0; }
int main(int argc, char *argv[]) { #if defined(__WIN32) && defined(USE_SDL) redirectStdoutToFile(); #endif #if defined(ADM_DEBUG) && defined(FIND_LEAKS) new_progname = argv[0]; #endif #ifndef __MINGW32__ // thx smurf uk :) installSigHandler(); #endif printf("*************************\n"); printf(" Avidemux v" VERSION); if(ADM_SUBVERSION) { printf(" (r%04u)", ADM_SUBVERSION); } printf("\n*************************\n"); printf(" http://www.avidemux.org\n"); printf(" Code : Mean, JSC, Gruntster \n"); printf(" GFX : Nestor Di , [email protected]\n"); printf(" Design : Jakub Misak\n"); printf(" FreeBSD : Anish Mistry, [email protected]\n"); printf(" Audio : Mihail Zenkov\n"); printf(" MacOsX : Kuisathaverat\n"); printf(" Win32 : Gruntster\n\n"); #ifdef __GNUC__ printf("Compiler: GCC %s\n", __VERSION__); #endif printf("Build Target: "); #if defined(__WIN32) printf("Microsoft Windows"); #elif defined(__APPLE__) printf("Apple"); #else printf("Linux"); #endif #if defined(ADM_CPU_X86_32) printf(" (x86)"); #elif defined(ADM_CPU_X86_64) printf(" (x86-64)"); #elif defined(ADM_CPU_PPC) printf(" (PowerPC)"); #endif printf("\n"); char uiDesc[15]; getUIDescription(uiDesc); printf("User Interface: %s\n", uiDesc); #ifdef __WIN32 char version[250]; if (getWindowsVersion(version)) printf("Operating System: %s\n", version); #endif #if defined(__USE_LARGEFILE) && defined(__USE_LARGEFILE64) printf("\nLarge file available: %d offset\n", __USE_FILE_OFFSET64); #endif // Start counting memory ADM_memStatInit(); ADM_InitMemcpy(); printf("\nInitialising prefs\n"); initPrefs(); prefs->load(); CpuCaps::init(); #ifdef USE_SDL uint32_t videoDevice = RENDER_LAST; prefs->get(DEVICE_VIDEODEVICE, &videoDevice); initSdl(videoDevice); #endif atexit(onexit); #ifdef __MINGW32__ win32_netInit(); #endif UI_Init(argc,argv); AUDMEncoder_initDither(); // Hook our UI... InitFactory(); InitCoreToolkit(); initFileSelector(); // Load .avidemuxrc quotaInit(); video_body = new ADM_Composer; #ifdef HAVE_ENCODER registerVideoFilters(); #endif //***************Plugins ********************* // Load system wide audio decoder plugin #ifdef _WIN32 const char *startDir=""; const char *pluginDir="plugins"; #else const char *pluginDir="ADM_plugins"; #ifdef __APPLE__ const char *startDir="../lib"; #else const char *startDir="lib"; #endif #endif char *adPlugins = ADM_getInstallRelativePath(startDir,pluginDir,"audioDecoder"); char *vfPlugins = ADM_getInstallRelativePath(startDir,pluginDir,"videoFilter"); char *avPlugins = ADM_getInstallRelativePath(startDir,pluginDir,"audioDevices"); char *aePlugins = ADM_getInstallRelativePath(startDir,pluginDir,"audioEncoders"); ADM_ad_loadPlugins(adPlugins); delete [] adPlugins; ADM_vf_loadPlugins(vfPlugins); delete [] vfPlugins; ADM_av_loadPlugins(avPlugins); delete [] avPlugins; ADM_ae_loadPlugins(aePlugins); delete [] aePlugins; // load local audio decoder plugins adPlugins=ADM_getHomeRelativePath("plugins","audioDecoder"); ADM_ad_loadPlugins(adPlugins); delete [] adPlugins; // load local video filter plugins vfPlugins=ADM_getHomeRelativePath("plugins","videoFilter"); ADM_vf_loadPlugins(vfPlugins); delete [] vfPlugins; // load encoder plugins... loadPlugins(); //***************Plugins ********************* if(!initGUI()) { printf("\n Fatal : could not init GUI\n"); exit(-1); } ADM_lavInit(); #ifdef HAVE_AUDIO AVDM_audioInit(); #endif if(SpidermonkeyInit() == true) printf("Spidermonkey initialized.\n"); else ADM_assert(0); #ifdef __MINGW32__ __try1(exceptionHandler); #endif UI_RunApp(); #ifdef __MINGW32__ __except1(exceptionHandler); #endif printf("Normal exit\n"); return 0; }
/* ==================== CL_InitUI ==================== */ void CL_InitUI( void ) { #ifdef JK2_MODE JK2SP_Register("keynames", 0 /*SP_REGISTER_REQUIRED*/); // reference is KEYNAMES #endif uiimport_t uii; memset( &uii, 0, sizeof( uii ) ); uii.Printf = Com_Printf; uii.Error = Com_Error; uii.Cvar_Set = Cvar_Set; uii.Cvar_VariableValue = Cvar_VariableValue; uii.Cvar_VariableStringBuffer = Cvar_VariableStringBuffer; uii.Cvar_SetValue = Cvar_SetValue; uii.Cvar_Reset = Cvar_Reset; uii.Cvar_Create = UI_Cvar_Create; uii.Cvar_InfoStringBuffer = Cvar_InfoStringBuffer; uii.Draw_DataPad = CL_DrawDatapad; uii.Argc = Cmd_Argc; uii.Argv = Cmd_ArgvBuffer; uii.Cmd_TokenizeString = Cmd_TokenizeString; uii.Cmd_ExecuteText = Cbuf_ExecuteText; uii.FS_FOpenFile = FS_FOpenFileByMode; uii.FS_Read = FS_Read; uii.FS_Write = FS_Write; uii.FS_FCloseFile = FS_FCloseFile; uii.FS_GetFileList = FS_GetFileList; uii.FS_ReadFile = FS_ReadFile; uii.FS_FreeFile = FS_FreeFile; uii.R_RegisterModel = re.RegisterModel; uii.R_RegisterSkin = re.RegisterSkin; uii.R_RegisterShader = re.RegisterShader; uii.R_RegisterShaderNoMip = re.RegisterShaderNoMip; uii.R_RegisterFont = re.RegisterFont; uii.R_Font_StrLenPixels = re.Font_StrLenPixels; uii.R_Font_HeightPixels = re.Font_HeightPixels; uii.R_Font_DrawString = re.Font_DrawString; uii.R_Font_StrLenChars = re.Font_StrLenChars; uii.Language_IsAsian = re.Language_IsAsian; uii.Language_UsesSpaces = re.Language_UsesSpaces; uii.AnyLanguage_ReadCharFromString = re.AnyLanguage_ReadCharFromString; //uii.SG_GetSaveImage = SG_GetSaveImage; uii.SG_GetSaveGameComment = SG_GetSaveGameComment; uii.SG_StoreSaveGameComment = SG_StoreSaveGameComment; uii.SG_GameAllowedToSaveHere= SG_GameAllowedToSaveHere; //uii.SCR_GetScreenshot = SCR_GetScreenshot; //uii.DrawStretchRaw = re.DrawStretchRaw; uii.R_ClearScene = re.ClearScene; uii.R_AddRefEntityToScene = re.AddRefEntityToScene; uii.R_AddPolyToScene = re.AddPolyToScene; uii.R_AddLightToScene = re.AddLightToScene; uii.R_RenderScene = re.RenderScene; uii.R_ModelBounds = re.ModelBounds; uii.R_SetColor = re.SetColor; uii.R_DrawStretchPic = re.DrawStretchPic; uii.UpdateScreen = SCR_UpdateScreen; uii.R_LerpTag = re.LerpTag; uii.S_StartLocalLoopingSound= S_StartLocalLoopingSound; uii.S_StartLocalSound = S_StartLocalSound; uii.S_RegisterSound = S_RegisterSound; uii.Key_KeynumToStringBuf = Key_KeynumToStringBuf; uii.Key_GetBindingBuf = Key_GetBindingBuf; uii.Key_SetBinding = Key_SetBinding; uii.Key_IsDown = Key_IsDown; uii.Key_GetOverstrikeMode = Key_GetOverstrikeMode; uii.Key_SetOverstrikeMode = Key_SetOverstrikeMode; uii.Key_ClearStates = Key_ClearStates; uii.Key_GetCatcher = Key_GetCatcher; uii.Key_SetCatcher = Key_SetCatcher; #ifdef JK2_MODE uii.SP_Register = JK2SP_Register; uii.SP_GetStringText = JK2SP_GetStringText; uii.SP_GetStringTextString = JK2SP_GetStringTextString; #endif uii.GetClipboardData = GetClipboardData; uii.GetClientState = GetClientState; uii.GetGlconfig = UI_GetGlconfig; uii.GetConfigString = (void (*)(int, char *, int))GetConfigString; uii.Milliseconds = Sys_Milliseconds; UI_Init(UI_API_VERSION, &uii, (cls.state > CA_DISCONNECTED && cls.state <= CA_ACTIVE)); // uie->UI_Init( UI_API_VERSION, &uii ); }
int baseq3_ui_vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11 ) { #else int vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11 ) { #endif // IOS switch ( command ) { case UI_GETAPIVERSION: return UI_API_VERSION; case UI_INIT: UI_Init(); return 0; case UI_UPDATE_GLCONFIG: UI_UpdateGLConfig(); return 0; case UI_SHUTDOWN: UI_Shutdown(); return 0; case UI_KEY_EVENT: UI_KeyEvent( arg0, arg1 ); return 0; case UI_MOUSE_EVENT: UI_MouseEvent( arg0, arg1 ); return 0; case UI_REFRESH: UI_Refresh( arg0 ); return 0; case UI_IS_FULLSCREEN: return UI_IsFullscreen(); case UI_SET_ACTIVE_MENU: UI_SetActiveMenu( arg0 ); return 0; case UI_CONSOLE_COMMAND: return UI_ConsoleCommand(arg0); case UI_DRAW_CONNECT_SCREEN: UI_DrawConnectScreen( arg0 ); return 0; case UI_SELECT_AND_PRESS: UI_SelectAndPress( arg0, arg1 ); return 0; case UI_HASUNIQUECDKEY: // mod authors need to observe this return qtrue; // bk010117 - change this to qfalse for mods! } return -1; } /* ================ cvars ================ */ typedef struct { vmCvar_t *vmCvar; char *cvarName; char *defaultString; int cvarFlags; } cvarTable_t; vmCvar_t ui_ffa_fraglimit; vmCvar_t ui_ffa_timelimit; vmCvar_t ui_tourney_fraglimit; vmCvar_t ui_tourney_timelimit; vmCvar_t ui_team_fraglimit; vmCvar_t ui_team_timelimit; vmCvar_t ui_team_friendly; vmCvar_t ui_ctf_capturelimit; vmCvar_t ui_ctf_timelimit; vmCvar_t ui_ctf_friendly; vmCvar_t ui_arenasFile; vmCvar_t ui_botsFile; vmCvar_t ui_spScores1; vmCvar_t ui_spScores2; vmCvar_t ui_spScores3; vmCvar_t ui_spScores4; vmCvar_t ui_spScores5; vmCvar_t ui_spAwards; vmCvar_t ui_spVideos; vmCvar_t ui_spSkill; vmCvar_t ui_spSelection; vmCvar_t ui_browserMaster; vmCvar_t ui_browserGameType; vmCvar_t ui_browserSortKey; vmCvar_t ui_browserShowFull; vmCvar_t ui_browserShowEmpty; vmCvar_t ui_brassTime; vmCvar_t ui_drawCrosshair; vmCvar_t ui_drawCrosshairNames; vmCvar_t ui_marks; vmCvar_t ui_server1; vmCvar_t ui_server2; vmCvar_t ui_server3; vmCvar_t ui_server4; vmCvar_t ui_server5; vmCvar_t ui_server6; vmCvar_t ui_server7; vmCvar_t ui_server8; vmCvar_t ui_server9; vmCvar_t ui_server10; vmCvar_t ui_server11; vmCvar_t ui_server12; vmCvar_t ui_server13; vmCvar_t ui_server14; vmCvar_t ui_server15; vmCvar_t ui_server16; vmCvar_t ui_cdkeychecked; // bk001129 - made static to avoid aliasing. static cvarTable_t cvarTable[] = { { &ui_ffa_fraglimit, "ui_ffa_fraglimit", "20", CVAR_ARCHIVE }, { &ui_ffa_timelimit, "ui_ffa_timelimit", "0", CVAR_ARCHIVE }, { &ui_tourney_fraglimit, "ui_tourney_fraglimit", "0", CVAR_ARCHIVE }, { &ui_tourney_timelimit, "ui_tourney_timelimit", "15", CVAR_ARCHIVE }, { &ui_team_fraglimit, "ui_team_fraglimit", "0", CVAR_ARCHIVE }, { &ui_team_timelimit, "ui_team_timelimit", "20", CVAR_ARCHIVE }, { &ui_team_friendly, "ui_team_friendly", "1", CVAR_ARCHIVE }, { &ui_ctf_capturelimit, "ui_ctf_capturelimit", "8", CVAR_ARCHIVE }, { &ui_ctf_timelimit, "ui_ctf_timelimit", "30", CVAR_ARCHIVE }, { &ui_ctf_friendly, "ui_ctf_friendly", "0", CVAR_ARCHIVE }, { &ui_arenasFile, "g_arenasFile", "", CVAR_INIT|CVAR_ROM }, { &ui_botsFile, "g_botsFile", "", CVAR_INIT|CVAR_ROM }, { &ui_spScores1, "g_spScores1", "", CVAR_ARCHIVE | CVAR_ROM }, { &ui_spScores2, "g_spScores2", "", CVAR_ARCHIVE | CVAR_ROM }, { &ui_spScores3, "g_spScores3", "", CVAR_ARCHIVE | CVAR_ROM }, { &ui_spScores4, "g_spScores4", "", CVAR_ARCHIVE | CVAR_ROM }, { &ui_spScores5, "g_spScores5", "", CVAR_ARCHIVE | CVAR_ROM }, { &ui_spAwards, "g_spAwards", "", CVAR_ARCHIVE | CVAR_ROM }, { &ui_spVideos, "g_spVideos", "", CVAR_ARCHIVE | CVAR_ROM }, { &ui_spSkill, "g_spSkill", "2", CVAR_ARCHIVE | CVAR_LATCH }, { &ui_spSelection, "ui_spSelection", "", CVAR_ROM }, { &ui_browserMaster, "ui_browserMaster", "0", CVAR_ARCHIVE }, { &ui_browserGameType, "ui_browserGameType", "0", CVAR_ARCHIVE }, { &ui_browserSortKey, "ui_browserSortKey", "4", CVAR_ARCHIVE }, { &ui_browserShowFull, "ui_browserShowFull", "1", CVAR_ARCHIVE }, { &ui_browserShowEmpty, "ui_browserShowEmpty", "1", CVAR_ARCHIVE }, { &ui_brassTime, "cg_brassTime", "2500", CVAR_ARCHIVE }, { &ui_drawCrosshair, "cg_drawCrosshair", "4", CVAR_ARCHIVE }, { &ui_drawCrosshairNames, "cg_drawCrosshairNames", "1", CVAR_ARCHIVE }, { &ui_marks, "cg_marks", "1", CVAR_ARCHIVE }, { &ui_server1, "server1", "", CVAR_ARCHIVE }, { &ui_server2, "server2", "", CVAR_ARCHIVE }, { &ui_server3, "server3", "", CVAR_ARCHIVE }, { &ui_server4, "server4", "", CVAR_ARCHIVE }, { &ui_server5, "server5", "", CVAR_ARCHIVE }, { &ui_server6, "server6", "", CVAR_ARCHIVE }, { &ui_server7, "server7", "", CVAR_ARCHIVE }, { &ui_server8, "server8", "", CVAR_ARCHIVE }, { &ui_server9, "server9", "", CVAR_ARCHIVE }, { &ui_server10, "server10", "", CVAR_ARCHIVE }, { &ui_server11, "server11", "", CVAR_ARCHIVE }, { &ui_server12, "server12", "", CVAR_ARCHIVE }, { &ui_server13, "server13", "", CVAR_ARCHIVE }, { &ui_server14, "server14", "", CVAR_ARCHIVE }, { &ui_server15, "server15", "", CVAR_ARCHIVE }, { &ui_server16, "server16", "", CVAR_ARCHIVE }, { &ui_cdkeychecked, "ui_cdkeychecked", "0", CVAR_ROM } }; // bk001129 - made static to avoid aliasing static int cvarTableSize = sizeof(cvarTable) / sizeof(cvarTable[0]); /* ================= UI_RegisterCvars ================= */ void UI_RegisterCvars( void ) { int i; cvarTable_t *cv; for ( i = 0, cv = cvarTable ; i < cvarTableSize ; i++, cv++ ) { trap_Cvar_Register( cv->vmCvar, cv->cvarName, cv->defaultString, cv->cvarFlags ); } }
bool Init(void) { DMacro_TraceEnter(Init); // // OpenGL // DGL::Font::Init(); // Texture glEnable( GL_TEXTURE_2D); g_loadingScreen.Init(); CHECK_QUIT; g_loadingScreen.SetStage( 5, "Initializing OpenGL ..."); DGL::InitQuadrics(); DGL::Extensions::Init(); if(DGL::Extensions::IsEnabled_WGL_EXT_swap_control()) { DSys::Logger::Print("Disabling monitor sync ..."); wglSwapIntervalEXT(0); } if(DGL::Extensions::IsEnabled_GL_EXT_clip_volume_hint()) { DSys::Logger::Print("Enabling volume clipping ..."); glHint( GL_CLIP_VOLUME_CLIPPING_HINT_EXT, GL_NICEST); } if(DGL::Extensions::IsEnabled_GL_EXT_point_parameters()) { DSys::Logger::Print("Setting point parameters ..."); glPointSize(5); glPointParameterfEXT( GL_POINT_SIZE_MIN_EXT, 1); glPointParameterfEXT( GL_POINT_SIZE_MAX_EXT, 10); glPointParameterfEXT( GL_POINT_FADE_THRESHOLD_SIZE_EXT, 50); glPointParameterfEXT( GL_DISTANCE_ATTENUATION_EXT, 60); } // Depth buffer glClearDepth( 100.0f); // glDepthFunc( GL_LEQUAL); // glEnable( GL_DEPTH_TEST); if(DGL::Extensions::IsEnabled_GL_NV_texgen_reflection()) { glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_NV); glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_NV); } else { glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); } // shade model glShadeModel(GL_SMOOTH); // clear color glClearColor(0,0,0,1); // hints glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glHint( GL_POINT_SMOOTH_HINT, GL_NICEST); glHint( GL_LINE_SMOOTH_HINT, GL_NICEST); glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST); // polygon mode glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); // Back Face Is Solid glDisable( GL_CULL_FACE); g_font.Create( "Font"); glLoadIdentity(); // // Media // CHECK_QUIT; g_loadingScreen.SetStage(10, "Loading Media..."); if(!DSys::sv_bDeveloper) g_bakmusic.Load( "sounds/music/bouncing.mp3"); // User interface CHECK_QUIT; g_loadingScreen.SetStage(40, "Loading User Interface..."); UI_Init(); CHECK_QUIT; g_loadingScreen.SetStage(60, "Initializing Bouncing Game ..."); TD::gameServer = new TD::game_server; TD::gameServer->init(); CHECK_QUIT; g_loadingScreen.SetStage(90, "Initializing Effects..."); // fade effect g_fadeIn.Init( DGL::Color(0.0f,0.0f,0.0f,1.0f), DGL::Color(0.0f,0.0f,0.0f,0.0f),1000); g_fadeOut.Init( DGL::Color(0.0f,0.0f,0.0f,0.0f), DGL::Color(0.0f,0.0f,0.0f,1.0f),2000); g_menuBack.Build( "textures/menuBack.jpg"); CHECK_QUIT; g_loadingScreen.SetStage(100, "Awaiting Snapshot..."); /////////////// // now start the back music g_bakmusic.Play(); DMacro_TraceLeave(); return true; }
int startAvidemux(int argc, char *argv[]) { printf("*************************\n"); printf(" Avidemux v"ADM_VERSION); #if defined( ADM_SUBVERSION ) #define MKSTRING(x) x printf(" (%s) .", MKSTRING(ADM_SUBVERSION)); #endif printf("\n*************************\n"); printf(" http://www.avidemux.org\n"); printf(" Code : Mean, JSC, Grant Pedersen\n"); printf(" GFX : Nestor Di, [email protected]\n"); printf(" Design : Jakub Misak\n"); printf(" FreeBSD : Anish Mistry, [email protected]\n"); printf(" Audio : Mihail Zenkov\n"); printf(" Mac OS X : Kuisathaverat, Harry van der Wolf\n"); printf(" Win32 : Grant Pedersen\n\n"); #ifdef __GNUC__ printf("Compiler: GCC %s\n", __VERSION__); #endif printf("Build Target: "); #if defined(_WIN32) printf("Microsoft Windows"); #elif defined(__APPLE__) printf("Apple"); #else printf("Linux"); #endif #if defined(ADM_CPU_X86_32) printf(" (x86)"); #elif defined(ADM_CPU_X86_64) printf(" (x86-64)"); #endif char uiDesc[15]; getUIDescription(uiDesc); printf("\nUser Interface: %s\n", uiDesc); #ifdef _WIN32 char version[250]; if (getWindowsVersion(version)) printf("Operating System: %s\n", version); #endif #if defined(__USE_LARGEFILE) && defined(__USE_LARGEFILE64) printf("\nLarge file available: %d offset\n", __USE_FILE_OFFSET64); #endif printf("Time: %s\n", ADM_epochToString(ADM_getSecondsSinceEpoch())); for(int i = 0; i < argc; i++) { printf("%d: %s\n", i, argv[i]); } #ifndef __APPLE__ ADM_InitMemcpy(); #endif printf("\nInitialising prefs\n"); initPrefs(); if(false==prefs->load()) // no prefs, set some sane default { setPrefsDefault(); } CpuCaps::init(); atexit(onexit); #ifdef _WIN32 win32_netInit(); #endif video_body = new ADM_Composer; UI_Init(argc, argv); AUDMEncoder_initDither(); // Hook our UI... InitFactory(); InitCoreToolkit(); initFileSelector(); // Load .avidemuxrc quotaInit(); ADM_lavFormatInit(); //***************Plugins ********************* // Load system wide audio decoder plugin #ifdef __APPLE__ const char *startDir="../lib"; #else const char *startDir=ADM_RELATIVE_LIB_DIR; #endif char *adPlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "audioDecoder"); char *avPlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "audioDevices"); char *aePlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "audioEncoders"); char *dmPlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "demuxers"); char *mxPlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "muxers"); char *vePlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "videoEncoders"); char *vdPlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "videoDecoders"); char *vfPlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "videoFilters"); char *sePlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "scriptEngines"); //***************Plugins ********************* if(!initGUI(initialiseScriptEngines(sePlugins, video_body,getUISpecifSubfolder()))) { printf("\n Fatal : could not init GUI\n"); exit(-1); } delete [] sePlugins; #if defined( USE_VDPAU) #if (ADM_UI_TYPE_BUILD!=ADM_UI_CLI) printf("Probing for VDPAU...\n"); if(vdpauProbe()==true) printf("VDPAU available\n"); else printf("VDPAU not available\n"); #else printf("Cannot use VDPAU in cli mode %d,%d\n",ADM_UI_TYPE_BUILD,ADM_UI_CLI); #endif #endif #if defined( USE_XVBA) #if (ADM_UI_TYPE_BUILD!=ADM_UI_CLI) printf("Probing for XVBA...\n"); if(xvbaProbe()==true) printf("XVBA available\n"); else printf("XVBA not available\n"); #else printf("Cannot use XVBA in cli mode %d,%d\n",ADM_UI_TYPE_BUILD,ADM_UI_CLI); #endif #endif #if defined( USE_LIBVA) #if (ADM_UI_TYPE_BUILD!=ADM_UI_CLI) printf("Probing for LIBVA...\n"); if(libvaProbe()==true) printf("LIBVA available\n"); else printf("LIBVA not available\n"); #else printf("Cannot use LIBVA in cli mode %d,%d\n",ADM_UI_TYPE_BUILD,ADM_UI_CLI); #endif #endif #ifdef USE_SDL char *drv=NULL; printf("Probing for SDL...\n"); std::string sdlDriver=std::string("dummy"); if(prefs->get(FEATURES_SDLDRIVER,&drv)) { if(drv) { if(strlen(drv)) { sdlDriver=std::string(drv); } ADM_dezalloc(drv); } } printf("Calling initSDL with driver=%s\n",sdlDriver.c_str()); initSdl(sdlDriver); #endif // ADM_mx_loadPlugins(mxPlugins); delete [] mxPlugins; ADM_ad_loadPlugins(adPlugins); delete [] adPlugins; ADM_av_loadPlugins(avPlugins); delete [] avPlugins; ADM_ae_loadPlugins(aePlugins); delete [] aePlugins; ADM_dm_loadPlugins(dmPlugins); delete [] dmPlugins; ADM_ve6_loadPlugins(vePlugins,getUISpecifSubfolder()); delete [] vePlugins; ADM_vf_loadPlugins(vfPlugins,getUISpecifSubfolder()); delete [] vfPlugins; ADM_vd6_loadPlugins(vdPlugins); delete [] vdPlugins; // load local audio decoder plugins adPlugins=ADM_getHomeRelativePath("plugins6","audioDecoder"); ADM_ad_loadPlugins(adPlugins); delete [] adPlugins; // load local video filter plugins vfPlugins=ADM_getHomeRelativePath("plugins6","videoFilter"); ADM_vf_loadPlugins(vfPlugins,getUISpecifSubfolder()); delete [] vfPlugins; ADM_lavInit(); AVDM_audioInit(); UI_RunApp(); cleanUp(); printf("Normal exit\n"); return 0; }
int startAvidemux(int argc, char *argv[]) { printf("*************************\n"); printf(" Avidemux v" VERSION); if(ADM_SUBVERSION) { printf(" (r%04u)", ADM_SUBVERSION); } printf("\n*************************\n"); printf(" http://www.avidemux.org\n"); printf(" Code : Mean, JSC, Grant Pedersen\n"); printf(" GFX : Nestor Di, [email protected]\n"); printf(" Design : Jakub Misak\n"); printf(" FreeBSD : Anish Mistry, [email protected]\n"); printf(" Audio : Mihail Zenkov\n"); printf(" Mac OS X : Kuisathaverat, Harry van der Wolf\n"); printf(" Win32 : Grant Pedersen\n\n"); printf("Compiler: "); #if defined(__GNUC__) printf("GCC %s", __VERSION__); #elif defined(_MSC_VER) printf("Microsoft Visual C++ %d.%d", _MSC_VER / 100, _MSC_VER % 100); #else printf("Unknown"); #endif printf("\nBuild Target: "); #if defined(_WIN32) printf("Microsoft Windows"); #elif defined(__APPLE__) printf("Apple"); #else printf("Linux"); #endif #if defined(ADM_CPU_X86_32) printf(" (x86)"); #elif defined(ADM_CPU_X86_64) printf(" (x86-64)"); #endif char uiDesc[15]; getUIDescription(uiDesc); printf("\nUser Interface: %s\n", uiDesc); #ifdef _WIN32 char version[250]; if (getWindowsVersion(version)) printf("Operating System: %s\n", version); #endif #if defined(__USE_LARGEFILE) && defined(__USE_LARGEFILE64) printf("\nLarge file available: %d offset\n", __USE_FILE_OFFSET64); #endif printf("Time: %s\n", ADM_epochToString(ADM_getSecondsSinceEpoch())); for(int i = 0; i < argc; i++) { printf("%d: %s\n", i, argv[i]); } // Start counting memory ADM_memStatInit(); #ifndef __APPLE__ ADM_InitMemcpy(); #endif printf("\nInitialising prefs\n"); initPrefs(); if(false==prefs->load()) // no prefs, set some sane default { setPrefsDefault(); } CpuCaps::init(); #ifdef USE_SDL uint32_t videoDevice = RENDER_LAST; prefs->get(VIDEODEVICE, &videoDevice); initSdl(videoDevice); #endif atexit(onexit); #ifdef _WIN32 win32_netInit(); #endif IPluginManager *pluginManager = new PluginManager(); pluginManager->loadAll(); UI_SetPluginManager(pluginManager); video_body = new ADM_Composer(pluginManager); UI_Init(argc, argv); AUDMEncoder_initDither(); // Hook our UI... InitFactory(); InitCoreToolkit(); initFileSelector(); // Load .avidemuxrc quotaInit(); ADM_lavFormatInit(); //***************Plugins ********************* // Load system wide audio decoder plugin #ifdef __APPLE__ const char *startDir="../lib"; #else const char *startDir=ADM_RELATIVE_LIB_DIR; #endif char *adPlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "audioDecoder"); char *avPlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "audioDevices"); char *aePlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "audioEncoders"); char *dmPlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "demuxers"); char *vdPlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "videoDecoders"); char *vfPlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "videoFilters"); char *sePlugins = ADM_getInstallRelativePath(startDir, ADM_PLUGIN_DIR, "scriptEngines"); ADM_ad_loadPlugins(adPlugins); delete [] adPlugins; ADM_av_loadPlugins(avPlugins); delete [] avPlugins; ADM_ae_loadPlugins(aePlugins); delete [] aePlugins; ADM_dm_loadPlugins(dmPlugins); delete [] dmPlugins; ADM_vf_loadPlugins(vfPlugins); delete [] vfPlugins; ADM_vd6_loadPlugins(vdPlugins); delete [] vdPlugins; // load local audio decoder plugins adPlugins=ADM_getHomeRelativePath("plugins6","audioDecoder"); ADM_ad_loadPlugins(adPlugins); delete [] adPlugins; // load local video filter plugins vfPlugins=ADM_getHomeRelativePath("plugins6","videoFilter"); ADM_vf_loadPlugins(vfPlugins); delete [] vfPlugins; //***************Plugins ********************* if(!initGUI(initialiseScriptEngines(sePlugins, video_body, pluginManager), pluginManager)) { printf("\n Fatal : could not init GUI\n"); exit(-1); } delete [] sePlugins; ADM_lavInit(); AVDM_audioInit(); #if defined( USE_VDPAU) #if (ADM_UI_TYPE_BUILD!=ADM_UI_CLI) printf("Probing for VDPAU...\n"); if(vdpauProbe()==true) printf("VDPAU available\n"); else printf("VDPAU not available\n"); #else printf("Cannot use VDPAU in cli mode %d,%d\n",ADM_UI_TYPE_BUILD,ADM_UI_CLI); #endif #endif // Init jobs ADM_jobInit(); UI_RunApp(); cleanUp(); delete pluginManager; printf("Normal exit\n"); return 0; }