MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { showFullScreen(); startInfo = new StartDialog(this); testArea = new TestEnv(numTargets,200,20,this); QObject::connect(testArea, SIGNAL(emitHit(const int&)), this, SLOT(setRem(const int&))); QObject::connect(testArea, SIGNAL(emitError(const int&)), this, SLOT(setErr(const int&))); QObject::connect(testArea, SIGNAL(emitFinish()), this, SLOT(startTests())); QObject::connect(testArea, SIGNAL(retResults(const int&, const int&, const double&)), this, SLOT(saveResults(const int&, const int&, const double&))); testArea2 = new TestEnv(numTargets,200,20,this); QObject::connect(testArea2, SIGNAL(emitHit(const int&)), this, SLOT(setRem(const int&))); QObject::connect(testArea2, SIGNAL(emitError(const int&)), this, SLOT(setErr(const int&))); QObject::connect(testArea2, SIGNAL(emitFinish()), this, SLOT(startTests())); QObject::connect(testArea2, SIGNAL(retResults(const int&, const int&, const double&)), this, SLOT(saveResults(const int&, const int&, const double&))); QHBoxLayout *layout = new QHBoxLayout(); layout->addWidget(testArea); layout->addWidget(testArea2); QWidget *temp = new QWidget(); temp->setLayout(layout); setCentralWidget(temp); createDock(); getInfo(); loadCursors(); displayInformation(); startTests(); }
Events::Events(SherlockEngine *vm): _vm(vm) { _cursorImages = nullptr; _cursorId = INVALID_CURSOR; _frameCounter = 1; _priorFrameTime = 0; _mouseButtons = 0; _pressed = _released = false; _rightPressed = _rightReleased = false; _oldButtons = _oldRightButton = false; if (_vm->_interactiveFl) loadCursors("rmouse.vgs"); }
Common::Error PinkEngine::init() { debugC(10, kPinkDebugGeneral, "PinkEngine init"); initGraphics(640, 480); Common::PEResources exeResources; Common::String fileName = isPeril() ? "pptp.exe" : "hpp.exe"; if (!exeResources.loadFromEXE(fileName)) { return Common::kNoGameDataFoundError; } _console = new Console(this); _director = new Director(); initMenu(exeResources); Common::String orbName; Common::String broName; if (isPeril()) { orbName = "PPTP.ORB"; broName = "PPTP.BRO"; _bro = new BroFile; } else { orbName = "HPP.ORB"; } if (!_orb.open(orbName) || (_bro && !_bro->open(broName) && _orb.getTimestamp() == _bro->getTimestamp())) return Common::kNoGameDataFoundError; if (!loadCursors(exeResources)) return Common::kNoGameDataFoundError; setCursor(kLoadingCursor); _orb.loadGame(this); debugC(6, kPinkDebugGeneral, "Modules are loaded"); syncSoundSettings(); if (ConfMan.hasKey("save_slot")) loadGameState(ConfMan.getInt("save_slot")); else initModule(_modules[0]->getName(), "", nullptr); return Common::kNoError; }
void OSScreenManager::setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) { assert(bpp == 16); destroyFrontAndBackBuffers(); _directDrawManager.initVideo(width, height, bpp, numBackSurfaces); _vm->_screen->create(width, height, g_system->getScreenFormat()); _frontRenderSurface = new OSVideoSurface(this, nullptr); _frontRenderSurface->setSurface(this, _directDrawManager._mainSurface); _backSurfaces.resize(numBackSurfaces); for (uint idx = 0; idx < numBackSurfaces; ++idx) { _backSurfaces[idx]._surface = new OSVideoSurface(this, nullptr); _backSurfaces[idx]._surface->setSurface(this, _directDrawManager._backSurfaces[idx]); } // Load fonts _fonts[0].load(149); _fonts[1].load(151); _fonts[2].load(152); _fonts[3].load(153); // Load the cursors loadCursors(); }
int main(int argc, char **argv) { vresource rootRes; spreadStruct *spreadSheet; /* startup Galaxy */ vstartup(argc, argv); /* create the spreadsheet structure */ spreadSheet = (spreadStruct *) vmemAlloc(sizeof(spreadStruct)); /* create the various subclasses */ createSpreadsheetClasses(); /* get the root resource */ rootRes = vapplicationGetResources(vapplicationGetCurrent()); /* load the spreadsheet dialog */ loadSpreadsheetDialog(spreadSheet, rootRes); /* load the various popup dialogs */ loadPopupDialogs(spreadSheet, rootRes); /* load the cursors */ loadCursors(spreadSheet, rootRes); /* create the custom number formats */ createNumFormats(); /* load the spreadsheet data */ loadSpreadsheetData(spreadSheet); /* open the spreadsheet */ openSpreadsheet(spreadSheet); /* setup the visible portions of the spreadsheet */ setupVisible(spreadSheet, 1); /* enter the event loop */ veventProcess(); /* free the spreadsheet dialog resources */ unloadSpreadsheetDialog(spreadSheet); /* free the popup dialog resources */ unloadPopupDialogs(spreadSheet); /* free the cursor resources */ unloadCursors(spreadSheet); /* destroy the custom number formats */ destroyNumFormats(); /* destroy the various subclasses */ destroySpreadsheetClasses(); /* free the memory used by the spreadsheet structure */ if (spreadSheet != NULL) vmemFree(spreadSheet); /* exit the program */ exit(EXIT_SUCCESS); return(EXIT_FAILURE); }
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR, int nCmdShow) { MSG msg; WNDCLASS wndclass, wndclass2; RECT windRECT; HINSTANCE boeSoundsDLL; wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_BYTEALIGNWINDOW; wndclass.lpfnWndProc = WndProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = hInstance; wndclass.hIcon = LoadIcon(hInstance,MAKEINTRESOURCE(10)); wndclass.hCursor = NULL; wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); wndclass.lpszMenuName = MAKEINTRESOURCE(1); wndclass.lpszClassName = szAppName; RegisterClass(&wndclass); wndclass2.style = CS_HREDRAW | CS_VREDRAW | CS_BYTEALIGNWINDOW; wndclass2.lpfnWndProc = WndProc; wndclass2.cbClsExtra = 0; wndclass2.cbWndExtra = 0; wndclass2.hInstance = hInstance; wndclass2.hIcon = LoadIcon(hInstance,MAKEINTRESOURCE(10)); wndclass2.hCursor = NULL; wndclass2.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); wndclass2.lpszMenuName = NULL; wndclass2.lpszClassName = szWinName; RegisterClass(&wndclass2); mainPtr = CreateWindow (szAppName, "Classic Blades of Exile", WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, 0, 0, 588, 478, NULL, NULL, hInstance, NULL); if (!hPrevInstance) { // initialize Get_Path(file_path_name); store_hInstance = hInstance; accel = LoadAccelerators(hInstance, MAKEINTRESOURCE(1)); boeSoundsDLL = LoadLibrary("./boesounds.dll"); if (!boeSoundsDLL) { MessageBox(mainPtr, "BOESOUNDS.DLL not found", "Error", MB_OK | MB_ICONEXCLAMATION); return (-1); } load_sounds(boeSoundsDLL); loadFonts(); loadCursors(); SetCursor(sword_curs); current_cursor = 124; /* cursors loaded */ data_store = new piles_of_stuff_dumping_type; data_store3 = new piles_of_stuff_dumping_type3; data_store4 = new piles_of_stuff_dumping_type4; data_store5 = new piles_of_stuff_dumping_type5; scen_item_list = new scen_item_data_type; srand(GetCurrentTime()); get_reg_data(); if (display_mode != 5) max_window(mainPtr); else { GetWindowRect(GetDesktopWindow(),&windRECT); MoveWindow(mainPtr,(windRECT.right - (588 + 10)) / 2, (windRECT.bottom - (425 + 52)) / 2 , 588 + 10,425 + 52,true); } shop_sbar = CreateWindow("scrollbar",NULL, WS_CHILD | WS_TABSTOP | SBS_VERT, shop_sbar_rect.left,shop_sbar_rect.top,shop_sbar_rect.right,shop_sbar_rect.bottom, mainPtr,(HMENU) 3, store_hInstance,NULL); lpsi.fMask = SIF_RANGE; lpsi.nMax = 16; SetScrollInfo(shop_sbar,SB_CTL,&lpsi,false); // SetScrollRange(shop_sbar,SB_CTL,0,16,false); ShowWindow(mainPtr, nCmdShow); plop_fancy_startup(); init_screen_locs(); FlushEvents(2); SetTimer(mainPtr,1,620,NULL); SetTimer(mainPtr,2,200,NULL); file_initialize(); if (GetDeviceCaps(main_dc,BITSPIXEL) * GetDeviceCaps(main_dc,PLANES) < 8) { MessageBox(mainPtr,"Blades of Exile is designed for 256 colors. The current graphics device is set for less. Exile 3 is playable with less colors, but will look somewhat odd." , "Not 256 colors!",MB_OK | MB_ICONEXCLAMATION); MessageBox(mainPtr,"For tips on how to get 256 colors, hit F1 for help, and then select 'Getting 256 Colors' from the table of contents." , "Not 256 colors!",MB_OK | MB_ICONEXCLAMATION); } menu_activate(0); cursor_stay(); showcursor(true); reset_text_bar(); adjust_window_mode(); cd_init_dialogs(); if (game_run_before == false) { FCD(986,0); WritePrivateProfileString("Blades of Exile", "game_run_before", "1", "./blades.ini"); } else if (give_intro_hint == true) tip_of_day(); } event_handled = false; while(GetMessage(&msg,NULL,0,0)) { if (event_handled == false) { if (!TranslateAccelerator(mainPtr, accel, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } } delete scen_item_list; delete data_store5; delete data_store4; delete data_store3; if(data_store2 != NULL) delete[] data_store2; if(scen_headers != NULL) delete[] scen_headers; delete data_store; lose_graphics(); FreeLibrary((HMODULE) boeSoundsDLL); return msg.wParam; }
void Graphics::init() { loadPalette(); loadCursors(); loadFonts(); }