void GameConfigKeys (unsigned int key, bool special, bool release, int x, int y) { if (release) return; switch (key) { case SDLK_q: Winsys.Quit (); break; case 27: Winsys.SetMode (g_game.prev_mode); break; case SDLK_TAB: if (curr_focus < 7) curr_focus++; else curr_focus = 0; break; case 13: switch (curr_focus) { case 6: Winsys.SetMode (g_game.prev_mode); break; case 7: SetConfig (); break; default: SetConfig (); break; } break; case 276: switch (curr_focus) { case 0: ToggleFullscreen (); break; case 1: ChangeRes (-1); break; case 2: ChangeMusVol (-1); break; case 3: ChangeSoundVol (-1); break; case 4: ChangeDetail (-1); break; case 5: ChangeLanguage (-1); break; } break; case 275: switch (curr_focus) { case 0: ToggleFullscreen (); break; case 1: ChangeRes (1); break; case 2: ChangeMusVol (1); break; case 3: ChangeSoundVol (1); break; case 4: ChangeDetail (1); break; case 5: ChangeLanguage (1); break; } break; case 273: if (curr_focus > 0) curr_focus--; break; case 274: if (curr_focus < 7) curr_focus++; break; } }
void MenuInit(void) { //int i;// yasirLiang add in20160603 unsigned char MenuLang; ByteDataGet(VAL_MENU_LANG,&MenuLang); if(MenuLang!=ENGLISH) { MenuLang = CHINESE; ByteDataSave(VAL_MENU_LANG,MenuLang); } else { ChangeLanguage(ENGLISH); } gPresetTmnSelPro.RunFlag = 0; gPresetTmnSelPro.Addr = FULL_VIEW_ADDR; gsnCurMGrp=0; ByteDataInit(); #if 0 sleep(1); clear_block(0,0,192,64); update_disp_data(0,0,192,64); DisplayGroup(gsnCurMGrp); #if 0 // yasir change in 2016-4-7 DisplayOneState(0,PPT_MODE); #else DisplayOneState(0,gByteData[VAL_DSCS_MODE]); #endif sleep(1); #endif }
void DoCdChange() { if (g_bChangingCD && (g_system->getMillis() > (g_lastTime + 1000))) { g_lastTime = g_system->getMillis(); _vm->_sound->closeSampleStream(); // Use the filesize of the sample file to determine, for Discworld 2, which CD it is if (TinselV2) { TinselFile f; if (!f.open(_vm->getSampleFile(g_sampleLanguage))) // No CD present return; char sampleCdNumber = (f.size() >= (200 * 1024 * 1024)) ? '1' : '2'; f.close(); if (g_currentCD != sampleCdNumber) return; } _vm->_sound->openSampleFiles(); ChangeLanguage(TextLanguage()); g_bChangingCD = false; } }
//***************************************************************************** // // Handles change notifications for the radio button widgets. // //***************************************************************************** void OnRadioChange(tWidget *pWidget, unsigned long bSelected) { // // Find the index of this radio button in the first group. // for(g_ulLangIdx = 0; g_ulLangIdx < NUM_RADIO1_BUTTONS; g_ulLangIdx++) { if(pWidget == (tWidget *)(g_psRadioButtons1 + g_ulLangIdx)) { break; } } // // Change any dynamic language strings. // ChangeLanguage(g_pLanguageTable[g_ulLangIdx].usLanguage); // // Issue the initial paint request to the widgets. // WidgetPaint(WIDGET_ROOT); // // Play the key click sound. // SoundPlay(g_pusKeyClick, sizeof(g_pusKeyClick) / 2); }
bool MainApp::OnInit() { Settings settings = SettingsLoadFromFile(); SettingsSetNewValues(settings); ChangeLanguage(settings.language); wxString cmdFilename = wxT(""); wxCmdLineParser cmdParser(g_cmdLineDesc, argc, argv); int res; { wxLogNull log; // Pass false to suppress auto Usage() message res = cmdParser.Parse(false); } // Check if the user asked for command-line help if (res == -1 || res > 0 || cmdParser.Found(wxT("h"))) { cmdParser.Usage(); return false; } // Check if the user asked for the version if (cmdParser.Found(wxT("v"))) { #ifndef __WXMSW__ wxLog::SetActiveTarget(new wxLogStderr); #endif wxString msg = wxT(""); msg << wxT(APP_NAME) << wxT(" ") << wxT(APP_VERSION); wxLogMessage(wxT("%s"), msg.c_str()); return false; } // Check for a filename if (cmdParser.GetParamCount() > 0) { cmdFilename = cmdParser.GetParam(0); // Under Windows when invoking via a document // in Explorer, we are passed the short form. // So normalize and make the long form. wxFileName fName(cmdFilename); fName.Normalize(wxPATH_NORM_LONG|wxPATH_NORM_DOTS|wxPATH_NORM_TILDE|wxPATH_NORM_ABSOLUTE); cmdFilename = fName.GetFullPath(); } // create the MainFrame frame = new MainFrame(cmdFilename); frame->Centre(); frame->Show(true); // Our MainFrame is the Top Window SetTopWindow(frame); // initialization should always succeed return true; }
void ChangeConfigSelection (int focus, int dir) { if (dir == 0) { switch (focus) { case 1: ChangeRes (1); break; case 2: ChangeMusVol (1); break; case 3: ChangeSoundVol (1); break; case 4: ChangeDetail (1); break; case 5: ChangeLanguage (-1); break; } } else { switch (focus) { case 1: ChangeRes (-1); break; case 2: ChangeMusVol (-1); break; case 3: ChangeSoundVol (-1); break; case 4: ChangeDetail (-1); break; case 5: ChangeLanguage (1); break; } } }
void CEditLanguageDialog::OnMenuEvent( wxCommandEvent& event ) { int id = event.GetId(); if (id == ID_POPMENU_CHANGE) { if (m_selectRow != -1) { m_pButtonAdd->SetLabel(m_bISLanguageSwitch ? CLanguageManager::GetInstance()->GetText(eL_Save) : _T("Save")); ChangeLanguage(); m_bIsChange = true; m_bIsSave = true; } } else if (id == ID_POPMENU_DLE) { DleLanguage(); AppendDataViewListCtrl(); } }
MainWindow::MainWindow(QApplication* a,QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); this->app = a; lang = new Language(app); if(!lang) return; connect(ui->pushButton_quit,SIGNAL(clicked()),this,SLOT(close())); connect(ui->pushButton_dialog,SIGNAL(clicked()),this,SLOT(OpenDialog())); QList<QRadioButton*> list = ui->groupBox->findChildren<QRadioButton*>(); for(int i=0;i<list.size();i++) { QRadioButton* rb = list.at(i); connect(rb,SIGNAL(clicked()),this,SLOT(ChangeLanguage())); } lang->ChangeLanguage("suomi.qm"); ui->retranslateUi(this); std::clog<<"Window opened"<<std::endl; }
//***************************************************************************** // // Handles change notifications for the radio button widgets. // //***************************************************************************** void OnRadioChange(tWidget *psWidget, uint32_t bSelected) { // // Find the index of this radio button in the first group. // for(g_ui32LangIdx = 0; g_ui32LangIdx < NUM_RADIO1_BUTTONS; g_ui32LangIdx++) { if(psWidget == (tWidget *)(g_psRadioButtons1 + g_ui32LangIdx)) { break; } } // // Change any dynamic language strings. // ChangeLanguage(g_psLanguageTable[g_ui32LangIdx].ui16Language); // // Issue the initial paint request to the widgets. // WidgetPaint(WIDGET_ROOT); }
int Zword_01::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QMainWindow::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: Translate(); break; case 1: Translate((*reinterpret_cast< QModelIndex(*)>(_a[1]))); break; case 2: ChangeLanguage((*reinterpret_cast< QModelIndex(*)>(_a[1]))); break; case 3: ReadAppConfig(); break; case 4: WriteAppConfig(); break; case 5: OnAddNewWord(); break; case 6: OnListLang(); break; case 7: OnShowFrameAddLang(); break; case 8: OnCreateNewLang(); break; case 9: OnAddNewWordExecute1(); break; case 10: OnAddNewWordExecute2(); break; case 11: OnAddNewWordClose(); break; case 12: OnAddNewLangClose(); break; case 13: OnListLangClose(); break; case 14: OnAppSetting(); break; case 15: OnSettingClose(); break; case 16: OnChangeStyle((*reinterpret_cast< QModelIndex(*)>(_a[1]))); break; case 17: OnCBAlwaysOnTop((*reinterpret_cast< int(*)>(_a[1]))); break; case 18: OnCBMonitorClipBoard((*reinterpret_cast< int(*)>(_a[1]))); break; case 19: OnClipBoardChanged(); break; case 20: OnTransparancyChanged((*reinterpret_cast< int(*)>(_a[1]))); break; case 21: closeEvent((*reinterpret_cast< QCloseEvent*(*)>(_a[1]))); break; case 22: OnDictDel(); break; default: ; } _id -= 23; } return _id; }
void Application::Initialize(Framework *fw) { framework = fw; QDir dir("data/translations/qt_native_translations"); QStringList qmFiles = FindQmFiles(dir); // Search then that is there corresponding native translations for system locals. QString loc = QLocale::system().name(); loc.chop(3); QString name = "data/translations/qt_native_translations/qt_" + loc + ".qm"; QStringList lst = qmFiles.filter(name); if (!lst.empty() ) nativeTranslator->load(lst[0]); this->installTranslator(nativeTranslator); QString defaultLanguage = framework->Config()->DeclareSetting(ConfigAPI::FILE_FRAMEWORK, ConfigAPI::SECTION_FRAMEWORK, "language", "data/translations/tundra_en").toString(); ChangeLanguage(defaultLanguage); ReadTargetFpsLimitFromConfig(); }
/***************************************** * Main program * *****************************************/ int main() { int quit = 0, i; struct IntuiMessage *msg; struct Gadget *button; struct StringInfo *strinfo; char buf[257]; UWORD koodi, msgID; ULONG classi, number; APTR address; ULONG CycleTags[3]; CycleTags[0] = GTCY_Active; CycleTags[1] = (ULONG) & number; CycleTags[2] = TAG_DONE; /* Read UAE configuration */ i = GetUaeConfig(&config); i = setup_window(); if (i == 0) { quit_program(1, "Cannot setup a window!"); return 1; } while (quit == 0) { WaitPort(window->UserPort); while (msg = (struct IntuiMessage *) GT_GetIMsg(window->UserPort)) { classi = msg->Class; koodi = msg->Code; address = msg->IAddress; if (classi == IDCMP_GADGETUP) { msgID = ((struct Gadget *) msg->IAddress)->GadgetID; button = (struct Gadget *) msg->IAddress; if (button->SpecialInfo) { strinfo = (struct StringInfo *) button->SpecialInfo; } } else msgID = msg->Code; GT_ReplyIMsg((struct IntuiMessage *) msg); switch (classi) { case IDCMP_CLOSEWINDOW: quit = 1; break; case IDCMP_GADGETUP: switch (msgID) { case GAD_EXITEMU: ExitEmu(); break; case GAD_EJECT_DF0: EjectDisk(0); Delay(30); GetUaeConfig(&config); print_drive_status(); break; case GAD_EJECT_DF1: EjectDisk(1); Delay(30); GetUaeConfig(&config); print_drive_status(); break; case GAD_EJECT_DF2: EjectDisk(2); Delay(30); GetUaeConfig(&config); print_drive_status(); break; case GAD_EJECT_DF3: EjectDisk(3); Delay(30); GetUaeConfig(&config); print_drive_status(); break; case GAD_SOUND: if (config.do_output_sound) DisableSound(); else EnableSound(); Delay(30); GetUaeConfig(&config); break; case GAD_JOYSTICK: if (config.do_fake_joystick) DisableJoystick(); else EnableJoystick(); Delay(30); GetUaeConfig(&config); break; case GAD_FRAMERATE: SetFrameRate(strinfo->LongInt); Delay(30); GetUaeConfig(&config); break; case GAD_INSERT_DF0: strcpy(buf, config.df0_name); if (get_string(buf, 255)) { InsertDisk((UBYTE *) buf, 0); Delay(30); GetUaeConfig(&config); print_drive_status(); } break; case GAD_INSERT_DF1: strcpy(buf, config.df1_name); if (get_string(buf, 255)) { InsertDisk((UBYTE *) buf, 1); Delay(30); GetUaeConfig(&config); print_drive_status(); } break; case GAD_INSERT_DF2: strcpy(buf, config.df2_name); if (get_string(buf, 255)) { InsertDisk((UBYTE *) buf, 2); Delay(30); GetUaeConfig(&config); print_drive_status(); } break; case GAD_INSERT_DF3: strcpy(buf, config.df3_name); if (get_string(buf, 255)) { InsertDisk((UBYTE *) buf, 3); Delay(30); GetUaeConfig(&config); print_drive_status(); } break; case GAD_LANGUAGE: number = config.keyboard; number++; if (number == 5) number = 0; ChangeLanguage(number); Delay(30); GetUaeConfig(&config); break; case GAD_RESET: ColdReboot(); break; case GAD_DEBUG: DebugFunc(); break; default: break; } break; default: break; } } } quit_program(0, ""); return (0); }
//***************************************************************************** // // A simple demonstration of the features of the TivaWare Graphics Library. // //***************************************************************************** int main(void) { tContext sContext; uint32_t ui32SysClock; // // Run from the PLL at 120 MHz. // ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000); // // Configure the device pins. // PinoutSet(); // // Initialize the display driver. // Kentec320x240x16_SSD2119Init(ui32SysClock); // // Set graphics library text rendering defaults. // GrLibInit(&GRLIB_INIT_STRUCT); // // Set the string table and the default language. // GrStringTableSet(STRING_TABLE); // // Set the default language. // ChangeLanguage(GrLangEnUS); // // Initialize the graphics context. // GrContextInit(&sContext, &g_sKentec320x240x16_SSD2119); // // Draw the application frame. // FrameDraw(&sContext, "lang-demo"); // // Load the static strings from the string table. These strings are // independent of the language in use but we store them in the string // table nonetheless since (a) we may be using codepage remapping in // which case it would be difficult to hardcode them into the app source // anyway (ASCII or ISO8859-1 text would not render properly with the // remapped custom font) and (b) even if we're not using codepage remapping, // we may have generated a custom font from the string table output and // we want to make sure that all glyphs required by the application are // present in that font. If we hardcode some text in the application // source and don't put it in the string table, we run the risk of having // characters missing in the font. // GrStringGet(STR_ENGLISH, g_pcEnglish, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_DEUTSCH, g_pcDeutsch, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_ESPANOL, g_pcEspanol, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_ITALIANO, g_pcItaliano, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_CHINESE, g_pcChinese, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_KOREAN, g_pcKorean, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_JAPANESE, g_pcJapanese, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_PLUS, g_pcPlus, 2); GrStringGet(STR_MINUS, g_pcMinus, 2); // // Initialize the touch screen driver and have it route its messages to the // widget tree. // TouchScreenInit(ui32SysClock); TouchScreenCallbackSet(WidgetPointerMessage); // // Add the title block and the previous and next buttons to the widget // tree. // WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sPrevious); WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sTitle); WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sNext); // // Add the first panel to the widget tree. // g_ui32Panel = 0; WidgetAdd(WIDGET_ROOT, (tWidget *)g_psPanels); // // Set the string for the title. // CanvasTextSet(&g_sTitle, g_pcTitle); // // Issue the initial paint request to the widgets. // WidgetPaint(WIDGET_ROOT); // // Loop forever, processing widget messages. // while(1) { // // Process any messages in the widget message queue. // WidgetMessageQueueProcess(); } }
/************************************ * Main program * ************************************/ int32_t main() { int32_t quit = 0,i, correct,number; char buf[257]; char *langs[]={ "US\0","DE\0","SE\0","FR\0","IT\0", }; /* Read UAE configuration */ i = GetUaeConfig( &config ); while( quit == 0 ) { printf(" UAE-Control v0.1\n\n"); printf(" 1) Reset\n"); printf(" 2) Debug\n"); printf(" 3) Exit Emulator\n"); printf(" 4) Change framerate (Currently : %ld)\n", config.framerate); printf(" 5) Toggle sound (Currently : %s)\n", config.do_output_sound ? "ON" : "OFF"); printf(" 6) Toggle fake joystick (Currently : %s)\n", config.do_fake_joystick ? "ON" : "OFF"); printf(" 7) Change language (Currently : %s)\n", langs[config.keyboard]); printf(" 8) Eject a disk\n"); printf(" 9) Insert a disk\n"); printf("10) Exit UAE-Control\n\n"); correct = 0; while( correct == 0 ) { printf(" Command : "); gets( buf ); i = atoi( buf ); if ((i > 0) && (i < 11)) correct = 1; } switch( i ) { case 1: HardReset(); break; case 2: DebugFunc(); break; case 3: ExitEmu(); break; case 4: printf(" Enter new framerate (1-20) :"); gets( buf ); number = atoi( buf ); if (SetFrameRate (number)) GetUaeConfig(&config); else printf(" Illegal value, not changed.\n"); break; case 5: if (config.do_output_sound) DisableSound(); else EnableSound(); GetUaeConfig( &config ); break; case 6: if (config.do_fake_joystick) DisableJoystick(); else EnableJoystick(); GetUaeConfig( &config ); break; case 7: printf(" 1 = US, 2 = DE, 3 = SE, 4 = FR, 5 = IT\n"); printf(" What will it be : "); gets( buf ); number = atoi( buf ); if ((number >= 1) && (number <= 5)) { ChangeLanguage( number-1 ); GetUaeConfig( &config ); } else { printf(" Illegal value, not changed.\n"); } break; case 8: print_drive_status(); printf(" Eject which drive (1-4): "); gets( buf ); number = atoi( buf ); if ((number >= 1) && (number <=4 )) { EjectDisk( number-1 ); GetUaeConfig( &config ); } else { printf(" Illegal drive, not changed.\n"); } break; case 9: print_drive_status(); printf(" Enter disk to drive (1-4): "); gets( buf ); number = atoi( buf ); if ((number >= 1) && (number <= 4)) { printf("Name of diskfile :"); gets( buf ); InsertDisk( (UBYTE *)&buf, number - 1 ); GetUaeConfig( &config ); } else { printf(" Illegal drive, not changed.\n"); } break; case 10: quit = 1; break; } } quit_program(0, ""); return(0); }
void ItemSelected(short snMGSeq) { TMenu *pMenu; short usNew; //unsigned char Index;// yasirliang change in 20160603 // int i; // yasirliang change in 20160603 unsigned char MenuLang; ByteDataGet(VAL_MENU_LANG,&MenuLang); usNew = snMGSeq; if(gMG[snMGSeq].Type==ST_CMN) //普通菜单项 { pMenu = gMG[snMGSeq].FirstItem + gMG[snMGSeq].Position; if(pMenu->Type == MT_MENU) { if(pMenu->Link!=MGS_NONE) { usNew = pMenu->Link; if(gMG[snMGSeq].Level > gMG[usNew].Level) gMG[snMGSeq].Position = 0; } if(pMenu->fpMenuDo != NULL) pMenu->fpMenuDo(0); //pMenu->fpMenuDo(NULL); } else if(pMenu->Type == MT_SWITCH) //语言切换 { if(MenuLang == CHINESE) ChangeLanguage(ENGLISH); else ChangeLanguage(CHINESE); usNew = 0; gMG[usNew].Position = 0; } else if((pMenu->Type==MT_YESNO)||(pMenu->Type==MT_ONOFF)) //不跳转,直接改变值 { gMG[snMGSeq].ss.BitState ^= (1<<gMG[snMGSeq].Position); if(pMenu->fpMenuDo != NULL) pMenu->fpMenuDo(gMG[snMGSeq].ss.BitState&(1<<gMG[snMGSeq].Position)); DisplayMItem(gMG+snMGSeq,gMG[snMGSeq].Position%3,gMG[snMGSeq].Position,MD_REVERSE); return; } else { // 记录当前页 if((gsnCurMGrp==0)&&(pMenu->Link!=0)) { UseDisSet(CPT_USE,BOOL_TRUE); } gsnCurMGrp = pMenu->Link; //DEBUG_INFO("gsnCurMGrp=%d,gMG[gsnCurMGrp].Position=%d\n",gsnCurMGrp,gMG[gsnCurMGrp].Position); DisplayMItem(gMG+gsnCurMGrp,-1,gMG[gsnCurMGrp].Position,MD_NORMAL); if(ENGLISH==MenuLang) { clear_block(0,10,191,39); update_disp_data(0,10,191,39); } else { clear_block(0,16,118,63); update_disp_data(0,16,118,63); } RenewMenuValue(pMenu->Link,0); MenuScroll(pMenu->Link,0); return; } } else { usNew = gMG[snMGSeq].Count; //DEBUG_INFO("snMGSeq=%d,usNew=%d\n",snMGSeq,usNew); if(gMG[snMGSeq].Type==ST_VALUE) { SendMainState(0,NULL,0); } else if(gMG[snMGSeq].Type==ST_MODE) { pMenu = gMG[usNew].FirstItem + gMG[usNew].Position; if(pMenu->fpMenuDo!=NULL) { pMenu->fpMenuDo(gMG[snMGSeq].Position); } DisplayOneState(0,gMG[snMGSeq].Position); SendMainState(0,NULL,0); } } DisplayGroup(usNew); // 显示当前页 // DisplayGroup(usNew); // 记录当前页 if((usNew==0)&&(gsnCurMGrp>0)) { UseDisSet(CPT_USE,BOOL_FALSE); } else if((gsnCurMGrp==0)&&(usNew>0)) { UseDisSet(CPT_USE,BOOL_TRUE); } gsnCurMGrp = usNew; }
/* ---------------------------------------------------------------------- TtaSetAttributeText Changes the value of an attribute of type text. Parameters: attribute: the attribute to be modified. buffer: character string representing the new value of the attribute. element: the element with which the attribute is associated, NULL if the attribute is not yet associated with an element. document: the document to which the element belongs. Must be 0 if element is NULL. ---------------------------------------------------------------------- */ void TtaSetAttributeText (Attribute attribute, const char* buffer, Element element, Document document) { int lg; PtrAttribute pAttr; #ifndef NODISPLAY PtrAttribute pPrevAttr, pA; #endif /* NODISPLAY */ Language lang; UserErrorCode = 0; pAttr = (PtrAttribute) attribute; if (pAttr == NULL) TtaError (ERR_invalid_parameter); else if (pAttr->AeAttrType != AtTextAttr) TtaError (ERR_invalid_attribute_type); else if (AttrOfElement (attribute, element)) { #ifndef NODISPLAY if (element != NULL) { /* detach temporarily attribute from element */ pPrevAttr = NULL; pA = ((PtrElement) element)->ElFirstAttr; while (pA && pA != pAttr) { pPrevAttr = pA; pA = pA->AeNext; } if (pA) { if (pPrevAttr) pPrevAttr->AeNext = pA->AeNext; else ((PtrElement) element)->ElFirstAttr = pA->AeNext; } /* de-apply all presentation rules related to the attribute */ UndisplayInheritedAttributes ((PtrElement) element, pAttr, document, TRUE); /* reattach attribute to element */ if (pA) { if (pPrevAttr) pPrevAttr->AeNext = pAttr; else ((PtrElement) element)->ElFirstAttr = pAttr; } } #endif if (pAttr->AeAttrText == NULL) GetTextBuffer (&pAttr->AeAttrText); else ClearText (pAttr->AeAttrText); /* Sets the new value */ CopyStringToBuffer ((unsigned char *)buffer, pAttr->AeAttrText, &lg); if (pAttr->AeAttrNum == 1) /* language attribute */ { lang = TtaGetLanguageIdFromName (buffer); #ifdef NODISPLAY ChangeLanguageLeaves((PtrElement) element, lang); #else ChangeLanguage (LoadedDocument[document - 1], (PtrElement) element, lang, FALSE); #endif } #ifndef NODISPLAY if (element != NULL) DisplayAttribute ((PtrElement) element, pAttr, document); #endif } }
Common::Error TinselEngine::run() { // Initialize backend if (getGameID() == GID_DW2) { #ifndef DW2_EXACT_SIZE initGraphics(640, 480, true); #else initGraphics(640, 432, true); #endif _screenSurface.create(640, 432, 1); } else { initGraphics(320, 200, false); _screenSurface.create(320, 200, 1); } g_system->getEventManager()->registerRandomSource(_random, "tinsel"); _console = new Console(); _scheduler = new Scheduler(); InitSysVars(); // init memory manager MemoryInit(); // load user configuration ReadConfig(); #if 1 // FIXME: The following is taken from RestartGame(). // It may have to be adjusted a bit CountOut = 1; RebootCursor(); RebootDeadTags(); RebootMovers(); resetUserEventTime(); RebootTimers(); RebootScalingReels(); DelayedScene.scene = HookScene.scene = 0; #endif // Load in text strings ChangeLanguage(g_language); // Init palette and object managers, scheduler, keyboard and mouse RestartDrivers(); // load in graphics info SetupHandleTable(); // Actors, globals and inventory icons LoadBasicChunks(); // Continuous game processes CreateConstProcesses(); // allow game to run in the background //RestartBackgroundProcess(); // FIXME: is this still needed? //dumpMusic(); // dumps all of the game's music in external XMIDI files // Load game from specified slot, if any // // TODO: We might want to think about properly taking care of possible // errors when loading the save state. if (ConfMan.hasKey("save_slot")) { if (loadGameState(ConfMan.getInt("save_slot")) == Common::kNoError) loadingFromGMM = true; } // Foreground loop uint32 timerVal = 0; while (!shouldQuit()) { assert(_console); if (_console->isAttached()) _console->onFrame(); // Check for time to do next game cycle if ((g_system->getMillis() > timerVal + GAME_FRAME_DELAY)) { timerVal = g_system->getMillis(); AudioCD.updateCD(); NextGameCycle(); } if (bRestart) { RestartGame(); bRestart = false; bHasRestarted = true; // Set restarted flag } // Save/Restore scene file transfers ProcessSRQueue(); // Handle any playing movie FettleBMV(); #ifdef DEBUG if (bFast) continue; // run flat-out #endif // Loop processing events while there are any pending while (pollEvent()) ; DoCdChange(); if (MoviePlaying() && NextMovieTime()) g_system->delayMillis(MAX<int>(NextMovieTime() - g_system->getMillis() + MovieAudioLag(), 0)); else g_system->delayMillis(10); } // Write configuration WriteConfig(); return Common::kNoError; }
//***************************************************************************** // // A simple demonstration of the features of the Stellaris Graphics Library. // //***************************************************************************** int main(void) { tContext sContext; tRectangle sRect; // // If running on Rev A2 silicon, turn the LDO voltage up to 2.75V. This is // a workaround to allow the PLL to operate reliably. // if(REVISION_IS_A2) { SysCtlLDOSet(SYSCTL_LDO_2_75V); } // // Set the clocking to run from the PLL. // SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ); // // Initialize the display driver. // Kitronix320x240x16_SSD2119Init(); // // Turn on the backlight. // Kitronix320x240x16_SSD2119BacklightOn(255); // // Set graphics library text rendering defaults. // GrLibInit(&GRLIB_INIT_STRUCT); // // Set the string table and the default language. // GrStringTableSet(STRING_TABLE); // // Set the default language. // ChangeLanguage(GrLangEnUS); // // Initialize the graphics context. // GrContextInit(&sContext, &g_sKitronix320x240x16_SSD2119); // // Fill the top 26 rows of the screen with blue to create the banner. // sRect.sXMin = 0; sRect.sYMin = 0; sRect.sXMax = GrContextDpyWidthGet(&sContext) - 1; sRect.sYMax = 25; GrContextForegroundSet(&sContext, ClrDarkBlue); GrRectFill(&sContext, &sRect); // // Put a white box around the banner. // GrContextForegroundSet(&sContext, ClrWhite); GrRectDraw(&sContext, &sRect); // // Load the static strings from the string table. These strings are // independent of the language in use but we store them in the string // table nonetheless since (a) we may be using codepage remapping in // which case it would be difficult to hardcode them into the app source // anyway (ASCII or ISO8859-1 text would not render properly with the // remapped custom font) and (b) even if we're not using codepage remapping, // we may have generated a custom font from the string table output and // we want to make sure that all glyphs required by the application are // present in that font. If we hardcode some text in the application // source and don't put it in the string table, we run the risk of having // characters missing in the font. // GrStringGet(STR_ENGLISH, g_pcEnglish, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_DEUTSCH, g_pcDeutsch, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_ESPANOL, g_pcEspanol, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_ITALIANO, g_pcItaliano, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_CHINESE, g_pcChinese, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_KOREAN, g_pcKorean, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_JAPANESE, g_pcJapanese, MAX_LANGUAGE_NAME_LEN); GrStringGet(STR_PLUS, g_pcPlus, 2); GrStringGet(STR_MINUS, g_pcMinus, 2); // // Put the application name in the middle of the banner. // GrStringGet(STR_APPNAME, g_pcBuffer, SCOMP_MAX_STRLEN); GrContextFontSet(&sContext, FONT_20PT); GrStringDrawCentered(&sContext, g_pcBuffer, -1, GrContextDpyWidthGet(&sContext) / 2, 10, 0); // // Initialize the sound driver. // SoundInit(); // // Initialize the touch screen driver and have it route its messages to the // widget tree. // TouchScreenInit(); TouchScreenCallbackSet(WidgetPointerMessage); // // Add the title block and the previous and next buttons to the widget // tree. // WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sPrevious); WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sTitle); WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sNext); // // Add the first panel to the widget tree. // g_ulPanel = 0; WidgetAdd(WIDGET_ROOT, (tWidget *)g_psPanels); // // Set the string for the title. // CanvasTextSet(&g_sTitle, g_pcTitle); // // Initialize the pointer to the button text. // PushButtonTextSet(&g_sFirmwareUpdateBtn, g_pcUpdateButton); // // Issue the initial paint request to the widgets. // WidgetPaint(WIDGET_ROOT); // // Loop forever unless we receive a signal that a firmware update has been // requested. // while(!g_bFirmwareUpdate) { // // Process any messages in the widget message queue. // WidgetMessageQueueProcess(); } // // If we drop out, a firmware update request has been made. We call // WidgetMessageQueueProcess once more to ensure that any final messages // are processed then jump into the bootloader. // WidgetMessageQueueProcess(); // // Wait a while for the last keyboard click sound to finish. This is about // 500mS since the delay loop is 3 cycles long. // SysCtlDelay(SysCtlClockGet() / 6); // // Pass control to the bootloader. // JumpToBootLoader(); // // The boot loader should take control, so this should never be reached. // Just in case, loop forever. // while(1) { } }