void LOCK_init(void) { struct FONT_Data* font; int ch; FONT_Init(); GLYPH_Init(); if (!(font = FONT_Load("Bitstream Vera Sans Mono", 18, 100))) errx(EXIT_FAILURE, "Failed to load font \"Arial\""); for (ch = ' '; ch <= '~'; ++ch) { struct FONT_Glyph* glyph; if (!(glyph = FONT_GlyphForCharacter(font, ch))) fprintf(stderr, "Failed to get glyph for '%d'", ch); GLYPH_Add(ch, glyph); free(glyph); } FONT_Free(font); GLYPH_UpdateTexture(); begin_lock = time(0); hide_hud = begin_lock + 60; }
BOOL engine_init(int w, int h) { engine = malloc(sizeof(engine_t)); memset(engine, 0, sizeof(engine_t)); engine->isRunning = YES; engine->renderHeight = h; engine->renderWidth = w; FS_Init(); RENDERER_Init(w, h); SCRIPTING_Init(); TEX_Init(); ENTITY_Init(); WORLD_Init(); FONT_Init(); SCRIPTING_AfterLoaded(); return YES; }
int Main (void) { static char szAppName[] = MAIN_NAME ; char *cFilePart ; // get installed path if (! SearchPath (NULL, MAIN_EXE, NULL, MSG_SIZE, InstallDir, &cFilePart)) { GetCurrentDirectory (MSG_SIZE, InstallDir) ; } // initialize system SYS_Init () ; // initialize coordinate TOOLBOX_InitCoord () ; // initialize font FONT_Init () ; // initialize telnet variables TELNET_Init () ; // initialize timeseal TIMESEAL_Init () ; // initialize history HISTORY_Init () ; // initialize script SCRIPT_Init () ; // initialize state STATE_Init () ; // initialize command COMMAND_Init () ; // initialize player PLAYER_Init () ; // initialize group GROUP_Init () ; // initialize arb ARB_Init () ; // initialize ini INI_Init () ; // initialize queue QUEUE_Init () ; // read from SETUP.TXT INI_ReadSys () ; // setup server address TIMESEAL_SetServerAddress () ; // create font FONT_Create () ; // connect TIMESEAL_Load () ; // load window coordinate TOOLBOX_LoadWindowCoord () ; // setup window title TOOLBOX_SetupWinTitle () ; // get message while (1) { IDLE_Proc () ; } // destroy font FONT_Destroy () ; // write into SETUP.TXT INI_WriteSys () ; // quit return 0; }
//void entrypoint( void ) int main( void ) { XEvent event; int done=0; WININFO *info = &wininfo; if( !smalloc_init() ) { #ifdef ERRORMSG printf( "window_init()!" ); #endif return( 1 ); } /* if( MessageBox( 0, "fullscreen?", info->wndclass, MB_YESNO|MB_ICONQUESTION)==IDYES ) info->full++; */ if( !window_init(info) ) { window_end( info ); #ifdef ERRORMSG printf( "window_init()!" ); #endif return( 2 ); } FONT_Init( (long)info->hDisplay ); if( !intro_init( XRES, YRES, 0, (int)info->hWnd ) ) { window_end( info ); #ifdef ERRORMSG printf( msg_error ); #endif return( 3 ); } while( !done ) { done = intro_do(); while( XPending(info->hDisplay) ) { XNextEvent( info->hDisplay, &event ); switch( event.type ) { case KeyPress: switch( XKeycodeToKeysym( info->hDisplay, event.xkey.keycode, 0 ) ) { case XK_Escape: done = 1; break; } break; case DestroyNotify: done = 1; break; } } glXSwapBuffers( info->hDisplay, info->hWnd ); } intro_end(); window_end( info ); smalloc_end(); return( 0 ); }