/** Initialize data structures. * This is called before the X connection is opened. */ void Initialize(void) { InitializeBackgrounds(); InitializeBorders(); InitializeClients(); InitializeClock(); InitializeColors(); InitializeCommands(); InitializeCursors(); InitializeDesktops(); #ifndef DISABLE_CONFIRM InitializeDialogs(); #endif InitializeDock(); InitializeFonts(); InitializeGroups(); InitializeHints(); InitializeIcons(); InitializeKeys(); InitializePager(); InitializePlacement(); InitializePopup(); InitializeRootMenu(); InitializeScreens(); InitializeSettings(); InitializeSwallow(); InitializeTaskBar(); InitializeTray(); InitializeTrayButtons(); }
void CGraphics::ReloadLost(){ CLog *pLog = CLog::Instance(); pLog->Log("Reloading sprite and fonts"); if(FAILED( D3DXCreateSprite(m_d3ddev, &m_pSprite)) ) { ::MessageBox(m_hWnd, "Failed to create a sprite!", "Fatal Error!", 0);//MB_OK | MB_ICONSTOP | MB_APPLMODAL); return; } InitializeFonts(); SetupStuff(); //lighting stuff m_d3ddev->SetRenderState(D3DRS_LIGHTING, true); D3DLIGHT9 dir; ::ZeroMemory(&dir, sizeof(dir)); dir.Type = D3DLIGHT_DIRECTIONAL; dir.Diffuse = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f); dir.Specular = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f) * 0.3f; dir.Ambient = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f) * 2.6f; dir.Direction = D3DXVECTOR3(0.0f, -100.0f, 0.0f); m_d3ddev->SetLight(0, &dir); m_d3ddev->LightEnable(0, true); m_d3ddev->SetRenderState(D3DRS_NORMALIZENORMALS, true); m_d3ddev->SetRenderState(D3DRS_SPECULARENABLE, true); }
BOOLEAN InitializeGame(void) { UINT32 uiIndex; giStartingMemValue = MemGetFree( ); ClearAllDebugTopics(); RegisterJA2DebugTopic( TOPIC_JA2OPPLIST, "Reg" ); //RegisterJA2DebugTopic( TOPIC_MEMORY_MANAGER, "Reg" ); // Initlaize mouse subsystems MSYS_Init( ); InitButtonSystem(); InitCursors( ); // Init Fonts if ( !InitializeFonts( ) ) { // Send debug message and quit DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "COULD NOT INUT FONT SYSTEM..."); return( ERROR_SCREEN ); } //Deletes all the Temp files in the Maps\Temp directory InitTacticalSave( TRUE ); // Initialize Game Screens. for (uiIndex = 0; uiIndex < MAX_SCREENS; uiIndex++) { if ((*(GameScreens[uiIndex].InitializeScreen))() == FALSE) { // Failed to initialize one of the screens. return FALSE; } } //Init the help screen system InitHelpScreenSystem(); //Loads the saved (if any) general JA2 game settings LoadGameSettings(); //Initialize the Game options ( Gun nut, scifi and dif. levels InitGameOptions(); // preload mapscreen graphics HandlePreloadOfMapGraphics( ); guiCurrentScreen = INIT_SCREEN; return TRUE; }
CFontManager::CFontManager() { Device.seqDeviceReset.Add(this,REG_PRIORITY_HIGH); m_all_fonts.push_back(&pFontMedium );// used cpp m_all_fonts.push_back(&pFontDI );// used cpp m_all_fonts.push_back(&pFontArial14 );// used xml m_all_fonts.push_back(&pFontGraffiti19Russian ); m_all_fonts.push_back(&pFontGraffiti22Russian ); m_all_fonts.push_back(&pFontLetterica16Russian ); m_all_fonts.push_back(&pFontLetterica18Russian ); m_all_fonts.push_back(&pFontGraffiti32Russian ); m_all_fonts.push_back(&pFontGraffiti50Russian ); m_all_fonts.push_back(&pFontLetterica25 ); m_all_fonts.push_back(&pFontStat ); FONTS_VEC_IT it = m_all_fonts.begin(); FONTS_VEC_IT it_e = m_all_fonts.end(); for(;it!=it_e;++it) (**it) = NULL; InitializeFonts(); }
void CFontManager::OnDeviceReset() { InitializeFonts(); }